/** * Unified file system utilities for Poltergeist * Consolidates path operations, state file handling, and common file operations */ /** * Centralized file system utilities for Poltergeist operations * * Note: Uses static-only class for namespacing and API organization. * This provides clear boundaries for filesystem-related functionality. */ export declare class FileSystemUtils { /** * Get the default state directory path (cross-platform) */ static getStateDirectory(): string; /** * Generate unique state filename using project name + path hash + target * Format: {projectName}-{pathHash}-{targetName}.state * Path hash prevents collisions between projects with same name */ static generateStateFileName(projectRoot: string, targetName: string): string; /** * Get full path to state file for a target */ static getStateFilePath(projectRoot: string, targetName: string): string; /** * Generate build log file name with project context * Uses same naming convention as state files for consistency */ static generateLogFileName(projectRoot: string, targetName: string, channel?: string): string; /** * Get full path to build log file for a target */ static getLogFilePath(projectRoot: string, targetName: string, channel?: string): string; /** * Pause flag lives alongside state/log files so panel/daemon/CLI can flip it quickly. */ static getPauseFilePath(projectRoot: string): string; static readPauseFlag(projectRoot: string): boolean; static writePauseFlag(projectRoot: string, paused: boolean): void; static projectHash(projectRoot: string): string; /** * Safely read a JSON file with error handling */ static readJsonFile(filePath: string): T | null; /** * Read a JSON file and throw on parse errors (for distinguishing corruption from missing files) */ static readJsonFileStrict(filePath: string): T | null; /** * Safely write a JSON file with atomic operation */ static writeJsonFile(filePath: string, data: T): boolean; /** * Find a file by walking up the directory tree * @param startDir Starting directory (defaults to current working directory) * @param fileName File name to search for * @returns Full path to found file, or null if not found */ static findFileUpTree(fileName: string, startDir?: string): string | null; /** * Get project root directory containing the configuration file */ static findProjectRoot(startDir?: string): string | null; } //# sourceMappingURL=filesystem.d.ts.map