/** * TypeValidator (full rewrite) * ────────────────────────────── * Validates a string value against an XSD simple type, checking all facets. * * Fixed vs. prior version * ──────────────────────── * • Enumeration – facets are now OR'd correctly (any match = valid) * • Pattern – XSD regex dialect translated to JS: * \i \I \c \C \d \D \w \W \s \S character class escapes, * . (no-newline in XSD), XSD category escapes \p{...} * • Whitespace – inherited from base-type chain, not just own facets * • Type chain – user-defined types walk base chain before applying own facets * • Cycle guard – prevents infinite loops in pathological type chains */ import { SchemaModel, SimpleTypeDefinition } from '../schema/SchemaModel'; export interface TypeValidationResult { valid: boolean; message?: string; } export declare class TypeValidator { private schema; /** * T-04: Per-instance whitespace normalisation mode cache. * Keyed by type name; populated lazily on first _normaliseChain call. * Reset automatically when a new TypeValidator is constructed (on schema reload). */ private readonly _wsCache; constructor(schema: SchemaModel); /** * NP3-09 fix: update the schema reference and clear caches for watch mode schema reloads. * StreamingValidator constructs TypeValidator once and reuses it — when the schema is * reloaded (file changed), callers must call updateSchema() so stale type info is discarded. */ updateSchema(newSchema: SchemaModel): void; validate(value: string, typeName: string): TypeValidationResult; /** * Validate a value directly against an inline SimpleTypeDefinition. * Used for anonymous types that are never registered in the schema map. */ validateDef(value: string, def: SimpleTypeDefinition): TypeValidationResult; private _validateSimpleType; private _normaliseChain; private _checkPrimitive; private _checkIntRange; /** * Check all facets. Enumeration facets are collected and OR'd together. * All other facets must pass independently (AND logic). * Single-pass scan avoids allocating two filter arrays. */ private _checkFacets; private _checkSingleFacet; private _validateList; private _validateUnion; } //# sourceMappingURL=TypeValidator.d.ts.map