/** * Schema type definitions for TONL Schema Language (TSL) */ import type { TONLTypeHint } from '../types.js'; /** * Schema directive metadata */ export interface SchemaDirectives { version: string; strict?: boolean; description?: string; dataVersion?: string; } /** * Validation constraint types */ export type ConstraintType = 'required' | 'optional' | 'default' | 'min' | 'max' | 'length' | 'pattern' | 'trim' | 'lowercase' | 'uppercase' | 'range' | 'multipleOf' | 'integer' | 'positive' | 'negative' | 'unique' | 'nonempty' | 'sealed' | 'requiredKeys'; /** * Single validation constraint */ export interface ValidationConstraint { type: ConstraintType; value?: string | number | boolean; } /** * Field definition in schema */ export interface SchemaField { name: string; type: SchemaType; constraints: ValidationConstraint[]; description?: string; } /** * Schema type definition */ export type SchemaType = PrimitiveSchemaType | ComplexSchemaType | CustomSchemaType; /** * Primitive schema types */ export interface PrimitiveSchemaType { kind: 'primitive'; baseType: TONLTypeHint; nullable?: boolean; } /** * Complex schema types (list, obj) */ export interface ComplexSchemaType { kind: 'complex'; baseType: 'list' | 'obj'; elementType?: SchemaType; fields?: SchemaField[]; } /** * Custom type reference */ export interface CustomSchemaType { kind: 'custom'; typeName: string; } /** * Custom type definition */ export interface CustomTypeDefinition { name: string; type: SchemaType; fields?: SchemaField[]; description?: string; } /** * Complete schema definition */ export interface TONLSchema { directives: SchemaDirectives; customTypes: Map; rootFields: SchemaField[]; } /** * Validation error */ export interface ValidationError { field: string; message: string; expected?: string; actual?: string; line?: number; column?: number; } /** * Validation result */ export interface ValidationResult { valid: boolean; errors: ValidationError[]; warnings?: string[]; } //# sourceMappingURL=types.d.ts.map