| 1 | export default ValidationError;
|
|---|
| 2 | export type JSONSchema6 = import("json-schema").JSONSchema6;
|
|---|
| 3 | export type JSONSchema7 = import("json-schema").JSONSchema7;
|
|---|
| 4 | export type Schema = import("./validate").Schema;
|
|---|
| 5 | export type ValidationErrorConfiguration =
|
|---|
| 6 | import("./validate").ValidationErrorConfiguration;
|
|---|
| 7 | export type PostFormatter = import("./validate").PostFormatter;
|
|---|
| 8 | export type SchemaUtilErrorObject = import("./validate").SchemaUtilErrorObject;
|
|---|
| 9 | declare class ValidationError extends Error {
|
|---|
| 10 | /**
|
|---|
| 11 | * @param {Array<SchemaUtilErrorObject>} errors array of error objects
|
|---|
| 12 | * @param {Schema} schema schema
|
|---|
| 13 | * @param {ValidationErrorConfiguration} configuration configuration
|
|---|
| 14 | */
|
|---|
| 15 | constructor(
|
|---|
| 16 | errors: Array<SchemaUtilErrorObject>,
|
|---|
| 17 | schema: Schema,
|
|---|
| 18 | configuration?: ValidationErrorConfiguration,
|
|---|
| 19 | );
|
|---|
| 20 | /** @type {Array<SchemaUtilErrorObject>} */
|
|---|
| 21 | errors: Array<SchemaUtilErrorObject>;
|
|---|
| 22 | /** @type {Schema} */
|
|---|
| 23 | schema: Schema;
|
|---|
| 24 | /** @type {string} */
|
|---|
| 25 | headerName: string;
|
|---|
| 26 | /** @type {string} */
|
|---|
| 27 | baseDataPath: string;
|
|---|
| 28 | /** @type {PostFormatter | null} */
|
|---|
| 29 | postFormatter: PostFormatter | null;
|
|---|
| 30 | /**
|
|---|
| 31 | * @param {string} path path
|
|---|
| 32 | * @returns {Schema} schema
|
|---|
| 33 | */
|
|---|
| 34 | getSchemaPart(path: string): Schema;
|
|---|
| 35 | /**
|
|---|
| 36 | * @param {Schema} schema schema
|
|---|
| 37 | * @param {boolean} logic logic
|
|---|
| 38 | * @param {Array<object>} prevSchemas prev schemas
|
|---|
| 39 | * @returns {string} formatted schema
|
|---|
| 40 | */
|
|---|
| 41 | formatSchema(
|
|---|
| 42 | schema: Schema,
|
|---|
| 43 | logic?: boolean,
|
|---|
| 44 | prevSchemas?: Array<object>,
|
|---|
| 45 | ): string;
|
|---|
| 46 | /**
|
|---|
| 47 | * @param {Schema=} schemaPart schema part
|
|---|
| 48 | * @param {(boolean | Array<string>)=} additionalPath additional path
|
|---|
| 49 | * @param {boolean=} needDot true when need dot
|
|---|
| 50 | * @param {boolean=} logic logic
|
|---|
| 51 | * @returns {string} schema part text
|
|---|
| 52 | */
|
|---|
| 53 | getSchemaPartText(
|
|---|
| 54 | schemaPart?: Schema | undefined,
|
|---|
| 55 | additionalPath?: (boolean | Array<string>) | undefined,
|
|---|
| 56 | needDot?: boolean | undefined,
|
|---|
| 57 | logic?: boolean | undefined,
|
|---|
| 58 | ): string;
|
|---|
| 59 | /**
|
|---|
| 60 | * @param {Schema=} schemaPart schema part
|
|---|
| 61 | * @returns {string} schema part description
|
|---|
| 62 | */
|
|---|
| 63 | getSchemaPartDescription(schemaPart?: Schema | undefined): string;
|
|---|
| 64 | /**
|
|---|
| 65 | * @param {SchemaUtilErrorObject} error error object
|
|---|
| 66 | * @returns {string} formatted error object
|
|---|
| 67 | */
|
|---|
| 68 | formatValidationError(error: SchemaUtilErrorObject): string;
|
|---|
| 69 | /**
|
|---|
| 70 | * @param {Array<SchemaUtilErrorObject>} errors errors
|
|---|
| 71 | * @returns {string} formatted errors
|
|---|
| 72 | */
|
|---|
| 73 | formatValidationErrors(errors: Array<SchemaUtilErrorObject>): string;
|
|---|
| 74 | }
|
|---|