export declare function createFile(path: string, contents: string | NodeJS.ArrayBufferView): Promise; /** * Sanitizes a hash to be safe for use as a filename. * esbuild's hashes are base64-encoded and may contain `/` and `+` characters. */ export declare function sanitizeHashForFilename(hash: string): string; /** * Creates a file using a content-addressable store for deduplication. * Files are stored by their content hash, so identical content is only stored once. * The build directory gets a hardlink to the stored file. * * @param filePath - The destination path for the file * @param contents - The file contents to write * @param storeDir - The shared store directory for deduplication * @param contentHash - The content hash (e.g., from esbuild's outputFile.hash) * @returns The destination file path */ export declare function createFileWithStore(filePath: string, contents: string | NodeJS.ArrayBufferView, storeDir: string, contentHash: string): Promise; export declare function isDirectory(configPath: string): boolean; export declare function pathExists(path: string): Promise; export declare function someFileExists(directory: string, filenames: string[]): Promise; export declare function removeFile(path: string): Promise; export declare function readFile(path: string): Promise; export declare function expandTilde(filePath: string): string; export declare function readJSONFile(path: string): Promise; export declare function safeReadJSONFile(path: string): Promise; /** * Use this for deterministic builds. Uses `json-stable-stringify` to sort keys alphabetically. * @param path - The path to the file to write * @param json - The JSON object to write * @param pretty - Whether to pretty print the JSON */ export declare function writeJSONFile(path: string, json: any, pretty?: boolean): Promise; /** * Use this when you want to preserve the original key ordering (e.g. user's package.json) * @param path - The path to the file to write * @param json - The JSON object to write * @param pretty - Whether to pretty print the JSON */ export declare function writeJSONFilePreserveOrder(path: string, json: any, pretty?: boolean): Promise; export declare function safeWriteFile(path: string, contents: string): Promise; export declare function readJSONFileSync(path: string): any; export declare function safeDeleteFileSync(path: string): void; export declare function createTempDir(): Promise; export declare function safeReadTomlFile(path: string): Promise; export declare function writeTomlFile(path: string, toml: any): Promise; export declare function safeReadJSONCFile(path: string): Promise; export declare function writeJSONCFile(path: string, json: any): Promise;