UNPKG

@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.

71 lines 2.37 kB
/** * Result of finding a projects file */ export interface ProjectFileResult { /** Full path to the projects file */ path: string; /** File format detected from extension */ format: 'yaml' | 'json'; } /** * Shared utility for finding and validating projects files * Follows DRY principle by centralizing project file discovery logic */ export declare class ProjectFileFinder { private static readonly POSSIBLE_FILES; /** * Find the projects file in the specified directory * Searches for projects.yaml, projects.yml, or projects.json in order * * @param cwd - Directory to search in * @returns ProjectFileResult if found, null otherwise */ static find(cwd: string): ProjectFileResult | null; /** * Find the projects file or throw an error if not found * * @param cwd - Directory to search in * @returns ProjectFileResult * @throws Error if no projects file is found */ static findOrThrow(cwd: string): ProjectFileResult; /** * Get all possible projects file paths for a directory * Useful for error messages showing what was searched * * @param cwd - Directory to get paths for * @returns Array of possible file paths */ static getPossiblePaths(cwd: string): string[]; /** * Validate that a specific projects file exists * * @param filePath - Path to validate * @returns true if file exists, false otherwise */ static exists(filePath: string): boolean; /** * Resolve a projects file path (handles relative and absolute paths) * If path is provided, resolves it relative to cwd * If path is not provided, searches for default projects files * * @param cwd - Base directory * @param providedPath - Optional path provided by user * @returns ProjectFileResult if found, null otherwise */ static resolve(cwd: string, providedPath?: string): ProjectFileResult | null; /** * Detect file format from extension * * @param filePath - Path to detect format for * @returns 'yaml' or 'json' */ private static detectFormat; /** * Get list of supported file names * * @returns Array of supported file names */ static getSupportedFileNames(): string[]; } //# sourceMappingURL=project-file-finder.d.ts.map