/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ export { compileSchema } from "@sroussey/json-schema-library"; export type { SchemaNode } from "@sroussey/json-schema-library"; import type { DataPortSchema } from "./DataPortSchema"; export interface SchemaValidationError { readonly path: string; readonly message: string; } export interface SchemaValidationResult { readonly valid: boolean; readonly errors: readonly SchemaValidationError[]; } /** * Pattern for format annotations used in dataflow compatibility checking. * Format: /\w+(:\w+)?/ where first part is the "name" and optional second part narrows the type. * Reused from SchemaUtils.ts areFormatStringsCompatible(). */ export declare const FORMAT_PATTERN: RegExp; /** * Validates that a schema is a well-formed DataPortSchema. * * A DataPortSchema must be either a boolean or an object with `type: "object"` * and a `properties` record where no property value is a boolean. */ export declare function validateDataPortSchema(schema: DataPortSchema): SchemaValidationResult; /** * Validates that all `format` annotations in a schema match the expected pattern. * * Format annotations use the pattern `/^[a-zA-Z][a-zA-Z0-9_-]*(:[a-zA-Z][a-zA-Z0-9_-]*)?$/` * (e.g., `"model"`, `"model:EmbeddingTask"`, `"storage:tabular"`). * * Standard JSON Schema formats (e.g., `"date-time"`, `"uri"`, `"email"`) also pass * since they match the pattern. */ export declare function validateFormatAnnotations(schema: DataPortSchema): SchemaValidationResult; /** * Validates a DataPortSchema for both structural correctness and valid format annotations. * Convenience function combining {@link validateDataPortSchema} and {@link validateFormatAnnotations}. */ export declare function validateSchema(schema: DataPortSchema): SchemaValidationResult; //# sourceMappingURL=SchemaValidation.d.ts.map