/** * Minimal fs-extra-compatible helpers built on node:fs/promises. * * fs-extra must not be imported from core: unlike `node:*` (externalized by * every bundler config in this repo), fs-extra is bundleable, and its * graceful-fs dependency probes `fs.realpath.native` at MODULE INIT — which * crashes the Cloudflare edge bundle under workerd's nodejs_compat, where * `fs.realpath` is undefined ("Cannot read properties of undefined (reading * 'native')"). These helpers keep the ergonomic surface the Node-side feature * services use while leaving all filesystem access on the external `node:fs` * seam, so importing them is init-safe in every build target. */ import { promises as fsp } from "node:fs"; export type SymlinkType = "dir" | "file" | "junction"; export declare function pathExists(target: string): Promise; export declare function readJson(file: string): Promise; export declare function writeJson(file: string, value: unknown, options?: { spaces?: number; }): Promise; export declare function ensureDir(dir: string): Promise; export declare function remove(target: string): Promise; export declare function copy(src: string, dest: string): Promise; /** * Create a symlink, creating the parent directory first. Callers here always * `remove()` the destination beforehand, so no fs-extra-style "already points * at the right target" reconciliation is needed. */ export declare function ensureSymlink(target: string, linkPath: string, type?: SymlinkType): Promise; export declare const readFile: typeof fsp.readFile; export declare const readdir: typeof fsp.readdir; export declare const stat: typeof fsp.stat; export declare const unlink: typeof fsp.unlink; export declare const rmdir: typeof fsp.rmdir;