import * as dntShim from "../../_dnt.shims.js";
import { type WalkEntry, type WalkOptions } from "../../deps/jsr.io/@std/fs/1.0.21/walk.js";
import { type ResultAsync } from "neverthrow";
import { DirectoryNotAccessibleError, FileDeletionError, FileNotFoundError, WriteError } from "./fs-errors.js";
/** Alias for a string representing a full file path */
export type FilePath = string;
/**
 * Safely walks a directory and returns all entries.
 *
 * @param root - Root directory to walk
 * @param options - Optional walk options
 * @returns A ResultAsync containing an array of all entries or an error
 */
export declare function safeWalkAll(root: string | URL, options?: WalkOptions): ResultAsync<WalkEntry[], DirectoryNotAccessibleError>;
/**
 * Safely deletes a file.
 *
 * @param path - Path to the file
 * @param options - Optional remove options
 * @returns A ResultAsync containing void or an error
 */
export declare function safeDeleteFile(path: string, options?: dntShim.Deno.RemoveOptions): ResultAsync<void, FileDeletionError>;
/**
 * Safely ensures a directory exists, creating it if necessary.
 *
 * @param dirPath - Path to the directory
 * @returns A ResultAsync containing void or an error
 */
export declare function safeEnsureDir(dirPath: FilePath): ResultAsync<void, DirectoryNotAccessibleError>;
/**
 * Safely writes a file.
 *
 * @param path - Path to the file
 * @param content - Content to write to the file
 * @returns A ResultAsync containing void or an error
 */
export declare function safeWriteFile(path: FilePath, content: string): ResultAsync<void, WriteError>;
/**
 * Safely stats a file.
 *
 * @param path - Path to the file
 * @returns A ResultAsync containing the file stats or an error
 */
export declare function safeStat(path: FilePath): ResultAsync<dntShim.Deno.FileInfo, FileNotFoundError>;
//# sourceMappingURL=fs-utils.d.ts.map