/** tells if file system node at given `path` exists */ export declare function exists(path: string): Promise; /** creates the hierarchy of folders given by `path` */ export declare function ensurePath(path: string): Promise; /** writes `content` into the file at given `path` */ export declare function writeFile(path: string, content: string | Buffer): Promise; export interface FileHandlerSpec { /** the path of the folder containing the file */ readonly root: string; /** the file name */ readonly name: string; } export interface IFileHandler { /** the full path of the file */ readonly path: string; /** the file name */ readonly name: string; /** tells whether the file exists or not */ exists(): Promise; /** reads and returns the content of the file or returns `null` if it doesn't exist */ read(): Promise; /** writes the given content into the file */ write(content: Buffer | string | null | undefined): Promise; /** gets the size and the last modified time of the file, or returns `null` if it doesn't exist */ stat(): Promise<{ mtime: number; size: number; } | null>; } export declare class FileHandler implements IFileHandler { private readonly _spec; constructor(spec: FileHandlerSpec | string); /** the root of the file */ private get _root(); get name(): string; get path(): string; exists(): Promise; read(): Promise; write(content: Buffer | string | null | undefined): Promise; stat(): Promise<{ mtime: number; size: number; } | null>; }