1
- import { JSONSchema4 , JSONSchema6 , JSONSchema7 } from 'json-schema' ;
2
- import { ErrorObject } from 'ajv' ;
1
+ import { JSONSchema4 , JSONSchema6 , JSONSchema7 } from 'json-schema' ;
2
+ import { ErrorObject } from 'ajv' ;
3
3
4
4
type Schema = JSONSchema4 | JSONSchema6 | JSONSchema7 ;
5
5
type PostFormatter = ( formattedError : string , error : ErrorObject ) => string ;
6
6
7
7
declare namespace SchemaUtils {
8
- class ValidateError extends Error {
9
- constructor ( errors : Array < ErrorObject > , schema : Schema , configuration ?: Partial < ValidateErrorConfiguration > ) ;
8
+ class ValidationError extends Error {
9
+ constructor (
10
+ errors : Array < ErrorObject > ,
11
+ schema : Schema ,
12
+ configuration ?: Partial < ValidationErrorConfiguration >
13
+ ) ;
10
14
11
15
name : string ;
12
16
errors : Array < ErrorObject > ;
@@ -17,16 +21,21 @@ declare namespace SchemaUtils {
17
21
message : string ;
18
22
}
19
23
20
- interface ValidateErrorConfiguration {
21
- name : string ,
22
- baseDataPath : string ,
23
- postFormatter : PostFormatter
24
+ interface ValidationErrorConfiguration {
25
+ name : string ;
26
+ baseDataPath : string ;
27
+ postFormatter : PostFormatter ;
24
28
}
25
29
}
26
30
27
31
declare var validate : {
28
- ( schema : Schema , options : Array < object > | object , configuration ?: Partial < SchemaUtils . ValidateErrorConfiguration > ) : void ;
29
- ValidateError : typeof SchemaUtils . ValidateError
30
- }
32
+ (
33
+ schema : Schema ,
34
+ options : Array < object > | object ,
35
+ configuration ?: Partial < SchemaUtils . ValidationErrorConfiguration >
36
+ ) : void ;
37
+ ValidateError : typeof SchemaUtils . ValidationError ;
38
+ ValidationError : typeof SchemaUtils . ValidationError ;
39
+ } ;
31
40
32
41
export = validate ;
0 commit comments