import { Stats } from "node:fs"; import { FileHandle } from "node:fs/promises"; //#region node_modules/@kodelyth/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/@kodelyth/fs-safe/dist/root-impl.d.ts type OpenResult = { handle: FileHandle; realPath: string; stat: Stats; [Symbol.asyncDispose](): Promise; }; type ReadResult = { buffer: Buffer; realPath: string; stat: Stats; }; 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; 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; }; 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): Promise; mkdir(relativePath: string): Promise; ensureRoot(): 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?: { overwrite?: boolean; }): 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; }; declare function resolveOpenedFileRealPathForHandle(handle: FileHandle, ioPath: string): Promise; //#endregion export { RootReadOptions as a, readLocalFileSafely as c, Root as i, resolveOpenedFileRealPathForHandle as l, OpenResult as n, SymlinkPolicy as o, ReadResult as r, openLocalFileSafely as s, HardlinkPolicy as t, root as u };