/**
 * Schema Registry Service
 *
 * Loads schema definitions from project sink directories and validates
 * data payloads against those schemas. Central to the Data Architecture V2
 * governance layer — ensures every piece of data entering a sink conforms
 * to its declared structure.
 *
 * @module services/data/schema-registry.service
 */
import type { SchemaDefinition, ValidationResult } from '../../types/data-object.types.js';
/**
 * Singleton service that manages schema definitions and validates payloads.
 *
 * Schemas are loaded from `{projectPath}/sinks/{sinkDir}/_schema.json` for
 * each registered sink, or from a consolidated registry file. The validate()
 * method applies all declared field rules and returns a structured result.
 */
export declare class SchemaRegistryService {
    private static instance;
    private readonly logger;
    private readonly schemas;
    private constructor();
    /**
     * Get the singleton instance.
     *
     * @returns SchemaRegistryService singleton
     */
    static getInstance(): SchemaRegistryService;
    /**
     * Reset the singleton (for testing).
     */
    static resetInstance(): void;
    /**
     * Load schemas from a project's sinks directory.
     *
     * Scans `{projectPath}/sinks/` for sub-directories containing a
     * `_schema.json` file and registers each valid schema.
     *
     * @param projectPath - Absolute path to the Crewly project root
     */
    loadSchemas(projectPath: string): Promise<void>;
    /**
     * Register a schema definition directly (e.g. from tests or programmatic setup).
     *
     * @param schema - The schema to register
     */
    registerSchema(schema: SchemaDefinition): void;
    /**
     * Get a schema by its ID.
     *
     * @param schemaId - Unique schema identifier
     * @returns The schema, or null if not found
     */
    getSchema(schemaId: string): SchemaDefinition | null;
    /**
     * List all loaded schemas.
     *
     * @returns Array of all registered SchemaDefinitions
     */
    listSchemas(): SchemaDefinition[];
    /**
     * Validate a payload against a registered schema.
     *
     * Applies the following rules per field:
     * - **required**: field must exist and not be null/undefined
     * - **type**: JS typeof must match (with special handling for array, datetime, enum)
     * - **max_length**: string length must not exceed limit
     * - **enum options**: value must be one of the declared options
     * - **array min_items**: array length must meet minimum
     * - **datetime**: value must match ISO 8601 format
     *
     * @param schemaId - ID of the schema to validate against
     * @param payload - Key-value data to validate
     * @returns Structured validation result with any errors
     */
    validate(schemaId: string, payload: Record<string, unknown>): ValidationResult;
    /**
     * Validate a single field against its definition, pushing errors into the array.
     *
     * @param fieldName - Name of the field being validated
     * @param fieldDef - Schema field definition
     * @param value - Actual value from the payload
     * @param errors - Mutable array to collect validation errors
     */
    private validateField;
    /**
     * Validate a string field (typeof + max_length).
     */
    private validateString;
    /**
     * Validate a primitive type via typeof.
     */
    private validateType;
    /**
     * Validate an array field (isArray + min_items).
     */
    private validateArray;
    /**
     * Validate a datetime field (must be a string matching ISO 8601).
     */
    private validateDatetime;
    /**
     * Validate an enum field (value must be one of options).
     */
    private validateEnum;
}
//# sourceMappingURL=schema-registry.service.d.ts.map