@@ -11,10 +11,34 @@ export declare function getDefaultArgs(): {
11
11
strictNullChecks : boolean ;
12
12
out : string ;
13
13
} ;
14
+ export declare type Definition = {
15
+ $ref ?: string ;
16
+ description ?: string ;
17
+ allOf ?: Definition [ ] ;
18
+ oneOf ?: Definition [ ] ;
19
+ anyOf ?: Definition [ ] ;
20
+ title ?: string ;
21
+ type ?: string | string [ ] ;
22
+ definitions ?: {
23
+ [ key : string ] : any ;
24
+ } ;
25
+ format ?: string ;
26
+ items ?: Definition ;
27
+ minItems ?: number ;
28
+ additionalItems ?: {
29
+ anyOf : Definition ;
30
+ } ;
31
+ enum ?: string [ ] | Definition [ ] ;
32
+ default ?: string | number | boolean | Object ;
33
+ additionalProperties ?: Definition ;
34
+ required ?: string [ ] ;
35
+ propertyOrder ?: string [ ] ;
36
+ properties ?: { } ;
37
+ defaultProperties ?: string [ ] ;
38
+ } ;
14
39
export declare class JsonSchemaGenerator {
15
40
private args ;
16
41
private static validationKeywords ;
17
- private static annotedValidationKeywordPattern ;
18
42
private allSymbols ;
19
43
private inheritingTypes ;
20
44
private tc ;
@@ -36,10 +60,9 @@ export declare class JsonSchemaGenerator {
36
60
out : string ;
37
61
} ) ;
38
62
readonly ReffedDefinitions : {
39
- [ key : string ] : any ;
63
+ [ key : string ] : Definition ;
40
64
} ;
41
- private copyValidationKeywords ( comment , to , otherAnnotations ) ;
42
- private copyDescription ( comment , to ) ;
65
+ private parseValue ( value ) ;
43
66
private parseCommentsIntoDefinition ( symbol , definition , otherAnnotations ) ;
44
67
private extractLiteralValue ( typ ) ;
45
68
private resolveTupleType ( propertyType ) ;
@@ -53,10 +76,10 @@ export declare class JsonSchemaGenerator {
53
76
private addSimpleType ( def , type ) ;
54
77
private makeNullable ( def ) ;
55
78
private getTypeDefinition ( typ , tc , asRef ?, unionModifier ?, prop ?, reffedType ?) ;
56
- getSchemaForSymbol ( symbolName : string , includeReffedDefinitions ?: boolean ) : any ;
79
+ getSchemaForSymbol ( symbolName : string , includeReffedDefinitions ?: boolean ) : Definition ;
57
80
getSchemaForSymbols ( symbols : {
58
81
[ name : string ] : ts . Type ;
59
- } ) : any ;
82
+ } ) : Definition ;
60
83
}
61
84
export declare function getProgramFromFiles ( files : string [ ] , compilerOptions ?: ts . CompilerOptions ) : ts . Program ;
62
85
export declare function generateSchema ( program : ts . Program , fullTypeName : string , args ?: {
@@ -70,7 +93,7 @@ export declare function generateSchema(program: ts.Program, fullTypeName: string
70
93
generateRequired : boolean ;
71
94
strictNullChecks : boolean ;
72
95
out : string ;
73
- } ) : any ;
96
+ } ) : Definition ;
74
97
export declare function programFromConfig ( configFileName : string ) : ts . Program ;
75
98
export declare function exec ( filePattern : string , fullTypeName : string , args ?: {
76
99
useRef : boolean ;
0 commit comments