UNPKG

2.07 kBTypeScriptView Raw
1import { JSONValue } from '@phosphor/coreutils';
2export declare type JsonType = 'string' | 'array' | 'number' | 'integer' | 'object' | 'boolean' | 'null';
3/**
4 * extended JSON schema
5 */
6export interface IJSONSchema {
7 id?: string;
8 $id?: string;
9 $schema?: string;
10 type?: JsonType | JsonType[];
11 title?: string;
12 default?: JSONValue;
13 definitions?: IJSONSchemaMap;
14 description?: string;
15 properties?: IJSONSchemaMap;
16 patternProperties?: IJSONSchemaMap;
17 additionalProperties?: boolean | IJSONSchema;
18 minProperties?: number;
19 maxProperties?: number;
20 dependencies?: IJSONSchemaMap | {
21 [prop: string]: string[];
22 };
23 items?: IJSONSchema | IJSONSchema[];
24 prefixItems?: IJSONSchema[];
25 minItems?: number;
26 maxItems?: number;
27 uniqueItems?: boolean;
28 additionalItems?: boolean | IJSONSchema;
29 pattern?: string;
30 minLength?: number;
31 maxLength?: number;
32 minimum?: number;
33 maximum?: number;
34 exclusiveMinimum?: boolean | number;
35 exclusiveMaximum?: boolean | number;
36 multipleOf?: number;
37 required?: string[];
38 $ref?: string;
39 anyOf?: IJSONSchema[];
40 allOf?: IJSONSchema[];
41 oneOf?: IJSONSchema[];
42 not?: IJSONSchema;
43 enum?: JSONValue[];
44 format?: string;
45 const?: JSONValue;
46 contains?: IJSONSchema;
47 propertyNames?: IJSONSchema;
48 $comment?: string;
49 if?: IJSONSchema;
50 then?: IJSONSchema;
51 else?: IJSONSchema;
52 defaultSnippets?: IJSONSchemaSnippet[];
53 errorMessage?: string;
54 patternErrorMessage?: string;
55 deprecationMessage?: string;
56 enumItemLabels?: string[];
57 enumDescriptions?: string[];
58 markdownEnumDescriptions?: string[];
59 markdownDescription?: string;
60 doNotSuggest?: boolean;
61 allowComments?: boolean;
62 allowTrailingCommas?: boolean;
63}
64export interface IJSONSchemaMap {
65 [name: string]: IJSONSchema;
66}
67export interface IJSONSchemaSnippet {
68 label?: string;
69 description?: string;
70 body?: JSONValue;
71 bodyText?: string;
72}
73//# sourceMappingURL=json-schema.d.ts.map
\No newline at end of file