import Ajv, { ErrorObject, KeywordDefinition, FormatDefinition } from 'ajv'; import { JSONSchema4, JSONSchema6, JSONSchema7 } from 'json-schema'; export declare type ValidationResult = { valid: true; errors?: ErrorObject[]; } | { valid: false; errors: ErrorObject[]; }; export declare type Validator = (value: any) => ValidationResult; export declare class JsonSchemaService { protected readonly ajv: Ajv.Ajv; protected readonly validators: Map; registerKeyword(keyword: string, definition: KeywordDefinition): void; registerFormat(name: string, definition: FormatDefinition): void; validate(schema: JSONSchema4 | JSONSchema6 | JSONSchema7, value: any): ValidationResult; validateOrThrow(schema: JSONSchema4 | JSONSchema6 | JSONSchema7, value: any): true; getValidator(schema: JSONSchema4 | JSONSchema6 | JSONSchema7): Validator; } export declare class ValidationError extends Error { readonly errors: ErrorObject[]; constructor(errors: ErrorObject[]); }