import Ajv, { AsyncValidateFunction, ValidateFunction } from 'ajv'; import { FromSchema, JSONSchema } from 'json-schema-to-ts'; export declare const DEFAULT_AJV: Ajv; export { Ajv }; /** * A validation function that takes data and returns the (possibly coerced) * data or throws a validation error. */ export type Validator = (data: T) => Promise; export type JSONSchemaDefinition = JSONSchema & { $id: string; $async?: true; properties?: { [key: string]: JSONSchema; }; required?: readonly string[]; }; export interface Schema { validate(...args: Parameters>): Promise; } export declare class SchemaWrapper implements Schema> { definition: S; ajv: Ajv; validator: AsyncValidateFunction; readonly _type: FromSchema; constructor(definition: S, ajv?: Ajv); get properties(): S["properties"]; get required(): S["required"]; validate>(...args: Parameters>): Promise; toJSON(): S; } export declare function schema(definition: S, ajv?: Ajv): SchemaWrapper;