import { PakArchive } from './pak.js'; import { VirtualFileSystem } from './vfs.js'; import { PakIndexStore } from './pakIndexStore.js'; import { PakValidator, type PakValidationOutcome } from './pakValidation.js'; export interface PakSource { readonly name: string; readonly data: ArrayBuffer | Blob | ArrayBufferView; } export interface PakIngestionProgress { readonly file: string; readonly loadedBytes: number; readonly totalBytes: number; readonly state: 'reading' | 'parsed' | 'error'; } export interface PakIngestionResult { readonly archive: PakArchive; readonly mounted: boolean; readonly validation?: PakValidationOutcome; } export interface PakIngestionOptions { readonly onProgress?: (progress: PakIngestionProgress) => void; readonly onError?: (file: string, error: unknown) => void; /** * Whether ingestion should abort when a single PAK fails to parse or mount. * Defaults to false to allow partial success in multi-PAK scenarios. */ readonly stopOnError?: boolean; /** * Optional persistence target for PAK directory indexes. When provided, each successfully * parsed archive will be stored in IndexedDB so the browser can rebuild listings without * reparsing the binary payload. */ readonly pakIndexStore?: PakIndexStore; /** * Whether to persist parsed PAK indexes. Defaults to true when a pakIndexStore is provided. */ readonly persistIndexes?: boolean; /** * Optional checksum validator. When provided, PAKs whose checksums do not match the known list will * raise a PakValidationError unless `enforceValidation` is explicitly set to false. */ readonly validator?: PakValidator; /** * Whether checksum mismatches should prevent mounting the archive. Defaults to true when a validator * is supplied. */ readonly enforceValidation?: boolean; /** * Whether unknown PAKs (not present in the validator list) are allowed. Defaults to true. */ readonly allowUnknownPaks?: boolean; /** * Callback invoked with the validation outcome when a validator is provided. */ readonly onValidationResult?: (outcome: PakValidationOutcome) => void; } export declare class PakIngestionError extends Error { readonly file: string; constructor(file: string, cause: unknown); } export declare function ingestPaks(vfs: VirtualFileSystem, sources: PakSource[], onProgressOrOptions?: PakIngestionOptions | ((progress: PakIngestionProgress) => void)): Promise; //# sourceMappingURL=ingestion.d.ts.map