/** * 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. * * @format * @oncall react_native */ import type Bundler from './Bundler'; import type { Options as DeltaBundlerOptions, ReadOnlyDependencies, TransformInputOptions, } from './DeltaBundler/types'; import type {GraphId} from './lib/getGraphId'; import type {ConfigT} from 'metro-config'; import DeltaBundler, {DeltaResult, Graph, Module} from './DeltaBundler'; import {ResolverInputOptions} from './shared/types'; export type RevisionId = string; export type OutputGraph = Graph; export interface OtherOptions { readonly onProgress: DeltaBundlerOptions['onProgress']; readonly shallow: boolean; } export interface GraphRevision { readonly id: RevisionId; readonly date: Date; readonly graphId: GraphId; readonly graph: OutputGraph; readonly prepend: ReadonlyArray>; } export interface IncrementalBundlerOptions { readonly hasReducedPerformance?: boolean; readonly watch?: boolean; } export default class IncrementalBundler { static revisionIdFromString: (str: string) => RevisionId; constructor(config: ConfigT, options?: IncrementalBundlerOptions); end(): void; getBundler(): Bundler; getDeltaBundler(): DeltaBundler; getRevision(revisionId: RevisionId): Promise | null; getRevisionByGraphId(graphId: GraphId): Promise | null; buildGraphForEntries( entryFiles: ReadonlyArray, transformOptions: TransformInputOptions, resolverOptions: ResolverInputOptions, otherOptions?: OtherOptions, ): Promise; getDependencies( entryFiles: ReadonlyArray, transformOptions: TransformInputOptions, resolverOptions: ResolverInputOptions, otherOptions?: OtherOptions, ): Promise>; buildGraph( entryFile: string, transformOptions: TransformInputOptions, resolverOptions: ResolverInputOptions, otherOptions?: OtherOptions, ): Promise< Readonly<{graph: OutputGraph; prepend: ReadonlyArray>}> >; initializeGraph( entryFile: string, transformOptions: TransformInputOptions, resolverOptions: ResolverInputOptions, otherOptions?: OtherOptions, ): Promise<{ delta: DeltaResult; revision: GraphRevision; }>; updateGraph( revision: GraphRevision, reset: boolean, ): Promise<{ delta: DeltaResult; revision: GraphRevision; }>; endGraph(graphId: GraphId): Promise; ready(): Promise; }