type JSONValue = null | boolean | number | string | JSONValue[] | { [key: string]: JSONValue; }; /** Canonical RFC 8927 schema. normalize() uses camelCase and omits null keywords. */ export type Schema = { definitions?: Record; metadata?: Record; nullable?: boolean; ref?: string; type?: string; enum?: string[]; elements?: Schema; properties?: Record; optionalProperties?: Record; additionalProperties?: boolean; values?: Schema; discriminator?: string; mapping?: Record; }; export interface ValidationError { instancePath: string[]; schemaPath: string[]; } export interface ValidationConfig { maxDepth?: number; maxErrors?: number; } export declare const limits: Readonly<{ bytes: number; schemaDepth: 32; refDepth: 32; pairs: 65536; jsonDepth: 128; nodes: 16384; values: 1048576; work: 1048576; errors: 100; diagnosticBytes: number; }>; export declare class ResourceLimitError extends Error { constructor(message?: string); } export declare class MaxDepthExceededError extends ResourceLimitError { constructor(); } export declare class SchemaError extends Error { constructor(message: string); } interface Node { form: 'empty' | 'ref' | 'type' | 'enum' | 'elements' | 'properties' | 'values' | 'discriminator'; path: string[]; nullable: boolean; acceptsNull?: boolean; nonNull?: boolean; child?: Node; type?: string; enumeration?: Set; properties?: Map; required?: Set; propertiesKeyword?: string; additional?: boolean; discriminator?: string; mapping?: Map; } /** Compile an untrusted schema once, without expanding references. */ export declare function compile(schema: unknown): CompiledSchema; /** Validate and copy a schema, using camelCase keywords and omitting null keywords. */ export declare function normalize(schema: unknown): Schema; /** Parse schema JSON with bounded depth and strict duplicate/Unicode checks. */ export declare function parseSchema(source: string | Uint8Array): Schema; /** Whether every finite source instance is accepted by target. */ export declare function subsumes(source: unknown, target: unknown): boolean; export declare function isSchema(schema: unknown): boolean; export declare function isValidSchema(schema: unknown): boolean; export declare function validate(schema: unknown, value: unknown, options?: ValidationConfig): ValidationError[]; export declare function validateJson(schema: unknown, source: string | Uint8Array, options?: ValidationConfig): ValidationError[]; export type CompiledSchema = Compiled; declare class Compiled { #private; /** Use compile() to construct a validated graph. */ constructor(root: Node); subsumes(target: CompiledSchema): boolean; validate(value: unknown, options?: ValidationConfig): ValidationError[]; /** Parse raw JSON without rounding number tokens or ignoring duplicate object members. */ validateJson(source: string | Uint8Array, options?: ValidationConfig): ValidationError[]; private evaluate; } export {}; //# sourceMappingURL=index.d.ts.map