/** * VFS manager: exposes fetchFile and getUrl for the tool runner. * Composes OverlayFS (unified view, from `emception`) with LazyFS (CDN URLs). */ import type { FSStats, OverlayFS } from 'emception'; import { LazyFS } from './lazy.js'; export { mountVFSFS, type MountVFSFSOptions, type VFSFSRuntime } from './emscripten-vfsfs.js'; export { IDBFS } from './idb.js'; export type { IDBFSOptions } from './idb.js'; export { LazyFS, type FileEntry, type FSManifest } from './lazy.js'; export interface VFSManager { /** Used by tool runner when a WASM module needs a file not yet in Emscripten FS. */ fetchFile(path: string): Promise; /** Used by tool runner for Emscripten locateFile (WASM/JS glue URLs). */ getUrl(path: string): string; /** Async getUrl: ensures the file's bundle is loaded first, returns blob URL for bundled files. */ getUrlAsync(path: string): Promise; /** Preload a bundle by name so that subsequent getUrl calls return blob URLs. */ preloadBundle(bundleName: string): Promise; /** Get the bundle name a file belongs to, or undefined. */ getBundleForFile(path: string): string | undefined; /** Get all file paths belonging to a bundle. */ getBundleFilePaths(bundleName: string): string[]; /** Expose overlay for direct read/write (e.g. tests, shell). */ readonly overlay: OverlayFS; /** Expose LazyFS for CDN asset loading (bundle preloading, URL resolution). */ readonly lazyFs: LazyFS; /** Sync file read from write cache (null on miss). VFSFS uses fetchFile for on-demand loading. */ readFileSync(path: string): Uint8Array | null; /** Sync file write to overlay write layer (write cache + fire-and-forget IDB). */ writeFileSync(path: string, data: Uint8Array): void; /** Sync stat from manifest metadata or write cache. */ statSync(path: string): FSStats | null; /** Sync readdir from dirIndex + write cache keys. */ readdirSync(path: string): string[]; /** Sync existence check from manifest + write cache. */ existsSync(path: string): boolean; /** Sync mkdir in overlay. */ mkdirSync(path: string): void; /** Sync delete from overlay. */ deleteFileSync(path: string): boolean; /** Preload all files under a directory into IDB. */ preloadDir(path: string): Promise; } export declare function createVFSManager(overlay: OverlayFS, lazyFs: LazyFS): VFSManager; //# sourceMappingURL=index.d.ts.map