## API Report File for "metro-file-map" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts import EventEmitter from 'node:events'; export type BuildParameters = Readonly<{ computeSha1: boolean; enableSymlinks: boolean; extensions: ReadonlyArray; ignorePattern: RegExp; plugins: ReadonlyArray; retainAllFiles: boolean; rootDir: string; roots: ReadonlyArray; cacheBreaker: string; }>; export type BuildResult = {fileSystem: FileSystem_2}; export type CacheData = Readonly<{ clocks: WatchmanClocks; fileSystemData: unknown; plugins: ReadonlyMap; }>; export interface CacheManager { end(): Promise; read(): Promise; write(getSnapshot: () => CacheData, opts: CacheManagerWriteOptions): Promise; } export type CacheManagerFactory = (options: CacheManagerFactoryOptions) => CacheManager; export type CacheManagerFactoryOptions = Readonly<{ buildParameters: BuildParameters; }>; export type CacheManagerWriteOptions = Readonly<{ changedSinceCacheRead: boolean; eventSource: CacheManagerEventSource; onWriteError: (error: Error) => void; }>; export type ChangeEvent = Readonly<{ logger?: null | undefined | RootPerfLogger; changes: ReadonlyFileSystemChanges>; pluginChanges: ReadonlyMap; rootDir: string; }>; export type ChangeEventMetadata = { modifiedTime: null | undefined | number; size: null | undefined | number; type: 'f' | 'd' | 'l'; }; export type Crawler = (options: CrawlerOptions) => Promise; export type CrawlerFactory = (options: CrawlerFactoryOptions) => Crawler; export type CrawlerFactoryOptions = Readonly<{ buildParameters: BuildParameters; pluginDataIndices: ReadonlyMap; }>; export type CrawlerOptions = { abortSignal?: null | undefined | AbortSignal; computeSha1: boolean; console: Console_2; extensions: ReadonlyArray; ignore: IgnoreMatcher; includeSymlinks: boolean; perfLogger?: null | undefined | PerfLogger; previousState: Readonly<{ clocks: ReadonlyMap; fileSystem: FileSystem_2; }>; rootDir: string; roots: ReadonlyArray; onStatus: (status: WatcherStatus) => void; subpath?: string | undefined; }; export type CrawlResult = {changedFiles: FileData; removedFiles: Set; clocks: WatchmanClocks} | {changedFiles: FileData; removedFiles: Set}; export type DependencyExtractor = { extract: (content: string, absoluteFilePath: string, defaultExtractor?: DependencyExtractor['extract']) => Set; getCacheKey: () => string; }; export class DependencyPlugin extends FileDataPlugin | null> { constructor(options: DependencyPluginOptions); getDependencies(mixedPath: Path): null | undefined | ReadonlyArray; } export type DependencyPluginOptions = Readonly<{ dependencyExtractor: null | undefined | string; computeDependencies: boolean; }>; export class DiskCacheManager implements CacheManager { constructor(opts: CacheManagerFactoryOptions, config: DiskCacheConfig); end(): Promise; static getCacheFilePath(buildParameters: BuildParameters, cacheFilePrefix?: null | undefined | string, cacheDirectory?: null | undefined | string): string; getCacheFilePath(): string; read(): Promise; write(getSnapshot: () => CacheData, opts: CacheManagerWriteOptions): Promise; } export class DuplicateHasteCandidatesError extends Error { constructor(name: string, platform: string, supportsNativePlatform: boolean, duplicatesSet: DuplicatesSet); duplicatesSet: DuplicatesSet; hasteName: string; platform: string | null; supportsNativePlatform: boolean; } export type FileData = Map; export class FileDataPlugin implements FileMapPlugin { constructor(opts: FileDataPluginOptions); assertValid(): void; getCacheKey(): string; getFileSystem(): FileMapPluginInitOptions['files']; getOrComputeFileData(mixedPath: string, observations?: null | undefined | Observations): ReturnType['getOrComputeFileData']>; getSerializableSnapshot(): null; getWorker(): FileMapPluginWorker; initialize(initOptions: FileMapPluginInitOptions): Promise; readonly name: string; onChanged(_changes: ReadonlyFileSystemChanges): void; } export type FileDataPluginOptions = Readonly< Omit & { name: string; cacheKey: string; } >; export type FileDataResult = | Readonly<{exists: false}> | Readonly<{exists: true; type: 'd'}> | Readonly<{ exists: true; type: 'f'; realPath: string; data: null | undefined | PerFileData; }>; class FileMap extends EventEmitter { constructor(options: InputOptions); addRoot(root: string): Promise; build(): Promise; static create(options: InputOptions): FileMap; end(): Promise; getRoots(): ReadonlyArray; static H: HType; read(): Promise; } export {FileMap}; export default FileMap; export type FileMapRoot = Readonly<{ absolutePath: string; rootRelativePath: string; dynamic: boolean; }>; interface FileSystem_2 { exists(file: Path): boolean; getAllFiles(): Array; getDifference( files: FileData, options?: Readonly<{ subpath?: string | undefined; }>, ): { changedFiles: FileData; removedFiles: Set; filesToStat: Map; }; getOrComputeSha1(file: Path): Promise; getSerializableSnapshot(): CacheData['fileSystemData']; getSha1(file: Path): null | undefined | string; hierarchicalLookup( mixedStartPath: string, subpath: string, opts: { breakOnSegment?: null | undefined | string; subpathType: 'f' | 'd'; }, observations?: null | undefined | Observations, ): null | undefined | {absolutePath: string; containerRelativePath: string}; isMapped(canonicalPath: CanonicalPath): boolean; linkStats(file: Path): null | undefined | FileStats; lookup(mixedPath: Path, observations?: null | undefined | Observations): LookupResult; matchFiles( opts: { filter?: RegExp | null | undefined; filterCompareAbsolute?: boolean | undefined; filterComparePosix?: boolean | undefined; follow?: boolean | undefined; recursive?: boolean | undefined; rootDir?: Path | null | undefined; }, observations?: null | undefined | Observations, ): Iterable; } export {FileSystem_2 as FileSystem}; export function getPluginChanges( event: ChangeEvent, plugin: FileMapPlugin< /** * > | plugin: FileMapPlugin, * | ^^^^^ Unsupported feature: Translating "empty type" is currently not supported. **/ any, /** * > | plugin: FileMapPlugin, * | ^^^^^ Unsupported feature: Translating "empty type" is currently not supported. **/ any, ChangeSummary >, ): ChangeSummary | void; export type HasteChanges = Readonly<{changedNames: ReadonlySet}>; export class HasteConflictsError extends Error { constructor(conflicts: ReadonlyArray); getDetailedMessage(pathsRelativeToRoot: null | undefined | string): string; } export interface HasteMap { computeConflicts(): Array; getModule(name: string, platform?: null | undefined | string, supportsNativePlatform?: null | undefined | boolean, type?: null | undefined | HTypeValue): null | undefined | Path; getModuleNameByPath(file: Path): null | undefined | string; getPackage(name: string, platform: null | undefined | string, _supportsNativePlatform: null | undefined | boolean): null | undefined | Path; } export type HasteMapData = Map; export type HasteMapItem = { [platform: string]: HasteMapItemMetadata; }; export class HastePlugin implements HasteMap, FileMapPlugin { constructor(options: HasteMapOptions); assertValid(): void; computeConflicts(): Array; getCacheKey(): string; getModule(name: string, platform?: null | undefined | string, supportsNativePlatform?: null | undefined | boolean, type?: null | undefined | HTypeValue): null | undefined | Path; getModuleNameByPath(mixedPath: Path): null | undefined | string; getPackage(name: string, platform: null | undefined | string, _supportsNativePlatform?: null | undefined | boolean): null | undefined | Path; getSerializableSnapshot(): null; getWorker(): FileMapPluginWorker; initialize(opts: FileMapPluginInitOptions): Promise; readonly name: 'haste'; onChanged(delta: ReadonlyFileSystemChanges): HasteChanges | void; setModule(id: string, module: HasteMapItemMetadata): void; } export type HealthCheckResult = | { type: 'error'; timeout: number; error: Error; watcher: null | undefined | string; } | { type: 'success'; timeout: number; timeElapsed: number; watcher: null | undefined | string; } | { type: 'timeout'; timeout: number; watcher: null | undefined | string; pauseReason: null | undefined | string; }; export type InputFileMapPlugin = FileMapPlugin< /** * > | export type InputFileMapPlugin = FileMapPlugin; * | ^^^^^ Unsupported feature: Translating "empty type" is currently not supported. **/ any, /** * > | export type InputFileMapPlugin = FileMapPlugin; * | ^^^^^ Unsupported feature: Translating "empty type" is currently not supported. **/ any, unknown >; export type InputOptions = Readonly<{ computeSha1?: null | undefined | boolean; enableSymlinks?: null | undefined | boolean; extensions: ReadonlyArray; ignorePattern?: null | undefined | RegExp; plugins?: ReadonlyArray | undefined; retainAllFiles: boolean; rootDir: string; roots: ReadonlyArray; cacheManagerFactory?: null | undefined | CacheManagerFactory; console?: Console_2 | undefined; crawlerFactory?: null | undefined | CrawlerFactory; healthCheck: HealthCheckOptions; maxFilesPerWorker?: null | undefined | number; maxWorkers: number; perfLoggerFactory?: null | undefined | PerfLoggerFactory; resetCache?: null | undefined | boolean; useWatchman?: null | undefined | boolean; watch?: null | undefined | boolean; watchmanDeferStates?: ReadonlyArray | undefined; }>; export class NoopCacheManager implements CacheManager { end(): Promise; read(): Promise; write(): Promise; } export type WatcherStatus = | { type: 'watchman_slow_command'; timeElapsed: number; command: 'watch-project' | 'query'; } | { type: 'watchman_slow_command_complete'; timeElapsed: number; command: 'watch-project' | 'query'; } | { type: 'watchman_warning'; warning: unknown; command: 'watch-project' | 'query'; }; ```