@quasarbright/projection
Version:
A static site generator that creates a beautiful, interactive gallery to showcase your coding projects. Features search, filtering, tags, responsive design, and an admin UI.
58 lines • 1.55 kB
TypeScript
import { Project, ProjectsData } from '../../types';
/**
* File format types
*/
export type FileFormat = 'yaml' | 'json';
/**
* Unified file manager that delegates to YAML or JSON manager
* Provides format detection, backup functionality, and file watching
*/
export declare class FileManager {
private filePath;
private format;
private manager;
private watcher;
constructor(filePath: string);
/**
* Detect file format based on extension
*/
private detectFormat;
/**
* Get the detected file format
*/
getFormat(): FileFormat;
/**
* Read projects from file
*/
readProjects(): Promise<ProjectsData>;
/**
* Update an existing project
* Creates a backup before modification
*/
updateProject(projectId: string, updatedProject: Project): Promise<void>;
/**
* Add a new project
* Creates a backup before modification
*/
addProject(project: Project): Promise<void>;
/**
* Delete a project
* Creates a backup before modification
*/
deleteProject(projectId: string): Promise<void>;
/**
* Create a backup of the current file
* Returns the backup file path
*/
createBackup(): Promise<string>;
/**
* Watch file for external changes
* Calls the callback when the file is modified externally
*/
watchFile(callback: (data: ProjectsData) => void): void;
/**
* Stop watching the file
*/
stopWatching(): void;
}
//# sourceMappingURL=file-manager.d.ts.map