import { type ChangeNotifier, type FileSystemPort } from "../ports.js"; export interface MemoryFileSystemOptions { /** * The project to start from, as project-relative path → file content. Parent * directories are implied and don't need listing. */ files?: Record; /** * Top-level directories whose changes are reported to `onChange` listeners. * Defaults to the same set chokidar watches on Node, so the preview's * live-reload behaviour matches the CLI's rather than being broader. */ watchedDirs?: readonly string[]; /** Injectable clock, so tests can control mtimes. */ now?: () => Date; /** * The mtime the seeded project starts with. Defaults to now. * * Worth setting to a constant wherever the same seed is loaded more than * once — a Worker builds one of these per isolate, and if each picked its own * startup time, a client that read a file from one isolate would be told its * save conflicts when it landed on another. The file it read and the file it * is saving over are byte-identical; only the clock disagreed. */ seedMtime?: Date; } export interface MemoryFileSystem extends FileSystemPort, ChangeNotifier { /** Discards all edits and returns to the seeded project. */ reset(): void; } /** * A `FileSystemPort` held entirely in memory — what the per-PR preview Worker * runs against, since a Worker has no filesystem. * * Directories are implied by the paths of the files inside them, plus any * created explicitly, which is enough for a project tree and avoids maintaining * a parallel directory structure that could disagree with the files. * * It doubles as the `ChangeNotifier`: writes report themselves, so the SPA's * live-reload path stays exercised in the preview instead of going quiet with * no chokidar to drive it. */ export declare function createMemoryFileSystem(options?: MemoryFileSystemOptions): MemoryFileSystem;