import * as VFS from 'node:vfs'; export interface ManifestOptions { /** * Start a fresh list. Defaults to true only on the main thread: worker * threads inherit `execArgv`, so this preload runs in them too, and a * worker must append to what the main thread already wrote rather than * wipe it mid-run. */ truncate?: boolean | undefined; } export interface RecorderOptions extends ManifestOptions { /** Where to write the file list (default: the `BUNDLE_MANIFEST` variable). */ manifest?: string | Manifest | undefined; /** Identifier reported in diagnostics (default: 'bundle-manifest'). */ name?: string | undefined; } /** * The manifest file itself: which paths have been written, and the appending. * Paths are appended as soon as they are read rather than buffered and flushed * at exit, so nothing is lost if the process is killed instead of exiting. */ export declare class Manifest { #private; constructor(path: string, { truncate }?: ManifestOptions); get path(): string; /** Every path recorded so far, in the order they were first read. */ get paths(): string[]; /** * Record one VFS path, once. Best effort: bookkeeping must never break the * read that triggered it. */ record(path: string): void; } /** * The shape `recording()` accepts and returns — any provider class. The rest * parameter is what lets the wrapper be a mixin over a class whose constructor * takes whatever it likes, and hand back one with the same signature. */ type ProviderClass = new (...args: any[]) => VFS.VirtualProvider; /** * Wrap a provider class so every read through it is recorded in `manifest`. * Works over any `VirtualProvider` subclass — a `RealFSProvider` for a * directory mount, a `ZipProvider` or the signed-archive provider from * './provider.ts' for an archive one — and leaves the constructor signature of * the class it wraps untouched: * * const Recording = recording(VFS.RealFSProvider, new Manifest('app.manifest')); * const provider = new Recording('/path/to/directory'); */ export declare function recording(Base: T, manifest: Manifest): T; /** * Register a recording `RealFSProvider` so a directory loaded with * `--vfs-load` is backed by it. Meant to be preloaded, before the mount is made: * * BUNDLE_MANIFEST=app.manifest node --experimental-vfs \ * -r @pipobscure/bundle/record --vfs-load=./lib * * With no manifest destination there is nothing to record, so nothing is * registered and directory mounts are left exactly as node makes them; the * return value is then null. */ export declare function register(options?: RecorderOptions): Manifest | null; export {}; //# sourceMappingURL=recorder.d.ts.map