import { t as ReadResult } from "./read-opened-file-Do-jsWFN.js"; import { Stats } from "node:fs"; import { FileHandle } from "node:fs/promises"; //#region node_modules/@openclaw/fs-safe/dist/deny-mutations.d.ts type DenyMutationPolicy = { paths?: readonly string[]; prefixes?: readonly string[]; }; //#endregion //#region node_modules/@openclaw/fs-safe/dist/types.d.ts type PathStat = { dev: number; gid: number; ino: number; isDirectory: boolean; isFile: boolean; isSymbolicLink: boolean; mode: number; mtimeMs: number; nlink: number; size: number; uid: number; }; type DirEntry = PathStat & { name: string; }; //#endregion //#region node_modules/@openclaw/fs-safe/dist/opened-realpath.d.ts declare function resolveOpenedFileRealPathForHandle(handle: FileHandle, ioPath: string): Promise; //#endregion //#region node_modules/@openclaw/fs-safe/dist/root-impl.d.ts type OpenResult = { handle: FileHandle; realPath: string; stat: Stats; [Symbol.asyncDispose](): Promise; }; type SymlinkPolicy = "reject" | "follow-within-root"; type HardlinkPolicy = "reject" | "allow"; type WritableOpenMode = "replace" | "append" | "update"; type RootDefaults = { hardlinks?: HardlinkPolicy; maxBytes?: number; mkdir?: boolean; mode?: number; denyMutations?: DenyMutationPolicy; nonBlockingRead?: boolean; symlinks?: SymlinkPolicy; }; type RootReadOptions = Pick; type RootOpenOptions = Omit; type RootWriteOptions = Pick & { encoding?: BufferEncoding; overwrite?: boolean; }; type RootOpenWritableOptions = Pick & { writeMode?: WritableOpenMode; }; type RootCopyOptions = Pick & { sourceHardlinks?: HardlinkPolicy; }; type RootWriteJsonOptions = RootWriteOptions & { replacer?: Parameters[1]; space?: Parameters[2]; trailingNewline?: boolean; }; type RootCreateOptions = Omit; type RootCreateJsonOptions = Omit; type RootAppendOptions = RootWriteOptions & { prependNewlineIfNeeded?: boolean; }; type RootMoveOptions = Pick & { overwrite?: boolean; }; type RootRemoveOptions = Pick; type RootMkdirOptions = Pick; interface Root { readonly rootDir: string; readonly rootReal: string; readonly rootWithSep: string; readonly defaults: RootDefaults; resolve(relativePath: string): Promise; open(relativePath: string, options?: RootOpenOptions): Promise; read(relativePath: string, options?: RootReadOptions): Promise; readBytes(relativePath: string, options?: RootReadOptions): Promise; readText(relativePath: string, options?: RootReadOptions & { encoding?: BufferEncoding; }): Promise; readJson(relativePath: string, options?: RootReadOptions & { encoding?: BufferEncoding; }): Promise; readAbsolute(filePath: string, options?: RootReadOptions): Promise; reader(options?: RootReadOptions): (filePath: string) => Promise; openWritable(relativePath: string, options?: RootOpenWritableOptions): Promise; append(relativePath: string, data: string | Buffer, options?: RootAppendOptions): Promise; remove(relativePath: string, options?: RootRemoveOptions): Promise; mkdir(relativePath: string, options?: RootMkdirOptions): Promise; ensureRoot(options?: RootMkdirOptions): Promise; write(relativePath: string, data: string | Buffer, options?: RootWriteOptions): Promise; create(relativePath: string, data: string | Buffer, options?: RootCreateOptions): Promise; writeJson(relativePath: string, data: unknown, options?: RootWriteJsonOptions): Promise; createJson(relativePath: string, data: unknown, options?: RootCreateJsonOptions): Promise; copyIn(relativePath: string, sourcePath: string, options?: RootCopyOptions): Promise; exists(relativePath: string): Promise; stat(relativePath: string): Promise; list(relativePath: string, options?: { withFileTypes?: false; }): Promise; list(relativePath: string, options: { withFileTypes: true; }): Promise; move(fromRelative: string, toRelative: string, options?: RootMoveOptions): Promise; } declare function root(rootDir: string, defaults?: RootDefaults): Promise; declare function readLocalFileSafely(params: { filePath: string; maxBytes?: number; }): Promise; declare function openLocalFileSafely(params: { filePath: string; }): Promise; type WritableOpenResult = { handle: FileHandle; createdForWrite: boolean; realPath: string; stat: Stats; [Symbol.asyncDispose](): Promise; }; //#endregion export { SymlinkPolicy as a, root as c, RootReadOptions as i, resolveOpenedFileRealPathForHandle as l, OpenResult as n, openLocalFileSafely as o, Root as r, readLocalFileSafely as s, HardlinkPolicy as t };