import Macroable from '@poppinss/macroable'; import { type RmOptions, type StatOptions, type WriteFileOptions, type MakeDirectoryOptions } from 'node:fs'; import type { EntryInfo, JSONFileOptions } from './types.js'; /** * File system abstraction on top of `fs-extra` with a fixed basePath */ export declare class FileSystem extends Macroable { #private; /** * Base URL to the directory for reading and writing * files */ baseUrl: URL; /** * Base path to the directory for reading and writing * files */ basePath: string; constructor(basePath: string); /** * Cleanup directory */ cleanup(options?: RmOptions): Promise; /** * Creates a directory inside the root of the filesystem * path. You may use this method to create nested * directories as well. */ mkdir(dirPath: string, options?: MakeDirectoryOptions): Promise; /** * Create a new file */ create(filePath: string, contents: string, options?: WriteFileOptions): Promise; /** * Remove a file */ remove(filePath: string, options?: RmOptions): Promise; /** * Check if the root of the filesystem exists */ rootExists(): Promise; /** * Check if a file exists */ exists(filePath: string): Promise; /** * Returns file contents */ contents(filePath: string): Promise; /** * Dumps file contents to the stdout */ dump(filePath: string): Promise; /** * Returns stats for a file */ stats(filePath: string, options?: StatOptions): Promise; /** * Recursively reads files from a given directory */ readDir(dirPath?: string): Promise; /** * Create a json file */ createJson(filePath: string, contents: any, options?: JSONFileOptions): Promise; /** * Read and parse a json file */ contentsJson(filePath: string): Promise; }