UNPKG

dadeumi

Version:

Dadeumi - An AI-powered literary translation workflow inspired by the Korean method of iterative textile refinement

32 lines (31 loc) 935 B
/** * Utilities for file system operations */ /** * Ensure a directory exists, create it if it doesn't */ export declare function ensureDirectoryExists(dirPath: string): void; /** * Save data to a JSON file */ export declare function saveJson(filePath: string, data: any): void; /** * Load data from a JSON file */ export declare function loadJson<T>(filePath: string, defaultValue: T): T; /** * Save text to a file */ export declare function saveText(filePath: string, text: string): void; /** * Load text from a file */ export declare function loadText(filePath: string, defaultValue?: string): string; /** * Find the latest file from a list of filenames in a directory */ export declare function findLatestFile(directory: string, fileNames: string[]): string | null; /** * Get all files in a directory matching a pattern */ export declare function findFilesInDirectory(directory: string, pattern: RegExp): string[];