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.

79 lines 2.25 kB
import { Project } from '../types/project'; /** * Validation error for a specific project */ export interface ValidationError { /** Project ID (if available) */ projectId?: string; /** Index of the project in the array */ projectIndex: number; /** Field that failed validation */ field: string; /** Error message */ message: string; } /** * Validation warning for a specific project */ export interface ValidationWarning { /** Project ID (if available) */ projectId?: string; /** Index of the project in the array */ projectIndex: number; /** Field that has a warning */ field: string; /** Warning message */ message: string; } /** * Result of validation containing all errors and warnings found */ export interface ValidationResult { /** Whether validation passed */ valid: boolean; /** Array of validation errors */ errors: ValidationError[]; /** Array of validation warnings */ warnings: ValidationWarning[]; } /** * Validates project data according to requirements */ export declare class Validator { private cwd; constructor(cwd?: string); /** * Validates an array of projects * @param projects - Array of projects to validate * @throws ProjectionError if validation fails * @returns Array of warnings (non-fatal issues) */ validate(projects: Project[]): ValidationWarning[]; /** * Validates projects and returns detailed results * @param projects - Array of projects to validate * @returns ValidationResult with all errors and warnings found */ validateProjects(projects: Project[]): ValidationResult; /** * Validates that all required fields are present */ private validateRequiredFields; /** * Validates project ID format (URL slug pattern) */ private validateProjectId; /** * Validates date format (ISO date string YYYY-MM-DD) */ private validateDateFormat; /** * Checks if local asset files exist (generates warnings, not errors) */ private checkLocalAssets; /** * Checks if a file path is local and if it exists */ private checkLocalFile; } //# sourceMappingURL=validator.d.ts.map