[79a0317] | 1 | export type JSONSchema4 = import("json-schema").JSONSchema4;
|
---|
| 2 | export type JSONSchema6 = import("json-schema").JSONSchema6;
|
---|
| 3 | export type JSONSchema7 = import("json-schema").JSONSchema7;
|
---|
| 4 | export type ErrorObject = import("ajv").ErrorObject;
|
---|
| 5 | export type Extend = {
|
---|
| 6 | formatMinimum?: (string | number) | undefined;
|
---|
| 7 | formatMaximum?: (string | number) | undefined;
|
---|
| 8 | formatExclusiveMinimum?: (string | boolean) | undefined;
|
---|
| 9 | formatExclusiveMaximum?: (string | boolean) | undefined;
|
---|
| 10 | link?: string | undefined;
|
---|
| 11 | undefinedAsNull?: boolean | undefined;
|
---|
| 12 | };
|
---|
| 13 | export type Schema = (JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend;
|
---|
| 14 | export type SchemaUtilErrorObject = ErrorObject & {
|
---|
| 15 | children?: Array<ErrorObject>;
|
---|
| 16 | };
|
---|
| 17 | export type PostFormatter = (
|
---|
| 18 | formattedError: string,
|
---|
| 19 | error: SchemaUtilErrorObject
|
---|
| 20 | ) => string;
|
---|
| 21 | export type ValidationErrorConfiguration = {
|
---|
| 22 | name?: string | undefined;
|
---|
| 23 | baseDataPath?: string | undefined;
|
---|
| 24 | postFormatter?: PostFormatter | undefined;
|
---|
| 25 | };
|
---|
| 26 | /**
|
---|
| 27 | * @param {Schema} schema
|
---|
| 28 | * @param {Array<object> | object} options
|
---|
| 29 | * @param {ValidationErrorConfiguration=} configuration
|
---|
| 30 | * @returns {void}
|
---|
| 31 | */
|
---|
| 32 | export function validate(
|
---|
| 33 | schema: Schema,
|
---|
| 34 | options: Array<object> | object,
|
---|
| 35 | configuration?: ValidationErrorConfiguration | undefined
|
---|
| 36 | ): void;
|
---|
| 37 | export function enableValidation(): void;
|
---|
| 38 | export function disableValidation(): void;
|
---|
| 39 | export function needValidate(): boolean;
|
---|
| 40 | import ValidationError from "./ValidationError";
|
---|
| 41 | export { ValidationError };
|
---|