/** * @file src/infrastructure/parsers/config-parsing/ConfigFileOperations.ts * @description Pure functions for configuration file operations */ import { PraetorianConfig } from '../../../shared/types'; /** * @interface FileOperationResult * @description Result of a file operation */ export interface FileOperationResult { success: boolean; content?: string; error?: string; } /** * @interface ConfigParseResult * @description Result of parsing a configuration file */ export interface ConfigParseResult { success: boolean; config?: PraetorianConfig; error?: string; } /** * Checks if a file exists * @param filePath - Path to check * @returns True if file exists, false otherwise */ export declare const fileExists: (filePath: string) => boolean; /** * Reads a file synchronously * @param filePath - Path to the file * @returns File operation result */ export declare const readFileSync: (filePath: string) => FileOperationResult; /** * Writes content to a file synchronously * @param filePath - Path to the file * @param content - Content to write * @returns File operation result */ export declare const writeFileSync: (filePath: string, content: string) => FileOperationResult; /** * Creates a directory if it doesn't exist * @param dirPath - Directory path * @returns File operation result */ export declare const createDirectorySync: (dirPath: string) => FileOperationResult; /** * Parses YAML content * @param content - YAML content * @returns Parsed content */ export declare const parseYamlContent: (content: string) => any; /** * Stringifies content to YAML * @param content - Content to stringify * @returns YAML string */ export declare const stringifyToYaml: (content: any) => string; /** * Resolves a path relative to a base directory * @param basePath - Base directory path * @param relativePath - Relative path * @returns Resolved absolute path */ export declare const resolvePath: (basePath: string, relativePath: string) => string; /** * Gets the directory name of a file path * @param filePath - File path * @returns Directory name */ export declare const getDirectoryName: (filePath: string) => string; /** * Joins path segments * @param segments - Path segments * @returns Joined path */ export declare const joinPath: (...segments: string[]) => string; /** * Gets file extension * @param filePath - File path * @returns File extension (including the dot) */ export declare const getFileExtension: (filePath: string) => string; //# sourceMappingURL=ConfigFileOperations.d.ts.map