//#region packages/common/src/portable/fs.d.ts /** * Portable filesystem API using Node.js fs */ interface PortableFS { readFile(path: string): Promise; writeFile(path: string, content: string): Promise; /** * Write a file atomically using temp file + rename pattern. * This prevents partial/corrupt writes on crash. */ writeFileAtomic(path: string, content: string): Promise; exists(path: string): Promise; stat(path: string): Promise<{ mtime: Date; size: number; }>; rename(oldPath: string, newPath: string): Promise; mkdir(path: string, options?: { recursive?: boolean; }): Promise; /** * Write a file synchronously and atomically using temp file + rename pattern. * Safe for use in beforeExit handlers. */ writeFileSyncAtomic(path: string, content: string): void; /** * Remove a file. Does not throw if file doesn't exist. */ unlink(path: string): Promise; /** * Remove a file synchronously. Does not throw if file doesn't exist. */ unlinkSync(path: string): void; /** * Read a file synchronously. */ readFileSync(path: string): string; } declare function createPortableFS(): PortableFS; declare function getPortableFS(): PortableFS; /** * Reset the filesystem singleton for testing * @internal */ declare function __resetPortableFSForTests(): void; //#endregion //#region packages/common/src/portable/hash.d.ts /** * Portable hashing API using Node.js crypto */ type HashAlgorithm = "sha256" | "xxhash"; interface PortableHasher { hash(content: string, algorithm?: HashAlgorithm): string; } declare function createPortableHasher(): PortableHasher; declare function getPortableHasher(): PortableHasher; /** * Reset the hasher singleton for testing * @internal */ declare function __resetPortableHasherForTests(): void; //#endregion //#region packages/common/src/portable/runtime.d.ts /** * Runtime detection utilities for portable API implementation * Note: Bun-specific code has been removed. Node.js APIs are always used. */ declare const runtime: { readonly isBun: false; readonly isNode: boolean; readonly supportsWebCrypto: boolean; }; /** * Reset runtime state for testing purposes only * @internal */ declare function resetPortableForTests(): void; //#endregion export { __resetPortableHasherForTests as a, PortableFS as c, getPortableFS as d, PortableHasher as i, __resetPortableFSForTests as l, runtime as n, createPortableHasher as o, HashAlgorithm as r, getPortableHasher as s, resetPortableForTests as t, createPortableFS as u }; //# sourceMappingURL=index-B9cqW0Kp.d.cts.map