/**
 * Validation Type Definitions
 *
 * Types for manifest validation and error reporting.
 *
 * @module registry/types/validation
 * @version 2.0.0
 */
import type { RegistryResponse } from './registry.js';
/**
 * Validation severity levels
 */
export type ValidationSeverity = 'error' | 'warning' | 'info';
/**
 * Validation stage
 */
export type ValidationStage = 'manifest' | 'installation';
/**
 * Validation issue/error
 *
 * Represents a single validation problem found during manifest or installation validation.
 */
export interface ValidationIssue {
    /** Error code (e.g., "MANIFEST-001") */
    code: string;
    /** Severity level */
    severity: ValidationSeverity;
    /** Validation stage where this issue was found */
    stage: ValidationStage;
    /** Short title for the issue */
    title: string;
    /** Detailed message explaining the issue */
    message: string;
    /** File where the issue was found */
    file: string;
    /** Line number in the file (0 if unknown) */
    line: number;
    /** Column number in the file (0 if unknown) */
    column: number;
    /** Code snippet showing the problematic section (optional) */
    snippet?: string;
    /** Suggestions for fixing the issue */
    suggestions?: string[];
    /** Auto-fix command (e.g., "npm install @specverse/factories-prisma@3.3.0") */
    fix?: string;
    /** URL to learn more about this issue */
    learnMoreUrl?: string;
}
/**
 * Validation result
 *
 * Complete result of running validation on a manifest.
 */
export interface ValidationResult {
    /** True if validation passed (no errors) */
    valid: boolean;
    /** List of errors found */
    errors: ValidationIssue[];
    /** List of warnings found */
    warnings: ValidationIssue[];
    /** List of informational messages */
    info: ValidationIssue[];
}
/**
 * Validation rule interface
 *
 * All validation rules must implement this interface.
 */
export interface ValidationRule {
    /** Unique error code for this rule */
    code: string;
    /** Human-readable name for this rule */
    name: string;
    /** Default severity for issues from this rule */
    severity: ValidationSeverity;
    /** Stage where this rule runs */
    stage: ValidationStage;
    /**
     * Validate manifest against registry metadata
     *
     * @param manifest - The manifest to validate
     * @param registry - Registry metadata to validate against
     * @returns Array of validation issues found
     */
    validate(manifest: any, registry: RegistryResponse): ValidationIssue[];
}
/**
 * Manifest validation options
 */
export interface ManifestValidationOptions {
    /** Treat warnings as errors */
    strict?: boolean;
    /** Skip deprecated factory checks */
    skipDeprecated?: boolean;
    /** File path for error reporting */
    filePath?: string;
}
/**
 * Installation validation options
 */
export interface InstallationValidationOptions {
    /** Auto-install missing packages */
    autoInstall?: boolean;
    /** Check git sources (requires git command) */
    checkGit?: boolean;
    /** Check URL sources (requires network) */
    checkUrl?: boolean;
}
/**
 * Combined validation options
 */
export interface ValidationOptions extends ManifestValidationOptions, InstallationValidationOptions {
    /** Run manifest validation (Stage 2) */
    checkManifest?: boolean;
    /** Run installation validation (Stage 3) */
    checkInstalled?: boolean;
    /** Use offline mode (cached registry metadata) */
    offline?: boolean;
}
/**
 * Type guard to check if issue is an error
 */
export declare function isError(issue: ValidationIssue): boolean;
/**
 * Type guard to check if issue is a warning
 */
export declare function isWarning(issue: ValidationIssue): boolean;
/**
 * Type guard to check if issue is info
 */
export declare function isInfo(issue: ValidationIssue): boolean;
/**
 * Helper to filter issues by severity
 */
export declare function filterBySeverity(issues: ValidationIssue[], severity: ValidationSeverity): ValidationIssue[];
/**
 * Helper to filter issues by stage
 */
export declare function filterByStage(issues: ValidationIssue[], stage: ValidationStage): ValidationIssue[];
/**
 * Helper to check if validation result has errors
 */
export declare function hasErrors(result: ValidationResult): boolean;
/**
 * Helper to check if validation result has warnings
 */
export declare function hasWarnings(result: ValidationResult): boolean;
/**
 * Helper to get total issue count
 */
export declare function getTotalIssues(result: ValidationResult): number;
/**
 * Helper to merge multiple validation results
 */
export declare function mergeResults(...results: ValidationResult[]): ValidationResult;
/**
 * Helper to create a validation issue
 */
export declare function createIssue(code: string, severity: ValidationSeverity, stage: ValidationStage, title: string, message: string, file?: string, line?: number, column?: number): ValidationIssue;
/**
 * Helper to add suggestions to an issue
 */
export declare function withSuggestions(issue: ValidationIssue, suggestions: string[]): ValidationIssue;
/**
 * Helper to add fix command to an issue
 */
export declare function withFix(issue: ValidationIssue, fix: string): ValidationIssue;
/**
 * Helper to add learn more URL to an issue
 */
export declare function withLearnMore(issue: ValidationIssue, url: string): ValidationIssue;
/**
 * Error code constants
 */
export declare const ErrorCodes: {
    readonly FACTORY_NOT_FOUND: "MANIFEST-001";
    readonly FACTORY_DEPRECATED: "MANIFEST-002";
    readonly INVALID_CAPABILITY_MAPPING: "MANIFEST-004";
    readonly NETWORK_ERROR: "MANIFEST-005";
    readonly STALE_CACHE: "MANIFEST-006";
    readonly PACKAGE_NOT_INSTALLED: "REALIZE-001";
    readonly FACTORY_FILE_NOT_FOUND: "REALIZE-002";
    readonly VERSION_MISMATCH: "REALIZE-003";
};
/**
 * Type for error codes
 */
export type ErrorCode = typeof ErrorCodes[keyof typeof ErrorCodes];
/**
 * Learn more URLs
 */
export declare const LearnMoreUrls: {
    readonly REGISTRY: "https://registry.specverse.com/factories";
    readonly MIGRATION: "https://docs.specverse.com/migration";
    readonly CAPABILITIES: "https://docs.specverse.com/capabilities";
};
//# sourceMappingURL=validation.d.ts.map