UNPKG

credl-parser-evaluator

Version:

TypeScript-based CREDL Parser and Evaluator that processes CREDL files and outputs complete Intermediate Representations

108 lines 4.14 kB
export interface FileStats { size: number; modified: Date; created: Date; isFile: boolean; isDirectory: boolean; permissions: { readable: boolean; writable: boolean; executable: boolean; }; } export interface SafeWriteOptions { backup?: boolean; backupSuffix?: string; createDirectories?: boolean; overwrite?: boolean; encoding?: BufferEncoding; } export interface GlobOptions { cwd?: string; absolute?: boolean; onlyFiles?: boolean; onlyDirectories?: boolean; ignore?: string[]; caseSensitive?: boolean; } export declare function checkFileExists(filePath: string): Promise<boolean>; export declare function checkFileExistsSync(filePath: string): boolean; export declare function getFileStats(filePath: string): Promise<FileStats | null>; export declare function getFileStatsSync(filePath: string): FileStats | null; export declare function ensureDirectory(dirPath: string): Promise<void>; export declare function ensureDirectorySync(dirPath: string): void; export declare function isDirectoryEmpty(dirPath: string): Promise<boolean>; export declare function safeWriteFile(filePath: string, content: string, options?: SafeWriteOptions): Promise<void>; export declare function safeReadFile(filePath: string, encoding?: BufferEncoding): Promise<string>; export declare function resolvePath(inputPath: string, basePath?: string): string; export declare function relativePath(from: string, to: string): string; export declare function getFileExtension(filePath: string): string; export declare function getBaseName(filePath: string, ext?: string): string; export declare function changeExtension(filePath: string, newExt: string): string; export declare function findFiles(pattern: string | string[], options?: GlobOptions): Promise<string[]>; export declare function findCREDLFiles(searchPath?: string, options?: { recursive?: boolean; }): Promise<string[]>; export interface FileValidationResult { isValid: boolean; errors: string[]; warnings: string[]; info: { path: string; size: number; extension: string; lastModified: Date; }; } export declare function validateFile(filePath: string, options?: { maxSize?: number; allowedExtensions?: string[]; requireExtension?: boolean; checkReadable?: boolean; }): Promise<FileValidationResult>; export declare function validateMultipleFiles(filePaths: string[], options?: { continueOnError?: boolean; maxConcurrent?: number; }): Promise<FileValidationResult[]>; export declare function copyFile(source: string, destination: string, options?: { overwrite?: boolean; createDirectories?: boolean; }): Promise<void>; export declare function moveFile(source: string, destination: string, options?: { overwrite?: boolean; createDirectories?: boolean; }): Promise<void>; export declare function deleteFile(filePath: string, options?: { force?: boolean; }): Promise<void>; export declare function deleteDirectory(dirPath: string, options?: { recursive?: boolean; force?: boolean; }): Promise<void>; export declare function createTempFile(prefix?: string, suffix?: string): Promise<string>; export declare const fileUtils: { exists: typeof checkFileExists; existsSync: typeof checkFileExistsSync; stats: typeof getFileStats; statsSync: typeof getFileStatsSync; ensureDir: typeof ensureDirectory; ensureDirSync: typeof ensureDirectorySync; isDirEmpty: typeof isDirectoryEmpty; safeWrite: typeof safeWriteFile; safeRead: typeof safeReadFile; resolve: typeof resolvePath; relative: typeof relativePath; ext: typeof getFileExtension; basename: typeof getBaseName; changeExt: typeof changeExtension; find: typeof findFiles; findCREDL: typeof findCREDLFiles; validate: typeof validateFile; validateMultiple: typeof validateMultipleFiles; copy: typeof copyFile; move: typeof moveFile; delete: typeof deleteFile; deleteDir: typeof deleteDirectory; createTemp: typeof createTempFile; }; //# sourceMappingURL=files.d.ts.map