1 |
|
2 | import { JSONSchema4, JSONSchema4Type, JSONSchema4TypeName } from 'json-schema';
|
3 | export type SchemaType = 'ALL_OF' | 'UNNAMED_SCHEMA' | 'ANY' | 'ANY_OF' | 'BOOLEAN' | 'NAMED_ENUM' | 'NAMED_SCHEMA' | 'NEVER' | 'NULL' | 'NUMBER' | 'STRING' | 'OBJECT' | 'ONE_OF' | 'TYPED_ARRAY' | 'REFERENCE' | 'UNION' | 'UNNAMED_ENUM' | 'UNTYPED_ARRAY' | 'CUSTOM_TYPE';
|
4 | export type JSONSchemaTypeName = JSONSchema4TypeName;
|
5 | export type JSONSchemaType = JSONSchema4Type;
|
6 | export interface JSONSchema extends JSONSchema4 {
|
7 | |
8 |
|
9 |
|
10 | tsEnumNames?: string[];
|
11 | |
12 |
|
13 |
|
14 | tsType?: string;
|
15 | |
16 |
|
17 |
|
18 | deprecated?: boolean;
|
19 | }
|
20 | export declare const Parent: unique symbol;
|
21 | export interface LinkedJSONSchema extends JSONSchema {
|
22 | |
23 |
|
24 |
|
25 |
|
26 | [Parent]: LinkedJSONSchema | null;
|
27 | additionalItems?: boolean | LinkedJSONSchema;
|
28 | additionalProperties?: boolean | LinkedJSONSchema;
|
29 | items?: LinkedJSONSchema | LinkedJSONSchema[];
|
30 | definitions?: {
|
31 | [k: string]: LinkedJSONSchema;
|
32 | };
|
33 | properties?: {
|
34 | [k: string]: LinkedJSONSchema;
|
35 | };
|
36 | patternProperties?: {
|
37 | [k: string]: LinkedJSONSchema;
|
38 | };
|
39 | dependencies?: {
|
40 | [k: string]: LinkedJSONSchema | string[];
|
41 | };
|
42 | allOf?: LinkedJSONSchema[];
|
43 | anyOf?: LinkedJSONSchema[];
|
44 | oneOf?: LinkedJSONSchema[];
|
45 | not?: LinkedJSONSchema;
|
46 | }
|
47 | export declare const Types: unique symbol;
|
48 | export declare const Intersection: unique symbol;
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 | export interface NormalizedJSONSchema extends Omit<LinkedJSONSchema, 'definitions' | 'id'> {
|
55 | [Intersection]?: NormalizedJSONSchema;
|
56 | [Parent]: NormalizedJSONSchema | null;
|
57 | [Types]: ReadonlySet<SchemaType>;
|
58 | additionalItems?: boolean | NormalizedJSONSchema;
|
59 | additionalProperties: boolean | NormalizedJSONSchema;
|
60 | extends?: string[];
|
61 | items?: NormalizedJSONSchema | NormalizedJSONSchema[];
|
62 | $defs?: {
|
63 | [k: string]: NormalizedJSONSchema;
|
64 | };
|
65 | properties?: {
|
66 | [k: string]: NormalizedJSONSchema;
|
67 | };
|
68 | patternProperties?: {
|
69 | [k: string]: NormalizedJSONSchema;
|
70 | };
|
71 | dependencies?: {
|
72 | [k: string]: NormalizedJSONSchema | string[];
|
73 | };
|
74 | allOf?: NormalizedJSONSchema[];
|
75 | anyOf?: NormalizedJSONSchema[];
|
76 | oneOf?: NormalizedJSONSchema[];
|
77 | not?: NormalizedJSONSchema;
|
78 | required: string[];
|
79 | }
|
80 | export interface EnumJSONSchema extends NormalizedJSONSchema {
|
81 | enum: JSONSchema4Type[];
|
82 | }
|
83 | export interface NamedEnumJSONSchema extends NormalizedJSONSchema {
|
84 | tsEnumNames: string[];
|
85 | }
|
86 | export interface SchemaSchema extends NormalizedJSONSchema {
|
87 | properties: {
|
88 | [k: string]: NormalizedJSONSchema;
|
89 | };
|
90 | required: string[];
|
91 | }
|
92 | export interface JSONSchemaWithDefinitions extends NormalizedJSONSchema {
|
93 | $defs: {
|
94 | [k: string]: NormalizedJSONSchema;
|
95 | };
|
96 | }
|
97 | export interface CustomTypeJSONSchema extends NormalizedJSONSchema {
|
98 | tsType: string;
|
99 | }
|
100 | export declare const getRootSchema: ((schema: NormalizedJSONSchema) => NormalizedJSONSchema) & import("lodash").MemoizedFunction;
|
101 | export declare function isBoolean(schema: LinkedJSONSchema | JSONSchemaType): schema is boolean;
|
102 | export declare function isPrimitive(schema: LinkedJSONSchema | JSONSchemaType): schema is JSONSchemaType;
|
103 | export declare function isCompound(schema: JSONSchema): boolean;
|
104 |
|
\ | No newline at end of file |