forked from jestjs/jest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHasteMap.js
75 lines (64 loc) · 1.77 KB
/
HasteMap.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
import type {
ModuleMap as _ModuleMap,
SerializableModuleMap as _SerializableModuleMap,
FS,
} from 'jest-haste-map';
import type {Path} from 'types/Config';
export type HasteFS = FS;
export type ModuleMap = _ModuleMap;
export type SerializableModuleMap = _SerializableModuleMap;
export type FileData = Map<Path, FileMetaData>;
export type MockData = Map<string, Path>;
export type ModuleMapData = Map<string, ModuleMapItem>;
export type WatchmanClocks = Map<Path, string>;
export type HasteRegExp = RegExp | ((str: string) => boolean);
export type DuplicatesSet = Map<string, /* type */ number>;
export type DuplicatesIndex = Map<string, Map<string, DuplicatesSet>>;
export type InternalHasteMap = {|
clocks: WatchmanClocks,
duplicates: DuplicatesIndex,
files: FileData,
map: ModuleMapData,
mocks: MockData,
|};
export type HasteMap = {|
hasteFS: HasteFS,
moduleMap: ModuleMap,
__hasteMapForTest?: ?InternalHasteMap,
|};
export type RawModuleMap = {|
rootDir: Path,
duplicates: DuplicatesIndex,
map: ModuleMapData,
mocks: MockData,
|};
export type FileMetaData = [
/* id */ string,
/* mtime */ number,
/* visited */ 0 | 1,
/* dependencies */ Array<string>,
/* sha1 */ ?string,
];
type ModuleMapItem = {[platform: string]: ModuleMetaData, __proto__: null};
export type ModuleMetaData = [Path, /* type */ number];
export type HType = {|
ID: 0,
MTIME: 1,
VISITED: 2,
DEPENDENCIES: 3,
PATH: 0,
TYPE: 1,
MODULE: 0,
PACKAGE: 1,
GENERIC_PLATFORM: 'g',
NATIVE_PLATFORM: 'native',
|};
export type HTypeValue = 0 | 1 | 2 | 3 | 'g';