import type { Stats } from "node:fs"; import type { FileHandle } from "node:fs/promises"; export type SafeOpenErrorCode = "invalid-path" | "not-found" | "symlink" | "not-file" | "path-mismatch" | "too-large"; export declare class SafeOpenError extends Error { code: SafeOpenErrorCode; constructor(code: SafeOpenErrorCode, message: string, options?: ErrorOptions); } export type SafeOpenResult = { handle: FileHandle; realPath: string; stat: Stats; }; export type SafeLocalReadResult = { buffer: Buffer; realPath: string; stat: Stats; }; export declare function openFileWithinRoot(params: { rootDir: string; relativePath: string; }): Promise; export declare function readLocalFileSafely(params: { filePath: string; maxBytes?: number; }): Promise;