UNPKG

3 kBTypeScriptView Raw
1export declare namespace JsonSchemaDraft04 {
2 interface Schema {
3 id?: string;
4 $schema?: string;
5 $ref?: string;
6 title?: string;
7 description?: string;
8 example?: string;
9 default?: any;
10 nullable?: boolean;
11 multipleOf?: number;
12 maximum?: number;
13 exclusiveMaximum?: boolean;
14 minimum?: number;
15 exclusiveMinimum?: boolean;
16 maxLength?: Schema.Definitions.PositiveInteger;
17 minLength?: Schema.Definitions.PositiveIntegerDefault0;
18 pattern?: string;
19 additionalItems?: boolean | Schema;
20 items?: Schema | Schema.Definitions.SchemaArray;
21 maxItems?: Schema.Definitions.PositiveInteger;
22 minItems?: Schema.Definitions.PositiveIntegerDefault0;
23 uniqueItems?: boolean;
24 maxProperties?: Schema.Definitions.PositiveInteger;
25 minProperties?: Schema.Definitions.PositiveIntegerDefault0;
26 required?: Schema.Definitions.StringArray;
27 additionalProperties?: boolean | Schema;
28 definitions?: {
29 [name: string]: Schema;
30 };
31 properties?: {
32 [name: string]: Schema;
33 };
34 patternProperties?: {
35 [name: string]: Schema;
36 };
37 dependencies?: {
38 [name: string]: Schema | Schema.Definitions.StringArray;
39 };
40 enum?: any[];
41 type?: Schema.Definitions.SimpleTypes | Schema.Definitions.SimpleTypes[];
42 format?: string;
43 allOf?: Schema.Definitions.SchemaArray;
44 anyOf?: Schema.Definitions.SchemaArray;
45 oneOf?: Schema.Definitions.SchemaArray;
46 not?: Schema;
47 }
48 namespace Schema {
49 namespace Definitions {
50 type PositiveInteger = number;
51 type PositiveIntegerDefault0 = number;
52 type SchemaArray = Schema[];
53 type SimpleTypes = 'array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'any' | 'undefined';
54 type StringArray = string[];
55 }
56 namespace Properties {
57 type Default = any;
58 type Description = string;
59 type Enum = any[];
60 type ExclusiveMaximum = boolean;
61 type ExclusiveMinimum = boolean;
62 type MaxItems = Definitions.PositiveInteger;
63 type MaxLength = Definitions.PositiveInteger;
64 type MaxProperties = Definitions.PositiveInteger;
65 type Maximum = number;
66 type MinItems = Definitions.PositiveIntegerDefault0;
67 type MinLength = Definitions.PositiveIntegerDefault0;
68 type MinProperties = Definitions.PositiveIntegerDefault0;
69 type Minimum = number;
70 type MultipleOf = number;
71 type Pattern = string;
72 type Required = Definitions.StringArray;
73 type Title = string;
74 type Type = Definitions.SimpleTypes | Definitions.SimpleTypes[];
75 type UniqueItems = boolean;
76 }
77 }
78}