metro-file-map 0.84.1 → 0.84.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metro-file-map",
3
- "version": "0.84.1",
3
+ "version": "0.84.2",
4
4
  "description": "[Experimental] - 🚇 File crawling, watching and mapping for Metro",
5
5
  "main": "src/index.js",
6
6
  "exports": {
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @generated SignedSource<<7537b04fdc97fb54ebddaebf60605405>>
9
+ *
10
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
11
+ * Original file: packages/metro-file-map/src/Watcher.js
12
+ * To regenerate, run:
13
+ * js1 build metro-ts-defs (internal) OR
14
+ * yarn run build-ts-defs (OSS)
15
+ */
16
+
17
+ import type {
18
+ Console,
19
+ CrawlerOptions,
20
+ FileData,
21
+ Path,
22
+ PerfLogger,
23
+ WatcherBackendChangeEvent,
24
+ WatchmanClocks,
25
+ } from './flow-types';
26
+
27
+ import EventEmitter from 'events';
28
+
29
+ type CrawlResult = {
30
+ changedFiles: FileData;
31
+ clocks?: WatchmanClocks;
32
+ removedFiles: Set<Path>;
33
+ };
34
+ type WatcherOptions = {
35
+ abortSignal: AbortSignal;
36
+ computeSha1: boolean;
37
+ console: Console;
38
+ enableSymlinks: boolean;
39
+ extensions: ReadonlyArray<string>;
40
+ forceNodeFilesystemAPI: boolean;
41
+ healthCheckFilePrefix: string;
42
+ ignoreForCrawl: (filePath: string) => boolean;
43
+ ignorePatternForWatch: RegExp;
44
+ previousState: CrawlerOptions['previousState'];
45
+ perfLogger: null | undefined | PerfLogger;
46
+ roots: ReadonlyArray<string>;
47
+ rootDir: string;
48
+ useWatchman: boolean;
49
+ watch: boolean;
50
+ watchmanDeferStates: ReadonlyArray<string>;
51
+ };
52
+ export type HealthCheckResult =
53
+ | {
54
+ type: 'error';
55
+ timeout: number;
56
+ error: Error;
57
+ watcher: null | undefined | string;
58
+ }
59
+ | {
60
+ type: 'success';
61
+ timeout: number;
62
+ timeElapsed: number;
63
+ watcher: null | undefined | string;
64
+ }
65
+ | {
66
+ type: 'timeout';
67
+ timeout: number;
68
+ watcher: null | undefined | string;
69
+ pauseReason: null | undefined | string;
70
+ };
71
+ export declare class Watcher extends EventEmitter {
72
+ constructor(options: WatcherOptions);
73
+ crawl(): Promise<CrawlResult>;
74
+ watch(onChange: (change: WatcherBackendChangeEvent) => void): void;
75
+ close(): void;
76
+ checkHealth(timeout: number): Promise<HealthCheckResult>;
77
+ }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<9cdec2a3b7a46f0a893dd5dc392a5294>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro-file-map/src/cache/DiskCacheManager.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ import type {
19
+ BuildParameters,
20
+ CacheData,
21
+ CacheManager,
22
+ CacheManagerFactoryOptions,
23
+ CacheManagerWriteOptions,
24
+ } from '../flow-types';
25
+
26
+ type AutoSaveOptions = Readonly<{debounceMs: number}>;
27
+ type DiskCacheConfig = Readonly<{
28
+ autoSave?: Partial<AutoSaveOptions> | boolean;
29
+ cacheFilePrefix?: null | undefined | string;
30
+ cacheDirectory?: null | undefined | string;
31
+ }>;
32
+ export declare class DiskCacheManager implements CacheManager {
33
+ constructor(
34
+ $$PARAM_0$$: CacheManagerFactoryOptions,
35
+ $$PARAM_1$$: DiskCacheConfig,
36
+ );
37
+ static getCacheFilePath(
38
+ buildParameters: BuildParameters,
39
+ cacheFilePrefix?: null | undefined | string,
40
+ cacheDirectory?: null | undefined | string,
41
+ ): string;
42
+ getCacheFilePath(): string;
43
+ read(): Promise<null | undefined | CacheData>;
44
+ write(
45
+ getSnapshot: () => CacheData,
46
+ $$PARAM_1$$: CacheManagerWriteOptions,
47
+ ): Promise<void>;
48
+ end(): Promise<void>;
49
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @generated SignedSource<<733fae11203b79438dfb1ee2bbb6473d>>
9
+ *
10
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
11
+ * Original file: packages/metro-file-map/src/constants.js
12
+ * To regenerate, run:
13
+ * js1 build metro-ts-defs (internal) OR
14
+ * yarn run build-ts-defs (OSS)
15
+ */
16
+
17
+ import type {HType} from './flow-types';
18
+
19
+ declare const $$EXPORT_DEFAULT_DECLARATION$$: HType;
20
+ declare type $$EXPORT_DEFAULT_DECLARATION$$ =
21
+ typeof $$EXPORT_DEFAULT_DECLARATION$$;
22
+ export default $$EXPORT_DEFAULT_DECLARATION$$;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<8b6ff8a24f9156cd7991006c72edd296>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro-file-map/src/crawlers/node/hasNativeFindSupport.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ declare function hasNativeFindSupport(): Promise<boolean>;
19
+ export default hasNativeFindSupport;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<8851cd12d3cd8bdda798362696c830a2>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro-file-map/src/crawlers/node/index.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ import type {CanonicalPath, CrawlerOptions, FileData} from '../../flow-types';
19
+
20
+ declare function nodeCrawl(
21
+ options: CrawlerOptions,
22
+ ): Promise<{removedFiles: Set<CanonicalPath>; changedFiles: FileData}>;
23
+ export default nodeCrawl;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<94c8a03429d06b694e26ca524fb9f17c>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro-file-map/src/crawlers/watchman/index.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ import type {
19
+ CanonicalPath,
20
+ CrawlerOptions,
21
+ FileData,
22
+ WatchmanClocks,
23
+ } from '../../flow-types';
24
+
25
+ declare function watchmanCrawl($$PARAM_0$$: CrawlerOptions): Promise<{
26
+ changedFiles: FileData;
27
+ removedFiles: Set<CanonicalPath>;
28
+ clocks: WatchmanClocks;
29
+ }>;
30
+ export default watchmanCrawl;
@@ -0,0 +1,411 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @noformat
8
+ * @oncall react_native
9
+ * @generated SignedSource<<919ac912df195d04796dd62cb68839d2>>
10
+ *
11
+ * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
+ * Original file: packages/metro-file-map/src/flow-types.js
13
+ * To regenerate, run:
14
+ * js1 build metro-ts-defs (internal) OR
15
+ * yarn run build-ts-defs (OSS)
16
+ */
17
+
18
+ import type {PerfLogger, PerfLoggerFactory, RootPerfLogger} from 'metro-config';
19
+
20
+ export type {PerfLoggerFactory, PerfLogger};
21
+ export type BuildParameters = Readonly<{
22
+ computeSha1: boolean;
23
+ enableSymlinks: boolean;
24
+ extensions: ReadonlyArray<string>;
25
+ forceNodeFilesystemAPI: boolean;
26
+ ignorePattern: RegExp;
27
+ plugins: ReadonlyArray<FileMapPlugin>;
28
+ retainAllFiles: boolean;
29
+ rootDir: string;
30
+ roots: ReadonlyArray<string>;
31
+ cacheBreaker: string;
32
+ }>;
33
+ export type BuildResult = {fileSystem: FileSystem};
34
+ export type CacheData = Readonly<{
35
+ clocks: WatchmanClocks;
36
+ fileSystemData: unknown;
37
+ plugins: ReadonlyMap<string, void | V8Serializable>;
38
+ }>;
39
+ export interface CacheManager {
40
+ /**
41
+ * Called during startup to load initial state, if available. Provided to
42
+ * a crawler, which will return the delta between the initial state and the
43
+ * current file system state.
44
+ */
45
+ read(): Promise<null | undefined | CacheData>;
46
+ /**
47
+ * Called when metro-file-map `build()` has applied changes returned by the
48
+ * crawler - i.e. internal state reflects the current file system state.
49
+ *
50
+ * getSnapshot may be retained and called at any time before end(), such as
51
+ * in response to eventSource 'change' events.
52
+ */
53
+ write(
54
+ getSnapshot: () => CacheData,
55
+ opts: CacheManagerWriteOptions,
56
+ ): Promise<void>;
57
+ /**
58
+ * The last call that will be made to this CacheManager. Any handles should
59
+ * be closed by the time this settles.
60
+ */
61
+ end(): Promise<void>;
62
+ }
63
+ export interface CacheManagerEventSource {
64
+ onChange(listener: () => void): () => void;
65
+ }
66
+ export type CacheManagerFactory = (
67
+ options: CacheManagerFactoryOptions,
68
+ ) => CacheManager;
69
+ export type CacheManagerFactoryOptions = Readonly<{
70
+ buildParameters: BuildParameters;
71
+ }>;
72
+ export type CacheManagerWriteOptions = Readonly<{
73
+ changedSinceCacheRead: boolean;
74
+ eventSource: CacheManagerEventSource;
75
+ onWriteError: (error: Error) => void;
76
+ }>;
77
+ export type CanonicalPath = string;
78
+ export type ChangeEvent = {
79
+ logger: null | undefined | RootPerfLogger;
80
+ eventsQueue: EventsQueue;
81
+ };
82
+ export type ChangeEventMetadata = {
83
+ modifiedTime: null | undefined | number;
84
+ size: null | undefined | number;
85
+ type: 'f' | 'd' | 'l';
86
+ };
87
+ export type Console = typeof global.console;
88
+ export type CrawlerOptions = {
89
+ abortSignal: null | undefined | AbortSignal;
90
+ computeSha1: boolean;
91
+ console: Console;
92
+ extensions: ReadonlyArray<string>;
93
+ forceNodeFilesystemAPI: boolean;
94
+ ignore: IgnoreMatcher;
95
+ includeSymlinks: boolean;
96
+ perfLogger?: null | undefined | PerfLogger;
97
+ previousState: Readonly<{
98
+ clocks: ReadonlyMap<CanonicalPath, WatchmanClockSpec>;
99
+ fileSystem: FileSystem;
100
+ }>;
101
+ rootDir: string;
102
+ roots: ReadonlyArray<string>;
103
+ onStatus: (status: WatcherStatus) => void;
104
+ };
105
+ export type DependencyExtractor = {
106
+ extract: (
107
+ content: string,
108
+ absoluteFilePath: string,
109
+ defaultExtractor?: DependencyExtractor['extract'],
110
+ ) => Set<string>;
111
+ getCacheKey: () => string;
112
+ };
113
+ export type WatcherStatus =
114
+ | {
115
+ type: 'watchman_slow_command';
116
+ timeElapsed: number;
117
+ command: 'watch-project' | 'query';
118
+ }
119
+ | {
120
+ type: 'watchman_slow_command_complete';
121
+ timeElapsed: number;
122
+ command: 'watch-project' | 'query';
123
+ }
124
+ | {
125
+ type: 'watchman_warning';
126
+ warning: unknown;
127
+ command: 'watch-project' | 'query';
128
+ };
129
+ export type DuplicatesSet = Map<string, number>;
130
+ export type DuplicatesIndex = Map<string, Map<string, DuplicatesSet>>;
131
+ export type EventsQueue = Array<{
132
+ filePath: Path;
133
+ metadata: ChangeEventMetadata;
134
+ type: string;
135
+ }>;
136
+ export type FileMapDelta<T = null | void> = Readonly<{
137
+ removed: Iterable<[CanonicalPath, T]>;
138
+ addedOrModified: Iterable<[CanonicalPath, T]>;
139
+ }>;
140
+ export type FileMapPluginInitOptions<
141
+ SerializableState,
142
+ PerFileData = void,
143
+ > = Readonly<{
144
+ files: Readonly<{
145
+ fileIterator(
146
+ opts: Readonly<{includeNodeModules: boolean; includeSymlinks: boolean}>,
147
+ ): Iterable<{
148
+ baseName: string;
149
+ canonicalPath: string;
150
+ pluginData: null | undefined | PerFileData;
151
+ }>;
152
+ lookup(
153
+ mixedPath: string,
154
+ ):
155
+ | {exists: false}
156
+ | {exists: true; type: 'f'; pluginData: PerFileData}
157
+ | {exists: true; type: 'd'};
158
+ }>;
159
+ pluginState: null | undefined | SerializableState;
160
+ }>;
161
+ export type FileMapPluginWorker = Readonly<{
162
+ worker: Readonly<{modulePath: string; setupArgs: JsonData}>;
163
+ filter: ($$PARAM_0$$: {
164
+ normalPath: string;
165
+ isNodeModules: boolean;
166
+ }) => boolean;
167
+ }>;
168
+ export type V8Serializable =
169
+ | string
170
+ | number
171
+ | boolean
172
+ | null
173
+ | ReadonlyArray<V8Serializable>
174
+ | ReadonlySet<V8Serializable>
175
+ | ReadonlyMap<string, V8Serializable>
176
+ | Readonly<{[key: string]: V8Serializable}>;
177
+ export interface FileMapPlugin<
178
+ SerializableState extends void | V8Serializable = void | V8Serializable,
179
+ PerFileData extends void | V8Serializable = void | V8Serializable,
180
+ > {
181
+ readonly name: string;
182
+ initialize(
183
+ initOptions: FileMapPluginInitOptions<SerializableState, PerFileData>,
184
+ ): Promise<void>;
185
+ assertValid(): void;
186
+ bulkUpdate(delta: FileMapDelta<null | undefined | PerFileData>): void;
187
+ getSerializableSnapshot(): SerializableState;
188
+ onRemovedFile(
189
+ relativeFilePath: string,
190
+ pluginData: null | undefined | PerFileData,
191
+ ): void;
192
+ onNewOrModifiedFile(
193
+ relativeFilePath: string,
194
+ pluginData: null | undefined | PerFileData,
195
+ ): void;
196
+ getCacheKey(): string;
197
+ getWorker(): null | undefined | FileMapPluginWorker;
198
+ }
199
+ export interface MetadataWorker {
200
+ processFile(
201
+ $$PARAM_0$$: WorkerMessage,
202
+ $$PARAM_1$$: Readonly<{getContent: () => Buffer}>,
203
+ ): V8Serializable;
204
+ }
205
+ export type HType = {
206
+ MTIME: 0;
207
+ SIZE: 1;
208
+ VISITED: 2;
209
+ SHA1: 3;
210
+ SYMLINK: 4;
211
+ PLUGINDATA: number;
212
+ PATH: 0;
213
+ TYPE: 1;
214
+ MODULE: 0;
215
+ PACKAGE: 1;
216
+ GENERIC_PLATFORM: 'g';
217
+ NATIVE_PLATFORM: 'native';
218
+ };
219
+ export type HTypeValue = HType[keyof HType];
220
+ export type IgnoreMatcher = (item: string) => boolean;
221
+ export type FileData = Map<CanonicalPath, FileMetadata>;
222
+ export type FileMetadata = [
223
+ null | undefined | number,
224
+ number,
225
+ 0 | 1,
226
+ null | undefined | string,
227
+ 0 | 1 | string,
228
+ ...unknown[],
229
+ ];
230
+ export type FileStats = Readonly<{
231
+ fileType: 'f' | 'l';
232
+ modifiedTime: null | undefined | number;
233
+ size: null | undefined | number;
234
+ }>;
235
+ export interface FileSystem {
236
+ exists(file: Path): boolean;
237
+ getAllFiles(): Array<Path>;
238
+ getDifference(files: FileData): {
239
+ changedFiles: FileData;
240
+ removedFiles: Set<string>;
241
+ };
242
+ getSerializableSnapshot(): CacheData['fileSystemData'];
243
+ getSha1(file: Path): null | undefined | string;
244
+ getOrComputeSha1(
245
+ file: Path,
246
+ ): Promise<null | undefined | {sha1: string; content?: Buffer}>;
247
+ /**
248
+ * Given a start path (which need not exist), a subpath and type, and
249
+ * optionally a 'breakOnSegment', performs the following:
250
+ *
251
+ * X = mixedStartPath
252
+ * do
253
+ * if basename(X) === opts.breakOnSegment
254
+ * return null
255
+ * if X + subpath exists and has type opts.subpathType
256
+ * return {
257
+ * absolutePath: realpath(X + subpath)
258
+ * containerRelativePath: relative(mixedStartPath, X)
259
+ * }
260
+ * X = dirname(X)
261
+ * while X !== dirname(X)
262
+ *
263
+ * If opts.invalidatedBy is given, collects all absolute, real paths that if
264
+ * added or removed may invalidate this result.
265
+ *
266
+ * Useful for finding the closest package scope (subpath: package.json,
267
+ * type f, breakOnSegment: node_modules) or closest potential package root
268
+ * (subpath: node_modules/pkg, type: d) in Node.js resolution.
269
+ */
270
+ hierarchicalLookup(
271
+ mixedStartPath: string,
272
+ subpath: string,
273
+ opts: {
274
+ breakOnSegment: null | undefined | string;
275
+ invalidatedBy: null | undefined | Set<string>;
276
+ subpathType: 'f' | 'd';
277
+ },
278
+ ): null | undefined | {absolutePath: string; containerRelativePath: string};
279
+ /**
280
+ * Analogous to posix lstat. If the file at `file` is a symlink, return
281
+ * information about the symlink without following it.
282
+ */
283
+ linkStats(file: Path): null | undefined | FileStats;
284
+ /**
285
+ * Return information about the given path, whether a directory or file.
286
+ * Always follow symlinks, and return a real path if it exists.
287
+ */
288
+ lookup(mixedPath: Path): LookupResult;
289
+ matchFiles(opts: {
290
+ filter?: RegExp | null;
291
+ filterCompareAbsolute?: boolean;
292
+ filterComparePosix?: boolean;
293
+ follow?: boolean;
294
+ recursive?: boolean;
295
+ rootDir?: Path | null;
296
+ }): Iterable<Path>;
297
+ }
298
+ export type Glob = string;
299
+ export type JsonData =
300
+ | string
301
+ | number
302
+ | boolean
303
+ | null
304
+ | Array<JsonData>
305
+ | {[key: string]: JsonData};
306
+ export type LookupResult =
307
+ | {exists: false; links: ReadonlySet<string>; missing: string}
308
+ | {exists: true; links: ReadonlySet<string>; realPath: string; type: 'd'}
309
+ | {
310
+ exists: true;
311
+ links: ReadonlySet<string>;
312
+ realPath: string;
313
+ type: 'f';
314
+ metadata: FileMetadata;
315
+ };
316
+ export interface MockMap {
317
+ getMockModule(name: string): null | undefined | Path;
318
+ }
319
+ export type HasteConflict = {
320
+ id: string;
321
+ platform: string | null;
322
+ absolutePaths: Array<string>;
323
+ type: 'duplicate' | 'shadowing';
324
+ };
325
+ export interface HasteMap {
326
+ getModule(
327
+ name: string,
328
+ platform?: null | undefined | string,
329
+ supportsNativePlatform?: null | undefined | boolean,
330
+ type?: null | undefined | HTypeValue,
331
+ ): null | undefined | Path;
332
+ getModuleNameByPath(file: Path): null | undefined | string;
333
+ getPackage(
334
+ name: string,
335
+ platform: null | undefined | string,
336
+ _supportsNativePlatform: null | undefined | boolean,
337
+ ): null | undefined | Path;
338
+ computeConflicts(): Array<HasteConflict>;
339
+ }
340
+ export type HasteMapData = Map<string, HasteMapItem>;
341
+ export type HasteMapItem = {
342
+ [platform: string]: HasteMapItemMetadata;
343
+ };
344
+ export type HasteMapItemMetadata = [string, number];
345
+ export interface MutableFileSystem extends FileSystem {
346
+ remove(filePath: Path): null | undefined | FileMetadata;
347
+ addOrModify(filePath: Path, fileMetadata: FileMetadata): void;
348
+ bulkAddOrModify(addedOrModifiedFiles: FileData): void;
349
+ }
350
+ export type Path = string;
351
+ export type ProcessFileFunction = (
352
+ normalPath: string,
353
+ metadata: FileMetadata,
354
+ request: Readonly<{computeSha1: boolean}>,
355
+ ) => null | undefined | Buffer;
356
+ export type RawMockMap = Readonly<{
357
+ duplicates: Map<string, Set<string>>;
358
+ mocks: Map<string, Path>;
359
+ version: number;
360
+ }>;
361
+ export type ReadOnlyRawMockMap = Readonly<{
362
+ duplicates: ReadonlyMap<string, ReadonlySet<string>>;
363
+ mocks: ReadonlyMap<string, Path>;
364
+ version: number;
365
+ }>;
366
+ export interface WatcherBackend {
367
+ getPauseReason(): null | undefined | string;
368
+ onError(listener: (error: Error) => void): () => void;
369
+ onFileEvent(listener: (event: WatcherBackendChangeEvent) => void): () => void;
370
+ startWatching(): Promise<void>;
371
+ stopWatching(): Promise<void>;
372
+ }
373
+ export type ChangeEventClock = [string, string];
374
+ export type WatcherBackendChangeEvent =
375
+ | Readonly<{
376
+ event: 'touch';
377
+ clock?: ChangeEventClock;
378
+ relativePath: string;
379
+ root: string;
380
+ metadata: ChangeEventMetadata;
381
+ }>
382
+ | Readonly<{
383
+ event: 'delete';
384
+ clock?: ChangeEventClock;
385
+ relativePath: string;
386
+ root: string;
387
+ metadata?: void;
388
+ }>;
389
+ export type WatcherBackendOptions = Readonly<{
390
+ ignored: null | undefined | RegExp;
391
+ globs: ReadonlyArray<string>;
392
+ dot: boolean;
393
+ }>;
394
+ export type WatchmanClockSpec =
395
+ | string
396
+ | Readonly<{scm: Readonly<{'mergebase-with': string}>}>;
397
+ export type WatchmanClocks = Map<Path, WatchmanClockSpec>;
398
+ export type WorkerMessage = Readonly<{
399
+ computeSha1: boolean;
400
+ filePath: string;
401
+ maybeReturnContent: boolean;
402
+ pluginsToRun: ReadonlyArray<number>;
403
+ }>;
404
+ export type WorkerMetadata = Readonly<{
405
+ sha1?: null | undefined | string;
406
+ content?: null | undefined | Buffer;
407
+ pluginData?: ReadonlyArray<V8Serializable>;
408
+ }>;
409
+ export type WorkerSetupArgs = Readonly<{
410
+ plugins?: ReadonlyArray<FileMapPluginWorker['worker']>;
411
+ }>;