/** * @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. * A base "name" (letter-led) optionally followed by one or more colon-separated * narrowing segments (each may start with a digit), e.g. `model`, * `model:EmbeddingTask`, `points:3d:meters`. * 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 are validated against {@link FORMAT_PATTERN} * (`/^[a-z][\w-]*(?::[a-z0-9][\w-]*)*$/i`): a letter-led base name optionally * followed by one or more colon-separated narrowing segments, where a narrowing * segment may begin with a digit (e.g., `"model"`, `"model:EmbeddingTask"`, * `"storage:tabular"`, `"points:3d:meters"`). * * 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