import { OpenResult, ReadResult } from "@nodmix/fs-safe/root";

//#region src/infra/fs-safe.d.ts
type FsSafeErrorCode = import("@nodmix/fs-safe/errors").FsSafeErrorCode;
declare function assertAbsolutePathInput(...args: any[]): any;
declare function canonicalPathFromExistingAncestor(...args: any[]): any;
declare function resolveAbsolutePathForRead(...args: any[]): any;
declare function resolveAbsolutePathForWrite(...args: any[]): any;
declare function findExistingAncestor(...args: any[]): any;
type AbsolutePathSymlinkPolicy = import("@nodmix/fs-safe/advanced").AbsolutePathSymlinkPolicy;
type EnsureAbsoluteDirectoryOptions = import("@nodmix/fs-safe/advanced").EnsureAbsoluteDirectoryOptions;
type EnsureAbsoluteDirectoryResult = import("@nodmix/fs-safe/advanced").EnsureAbsoluteDirectoryResult;
type ResolvedAbsolutePath = import("@nodmix/fs-safe/advanced").ResolvedAbsolutePath;
type ResolvedWritableAbsolutePath = import("@nodmix/fs-safe/advanced").ResolvedWritableAbsolutePath;
declare function readLocalFileFromRoots(rootDirs: string[], relativePath: string, options?: any): Promise<any>;
declare function root$1(...args: any[]): any;
declare function withTimeout<T = any>(promise: Promise<T> | (() => Promise<T>), ms: number): any;
type ExternalFileWriteOptions = {
  rootDir: string;
  path: string;
  write: (tempPath: string) => Promise<void>;
  fallbackFileName?: string;
  tempPrefix?: string;
};
type ExternalFileWriteResult = {
  path: string;
};
declare function ensureAbsoluteDirectory(dirPath: string, options?: {
  scopeLabel?: string;
  mode?: number;
}): Promise<{
  ok: true;
  path: string;
} | {
  ok: false;
  error: Error;
}>;
/** @deprecated Use root(rootDir).read(relativePath, options). */
declare function readFileWithinRoot(params: {
  rootDir: string;
  relativePath: string;
  rejectHardlinks?: boolean;
  nonBlockingRead?: boolean;
  allowSymlinkTargetWithinRoot?: boolean;
  maxBytes?: number;
}): Promise<ReadResult>;
/** @deprecated Use root(rootDir).write(relativePath, data, options). */
declare function writeFileWithinRoot(params: {
  rootDir: string;
  relativePath: string;
  data: string | Buffer;
  encoding?: BufferEncoding;
  mkdir?: boolean;
}): Promise<void>;
//#endregion
export { resolveAbsolutePathForWrite as _, ExternalFileWriteResult as a, writeFileWithinRoot as b, ResolvedAbsolutePath as c, canonicalPathFromExistingAncestor as d, ensureAbsoluteDirectory as f, resolveAbsolutePathForRead as g, readLocalFileFromRoots as h, ExternalFileWriteOptions as i, ResolvedWritableAbsolutePath as l, readFileWithinRoot as m, EnsureAbsoluteDirectoryOptions as n, FsSafeErrorCode as o, findExistingAncestor as p, EnsureAbsoluteDirectoryResult as r, OpenResult as s, AbsolutePathSymlinkPolicy as t, assertAbsolutePathInput as u, root$1 as v, withTimeout as y };