budgie-cli
Version:
Node CLI for Budgie.
41 lines (40 loc) • 1.11 kB
TypeScript
/**
* Reads and writes files.
*/
export declare type IFileSystem = Readonly<{
/**
* Reads a file.
*
* @param filePath Path to the file.
* @returns Promise for the contents of the file.
*/
readFile(filePath: string): Promise<string>;
/**
* Writes a file.
*
* @param filePath Path to the file.
* @param contents New contents for the file.
* @returns Promise for writing to the file.
*/
writeFile(filePath: string, contents: string): Promise<void>;
}>;
/**
* Reads and writes files.
*/
export declare class FileSystem implements IFileSystem {
/**
* Reads a file.
*
* @param filePath Path to the file.
* @returns Promise for the contents of the file.
*/
readFile(filePath: string): Promise<string>;
/**
* Writes a file.
*
* @param filePath Path to the file.
* @param contents New contents for the file.
* @returns Promise for writing to the file.
*/
writeFile(filePath: string, contents: string): Promise<void>;
}