source: trip-planner-front/node_modules/schema-utils/declarations/ValidationError.d.ts@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.6 KB
Line 
1export default ValidationError;
2export type JSONSchema6 = import('json-schema').JSONSchema6;
3export type JSONSchema7 = import('json-schema').JSONSchema7;
4export type Schema =
5 | (import('json-schema').JSONSchema4 & import('./validate').Extend)
6 | (import('json-schema').JSONSchema6 & import('./validate').Extend)
7 | (import('json-schema').JSONSchema7 & import('./validate').Extend);
8export type ValidationErrorConfiguration = {
9 name?: string | undefined;
10 baseDataPath?: string | undefined;
11 postFormatter?: import('./validate').PostFormatter | undefined;
12};
13export type PostFormatter = (
14 formattedError: string,
15 error: import('ajv').ErrorObject & {
16 children?: import('ajv').ErrorObject[] | undefined;
17 }
18) => string;
19export type SchemaUtilErrorObject = import('ajv').ErrorObject & {
20 children?: import('ajv').ErrorObject[] | undefined;
21};
22export type SPECIFICITY = number;
23declare class ValidationError extends Error {
24 /**
25 * @param {Array<SchemaUtilErrorObject>} errors
26 * @param {Schema} schema
27 * @param {ValidationErrorConfiguration} configuration
28 */
29 constructor(
30 errors: Array<SchemaUtilErrorObject>,
31 schema: Schema,
32 configuration?: ValidationErrorConfiguration
33 );
34 /** @type {Array<SchemaUtilErrorObject>} */
35 errors: Array<SchemaUtilErrorObject>;
36 /** @type {Schema} */
37 schema: Schema;
38 /** @type {string} */
39 headerName: string;
40 /** @type {string} */
41 baseDataPath: string;
42 /** @type {PostFormatter | null} */
43 postFormatter: PostFormatter | null;
44 /**
45 * @param {string} path
46 * @returns {Schema}
47 */
48 getSchemaPart(path: string): Schema;
49 /**
50 * @param {Schema} schema
51 * @param {boolean} logic
52 * @param {Array<Object>} prevSchemas
53 * @returns {string}
54 */
55 formatSchema(
56 schema: Schema,
57 logic?: boolean,
58 prevSchemas?: Array<Object>
59 ): string;
60 /**
61 * @param {Schema=} schemaPart
62 * @param {(boolean | Array<string>)=} additionalPath
63 * @param {boolean=} needDot
64 * @param {boolean=} logic
65 * @returns {string}
66 */
67 getSchemaPartText(
68 schemaPart?: Schema | undefined,
69 additionalPath?: (boolean | Array<string>) | undefined,
70 needDot?: boolean | undefined,
71 logic?: boolean | undefined
72 ): string;
73 /**
74 * @param {Schema=} schemaPart
75 * @returns {string}
76 */
77 getSchemaPartDescription(schemaPart?: Schema | undefined): string;
78 /**
79 * @param {SchemaUtilErrorObject} error
80 * @returns {string}
81 */
82 formatValidationError(error: SchemaUtilErrorObject): string;
83 /**
84 * @param {Array<SchemaUtilErrorObject>} errors
85 * @returns {string}
86 */
87 formatValidationErrors(errors: Array<SchemaUtilErrorObject>): string;
88}
Note: See TracBrowser for help on using the repository browser.