UNPKG

2.9 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?: Record<string, Schema>;
29 properties?: Record<string, Schema>;
30 patternProperties?: Record<string, Schema>;
31 dependencies?: Record<string, Schema | Schema.Definitions.StringArray>;
32 enum?: any[];
33 type?: Schema.Definitions.SimpleTypes | Schema.Definitions.SimpleTypes[];
34 format?: string;
35 allOf?: Schema.Definitions.SchemaArray;
36 anyOf?: Schema.Definitions.SchemaArray;
37 oneOf?: Schema.Definitions.SchemaArray;
38 not?: Schema;
39 }
40 namespace Schema {
41 namespace Definitions {
42 type PositiveInteger = number;
43 type PositiveIntegerDefault0 = number;
44 type SchemaArray = Schema[];
45 type SimpleTypes = 'array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'any' | 'undefined';
46 type StringArray = string[];
47 }
48 namespace Properties {
49 type Default = any;
50 type Description = string;
51 type Enum = any[];
52 type ExclusiveMaximum = boolean;
53 type ExclusiveMinimum = boolean;
54 type MaxItems = Definitions.PositiveInteger;
55 type MaxLength = Definitions.PositiveInteger;
56 type MaxProperties = Definitions.PositiveInteger;
57 type Maximum = number;
58 type MinItems = Definitions.PositiveIntegerDefault0;
59 type MinLength = Definitions.PositiveIntegerDefault0;
60 type MinProperties = Definitions.PositiveIntegerDefault0;
61 type Minimum = number;
62 type MultipleOf = number;
63 type Pattern = string;
64 type Required = Definitions.StringArray;
65 type Title = string;
66 type Type = Definitions.SimpleTypes | Definitions.SimpleTypes[];
67 type UniqueItems = boolean;
68 }
69 }
70}