/** * Optimized File I/O * * Uses Bun.file() / Bun.write() when running on Bun for native performance. * Falls back to Node.js fs module on Node. * * Why: Bun's fs module is a separate reimplementation that does NOT delegate * to Bun.file() internally. Using Bun.file().json() avoids the intermediate * string allocation that fs.readFile + JSON.parse requires. */ /** Read a file as UTF-8 text */ export declare function readText(filePath: string): Promise; /** Read a JSON file, parsed */ export declare function readJSON(filePath: string): Promise; /** Write UTF-8 text to a file */ export declare function writeText(filePath: string, content: string): Promise; /** Write an object as JSON to a file */ export declare function writeJSON(filePath: string, data: unknown, indent?: number): Promise; /** Write raw bytes to a file */ export declare function writeBytes(filePath: string, data: Buffer | Uint8Array): Promise; /** Read raw bytes from a file */ export declare function readBytes(filePath: string): Promise; /** Read a file as UTF-8 text (sync) */ export declare function readTextSync(filePath: string): string; /** Read a JSON file, parsed (sync) */ export declare function readJSONSync(filePath: string): T; /** Write UTF-8 text to a file (sync) */ export declare function writeTextSync(filePath: string, content: string): void; /** Write an object as JSON to a file (sync) */ export declare function writeJSONSync(filePath: string, data: unknown, indent?: number): void; /** Check if a file exists */ export declare function fileExists(filePath: string): boolean; //# sourceMappingURL=io.d.ts.map