/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noformat * @oncall react_native * @generated SignedSource<<7d56c2a1b6c1239df1938fe8fa9294f0>> * * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js * Original file: packages/metro-file-map/src/plugins/FileDataPlugin.js * To regenerate, run: * js1 build metro-ts-defs (internal) OR * yarn run build-ts-defs (OSS) */ import type {FileMapPlugin, FileMapPluginInitOptions, FileMapPluginWorker, Observations, ReadonlyFileSystemChanges, V8Serializable} from '../flow-types'; export type FileDataPluginOptions = Readonly< Omit & { name: string; cacheKey: string; } >; /** * Base class for FileMap plugins that store per-file data via a worker and * have no separate serializable state. Provides default no-op implementations * of lifecycle methods that subclasses can override as needed. */ declare class FileDataPlugin implements FileMapPlugin { readonly name: string; constructor(opts: FileDataPluginOptions); initialize(initOptions: FileMapPluginInitOptions): Promise; /** * This plugin's data for the file at `mixedPath`, running its worker on the * file first if the plugin is lazy and the file has no data yet. If * `observations` is given, a regular file found is recorded in `content`. */ getOrComputeFileData(mixedPath: string, observations?: null | undefined | Observations): ReturnType['getOrComputeFileData']>; getFileSystem(): FileMapPluginInitOptions['files']; onChanged(_changes: ReadonlyFileSystemChanges): void; assertValid(): void; getSerializableSnapshot(): null; getCacheKey(): string; getWorker(): FileMapPluginWorker; } export default FileDataPlugin;