import type { Stats } from "node:fs"; import type { FileHandle } from "node:fs/promises"; import { type DenyMutationPolicy } from "./deny-mutations.js"; import { type ReadResult } from "./read-opened-file.js"; import type { DirEntry, PathStat } from "./types.js"; export type { DenyMutationPolicy } from "./deny-mutations.js"; export { resolveOpenedFileRealPathForHandle } from "./opened-realpath.js"; export type { ReadResult } from "./read-opened-file.js"; export type OpenResult = { handle: FileHandle; realPath: string; stat: Stats; [Symbol.asyncDispose](): Promise; }; export type RootOptions = { rootDir: string; defaults?: RootDefaults; }; export type SymlinkPolicy = "reject" | "follow-within-root"; export type HardlinkPolicy = "reject" | "allow"; export type WritableOpenMode = "replace" | "append" | "update"; export type RootDefaults = { hardlinks?: HardlinkPolicy; maxBytes?: number; mkdir?: boolean; mode?: number; denyMutations?: DenyMutationPolicy; nonBlockingRead?: boolean; symlinks?: SymlinkPolicy; }; export type RootReadOptions = Pick; export type RootOpenOptions = Omit; export type RootWriteOptions = Pick & { encoding?: BufferEncoding; overwrite?: boolean; }; export type RootOpenWritableOptions = Pick & { writeMode?: WritableOpenMode; }; export type RootCopyOptions = Pick & { sourceHardlinks?: HardlinkPolicy; }; export type RootWriteJsonOptions = RootWriteOptions & { replacer?: Parameters[1]; space?: Parameters[2]; trailingNewline?: boolean; }; export type RootCreateOptions = Omit; export type RootCreateJsonOptions = Omit; export type RootAppendOptions = RootWriteOptions & { prependNewlineIfNeeded?: boolean; }; export type RootMoveOptions = Pick & { overwrite?: boolean; }; export type RootRemoveOptions = Pick; export type RootMkdirOptions = Pick; export declare const DEFAULT_ROOT_MAX_BYTES: number; export 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; } export declare function root(rootDir: string, defaults?: RootDefaults): Promise; export declare function readLocalFileSafely(params: { filePath: string; maxBytes?: number; }): Promise; export declare function openLocalFileSafely(params: { filePath: string; }): Promise; export type WritableOpenResult = { handle: FileHandle; createdForWrite: boolean; realPath: string; stat: Stats; [Symbol.asyncDispose](): Promise; }; //# sourceMappingURL=root-impl.d.ts.map