import type { SerializerConfigT } from '@expo/metro/metro-config'; import type { Module, ReadOnlyGraph, ResolvedDependency } from '@expo/metro/metro/DeltaBundler/types'; import type { ExpoSerializerOptions } from '../fork/baseJSBundle'; import type { ChunkingStrategy, SerialAsset } from '../serializerAssets'; import type { SerializerConfigOptions } from '../withExpoSerializers'; import { Chunk } from './Chunk'; export type SerializeChunkOptions = { includeSourceMaps: boolean; splitChunks: boolean; chunkingStrategy: ChunkingStrategy; } & SerializerConfigOptions; export type ChunkingContext = { serializerConfig: Partial; serializeChunkOptions: SerializeChunkOptions; entryFile: string; preModules: readonly Module[]; graph: ReadOnlyGraph; options: ExpoSerializerOptions; }; export type ChunkSerializationOptions = Partial[3]>; type ChunkStrategySerializationOptions = Pick; export type ChunkingImplementation = { serializeAsync(): Promise; /** * Chunks referenced by emitted async URLs, used to calculate filename hashes. * Must match the targets used by getSerializationOptions. */ getAsyncChunkTargets(chunk: Chunk, chunksByPath: Map): Set; /** * Options used before dependency filenames are known, including for filename hashing. * Final serialization also uses these as defaults. */ getStableSerializationOptions(chunk: Chunk): ChunkStrategySerializationOptions; getSerializationOptions(chunk: Chunk, chunksByPath: Map, filenamesByChunk: Map): ChunkStrategySerializationOptions; getMetadata(chunk: Chunk, filenamesByChunk: Map): Pick; }; export declare function createChunkCollector({ graph, options, preModules: runtimePremodules }: ChunkingContext, strategy: ChunkingImplementation, chunks: Set, shouldTraverseDependency: (dependency: ResolvedDependency) => boolean): (entryPath: string, preModules: readonly Module[], isAsync?: boolean, isEntry?: boolean) => Chunk | undefined; export declare function createRuntimeChunk(entryChunk: Chunk, chunks: Set, strategy: ChunkingImplementation, requiredBy?: Iterable): void; export declare function serializeChunksAsync(chunks: Set, { serializerConfig, serializeChunkOptions, options }: ChunkingContext): Promise; export {};