1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import type { Stats } from 'graceful-fs';
|
9 | import type { Config } from '@jest/types';
|
10 | import type HasteFS from './HasteFS';
|
11 | import type ModuleMap from './ModuleMap';
|
12 | declare type ValueType<T> = T extends Map<string, infer V> ? V : never;
|
13 | export declare type SerializableModuleMap = {
|
14 | duplicates: ReadonlyArray<[string, [string, [string, [string, number]]]]>;
|
15 | map: ReadonlyArray<[string, ValueType<ModuleMapData>]>;
|
16 | mocks: ReadonlyArray<[string, ValueType<MockData>]>;
|
17 | rootDir: Config.Path;
|
18 | };
|
19 | export interface IModuleMap<S = SerializableModuleMap> {
|
20 | getModule(name: string, platform?: string | null, supportsNativePlatform?: boolean | null, type?: HTypeValue | null): Config.Path | null;
|
21 | getPackage(name: string, platform: string | null | undefined, _supportsNativePlatform: boolean | null): Config.Path | null;
|
22 | getMockModule(name: string): Config.Path | undefined;
|
23 | getRawModuleMap(): RawModuleMap;
|
24 | toJSON(): S;
|
25 | }
|
26 | export declare type HasteMapStatic<S = SerializableModuleMap> = {
|
27 | getCacheFilePath(tmpdir: Config.Path, name: string, ...extra: Array<string>): string;
|
28 | getModuleMapFromJSON(json: S): IModuleMap<S>;
|
29 | };
|
30 | export declare type IgnoreMatcher = (item: string) => boolean;
|
31 | export declare type WorkerMessage = {
|
32 | computeDependencies: boolean;
|
33 | computeSha1: boolean;
|
34 | dependencyExtractor?: string | null;
|
35 | rootDir: string;
|
36 | filePath: string;
|
37 | hasteImplModulePath?: string;
|
38 | };
|
39 | export declare type WorkerMetadata = {
|
40 | dependencies: Array<string> | undefined | null;
|
41 | id: string | undefined | null;
|
42 | module: ModuleMetaData | undefined | null;
|
43 | sha1: string | undefined | null;
|
44 | };
|
45 | export declare type CrawlerOptions = {
|
46 | computeSha1: boolean;
|
47 | enableSymlinks: boolean;
|
48 | data: InternalHasteMap;
|
49 | extensions: Array<string>;
|
50 | forceNodeFilesystemAPI: boolean;
|
51 | ignore: IgnoreMatcher;
|
52 | rootDir: string;
|
53 | roots: Array<string>;
|
54 | };
|
55 | export declare type HasteImpl = {
|
56 | getHasteName(filePath: Config.Path): string | undefined;
|
57 | };
|
58 | export declare type FileData = Map<Config.Path, FileMetaData>;
|
59 | export declare type FileMetaData = [
|
60 | string,
|
61 | number,
|
62 | number,
|
63 | 0 | 1,
|
64 | string,
|
65 | string | null | undefined
|
66 | ];
|
67 | export declare type MockData = Map<string, Config.Path>;
|
68 | export declare type ModuleMapData = Map<string, ModuleMapItem>;
|
69 | export declare type WatchmanClockSpec = string | {
|
70 | scm: {
|
71 | 'mergebase-with': string;
|
72 | };
|
73 | };
|
74 | export declare type WatchmanClocks = Map<Config.Path, WatchmanClockSpec>;
|
75 | export declare type HasteRegExp = RegExp | ((str: string) => boolean);
|
76 | export declare type DuplicatesSet = Map<string, /* type */ number>;
|
77 | export declare type DuplicatesIndex = Map<string, Map<string, DuplicatesSet>>;
|
78 | export declare type InternalHasteMap = {
|
79 | clocks: WatchmanClocks;
|
80 | duplicates: DuplicatesIndex;
|
81 | files: FileData;
|
82 | map: ModuleMapData;
|
83 | mocks: MockData;
|
84 | };
|
85 | export declare type IHasteMap = {
|
86 | hasteFS: HasteFS;
|
87 | moduleMap: IModuleMap;
|
88 | __hasteMapForTest?: InternalHasteMap | null;
|
89 | };
|
90 | export declare type HasteMap = {
|
91 | hasteFS: HasteFS;
|
92 | moduleMap: ModuleMap;
|
93 | __hasteMapForTest?: InternalHasteMap | null;
|
94 | };
|
95 | export declare type RawModuleMap = {
|
96 | rootDir: Config.Path;
|
97 | duplicates: DuplicatesIndex;
|
98 | map: ModuleMapData;
|
99 | mocks: MockData;
|
100 | };
|
101 | declare type ModuleMapItem = {
|
102 | [platform: string]: ModuleMetaData;
|
103 | };
|
104 | export declare type ModuleMetaData = [Config.Path, /* type */ number];
|
105 | export declare type HType = {
|
106 | ID: 0;
|
107 | MTIME: 1;
|
108 | SIZE: 2;
|
109 | VISITED: 3;
|
110 | DEPENDENCIES: 4;
|
111 | SHA1: 5;
|
112 | PATH: 0;
|
113 | TYPE: 1;
|
114 | MODULE: 0;
|
115 | PACKAGE: 1;
|
116 | GENERIC_PLATFORM: 'g';
|
117 | NATIVE_PLATFORM: 'native';
|
118 | DEPENDENCY_DELIM: '\0';
|
119 | };
|
120 | export declare type HTypeValue = HType[keyof HType];
|
121 | export declare type EventsQueue = Array<{
|
122 | filePath: Config.Path;
|
123 | stat: Stats | undefined;
|
124 | type: string;
|
125 | }>;
|
126 | export declare type ChangeEvent = {
|
127 | eventsQueue: EventsQueue;
|
128 | hasteFS: HasteFS;
|
129 | moduleMap: ModuleMap;
|
130 | };
|
131 | export {};
|
132 |
|
\ | No newline at end of file |