@speclynx/apidom-ns-json-schema-draft-4 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/LICENSE +202 -0
  3. package/LICENSES/AFL-3.0.txt +182 -0
  4. package/LICENSES/Apache-2.0.txt +202 -0
  5. package/LICENSES/BSD-3-Clause.txt +26 -0
  6. package/LICENSES/MIT.txt +9 -0
  7. package/NOTICE +65 -0
  8. package/README.md +189 -0
  9. package/dist/apidom-ns-json-schema-draft-4.browser.js +1 -0
  10. package/package.json +64 -0
  11. package/src/elements/JSONReference.cjs +29 -0
  12. package/src/elements/JSONReference.mjs +26 -0
  13. package/src/elements/JSONSchema.cjs +296 -0
  14. package/src/elements/JSONSchema.mjs +292 -0
  15. package/src/elements/LinkDescription.cjs +65 -0
  16. package/src/elements/LinkDescription.mjs +61 -0
  17. package/src/elements/Media.cjs +29 -0
  18. package/src/elements/Media.mjs +26 -0
  19. package/src/index.cjs +66 -0
  20. package/src/index.mjs +24 -0
  21. package/src/media-types.cjs +34 -0
  22. package/src/media-types.mjs +30 -0
  23. package/src/namespace.cjs +25 -0
  24. package/src/namespace.mjs +20 -0
  25. package/src/predicates.cjs +53 -0
  26. package/src/predicates.mjs +48 -0
  27. package/src/refractor/index.cjs +53 -0
  28. package/src/refractor/index.mjs +47 -0
  29. package/src/refractor/plugins/replace-empty-element.cjs +200 -0
  30. package/src/refractor/plugins/replace-empty-element.mjs +194 -0
  31. package/src/refractor/predicates.cjs +16 -0
  32. package/src/refractor/predicates.mjs +12 -0
  33. package/src/refractor/registration.cjs +19 -0
  34. package/src/refractor/registration.mjs +10 -0
  35. package/src/refractor/specification.cjs +182 -0
  36. package/src/refractor/specification.mjs +177 -0
  37. package/src/refractor/toolbox.cjs +21 -0
  38. package/src/refractor/toolbox.mjs +15 -0
  39. package/src/refractor/visitors/FallbackVisitor.cjs +25 -0
  40. package/src/refractor/visitors/FallbackVisitor.mjs +19 -0
  41. package/src/refractor/visitors/SpecificationVisitor.cjs +74 -0
  42. package/src/refractor/visitors/SpecificationVisitor.mjs +68 -0
  43. package/src/refractor/visitors/Visitor.cjs +31 -0
  44. package/src/refractor/visitors/Visitor.mjs +28 -0
  45. package/src/refractor/visitors/generics/AlternatingVisitor.cjs +42 -0
  46. package/src/refractor/visitors/generics/AlternatingVisitor.mjs +35 -0
  47. package/src/refractor/visitors/generics/FixedFieldsVisitor.cjs +53 -0
  48. package/src/refractor/visitors/generics/FixedFieldsVisitor.mjs +46 -0
  49. package/src/refractor/visitors/generics/MapVisitor.cjs +21 -0
  50. package/src/refractor/visitors/generics/MapVisitor.mjs +15 -0
  51. package/src/refractor/visitors/generics/PatternedFieldsVisitor.cjs +53 -0
  52. package/src/refractor/visitors/generics/PatternedFieldsVisitor.mjs +47 -0
  53. package/src/refractor/visitors/json-schema/AllOfVisitor.cjs +35 -0
  54. package/src/refractor/visitors/json-schema/AllOfVisitor.mjs +29 -0
  55. package/src/refractor/visitors/json-schema/AnyOfVisitor.cjs +35 -0
  56. package/src/refractor/visitors/json-schema/AnyOfVisitor.mjs +29 -0
  57. package/src/refractor/visitors/json-schema/DefinitionsVisitor.cjs +27 -0
  58. package/src/refractor/visitors/json-schema/DefinitionsVisitor.mjs +21 -0
  59. package/src/refractor/visitors/json-schema/DependenciesVisitor.cjs +27 -0
  60. package/src/refractor/visitors/json-schema/DependenciesVisitor.mjs +21 -0
  61. package/src/refractor/visitors/json-schema/EnumVisitor.cjs +17 -0
  62. package/src/refractor/visitors/json-schema/EnumVisitor.mjs +12 -0
  63. package/src/refractor/visitors/json-schema/ItemsVisitor.cjs +37 -0
  64. package/src/refractor/visitors/json-schema/ItemsVisitor.mjs +31 -0
  65. package/src/refractor/visitors/json-schema/JSONSchemaOrJSONReferenceVisitor.cjs +24 -0
  66. package/src/refractor/visitors/json-schema/JSONSchemaOrJSONReferenceVisitor.mjs +19 -0
  67. package/src/refractor/visitors/json-schema/LinksVisitor.cjs +33 -0
  68. package/src/refractor/visitors/json-schema/LinksVisitor.mjs +27 -0
  69. package/src/refractor/visitors/json-schema/OneOfVisitor.cjs +35 -0
  70. package/src/refractor/visitors/json-schema/OneOfVisitor.mjs +29 -0
  71. package/src/refractor/visitors/json-schema/ParentSchemaAwareVisitor.cjs +20 -0
  72. package/src/refractor/visitors/json-schema/ParentSchemaAwareVisitor.mjs +16 -0
  73. package/src/refractor/visitors/json-schema/PatternPropertiesVisitor.cjs +27 -0
  74. package/src/refractor/visitors/json-schema/PatternPropertiesVisitor.mjs +21 -0
  75. package/src/refractor/visitors/json-schema/PropertiesVisitor.cjs +27 -0
  76. package/src/refractor/visitors/json-schema/PropertiesVisitor.mjs +21 -0
  77. package/src/refractor/visitors/json-schema/RequiredVisitor.cjs +17 -0
  78. package/src/refractor/visitors/json-schema/RequiredVisitor.mjs +12 -0
  79. package/src/refractor/visitors/json-schema/TypeVisitor.cjs +22 -0
  80. package/src/refractor/visitors/json-schema/TypeVisitor.mjs +17 -0
  81. package/src/refractor/visitors/json-schema/index.cjs +64 -0
  82. package/src/refractor/visitors/json-schema/index.mjs +58 -0
  83. package/src/refractor/visitors/json-schema/json-reference/$RefVisitor.cjs +17 -0
  84. package/src/refractor/visitors/json-schema/json-reference/$RefVisitor.mjs +12 -0
  85. package/src/refractor/visitors/json-schema/json-reference/index.cjs +35 -0
  86. package/src/refractor/visitors/json-schema/json-reference/index.mjs +29 -0
  87. package/src/refractor/visitors/json-schema/link-description/index.cjs +25 -0
  88. package/src/refractor/visitors/json-schema/link-description/index.mjs +19 -0
  89. package/src/refractor/visitors/json-schema/media/index.cjs +25 -0
  90. package/src/refractor/visitors/json-schema/media/index.mjs +19 -0
  91. package/src/traversal/visitor.cjs +26 -0
  92. package/src/traversal/visitor.mjs +22 -0
  93. package/types/apidom-ns-json-schema-draft-4.d.ts +905 -0
@@ -0,0 +1,905 @@
1
+ import { ArrayElement } from '@speclynx/apidom-core';
2
+ import { Attributes } from '@speclynx/apidom-core';
3
+ import { BooleanElement } from '@speclynx/apidom-core';
4
+ import { Class } from 'ts-mixer/dist/types/types.js';
5
+ import { Element as Element_2 } from '@speclynx/apidom-core';
6
+ import { ElementPredicate } from '@speclynx/apidom-core';
7
+ import { isArrayElement } from '@speclynx/apidom-core';
8
+ import { isBooleanElement } from '@speclynx/apidom-core';
9
+ import { isElement } from '@speclynx/apidom-core';
10
+ import { isLinkElement } from '@speclynx/apidom-core';
11
+ import { isMemberElement } from '@speclynx/apidom-core';
12
+ import { isNullElement } from '@speclynx/apidom-core';
13
+ import { isNumberElement } from '@speclynx/apidom-core';
14
+ import { isObjectElement } from '@speclynx/apidom-core';
15
+ import { isRefElement } from '@speclynx/apidom-core';
16
+ import { isStringElement } from '@speclynx/apidom-core';
17
+ import { MediaTypes } from '@speclynx/apidom-core';
18
+ import { Meta } from '@speclynx/apidom-core';
19
+ import { Namespace } from 'minim';
20
+ import { NamespacePluginOptions } from '@speclynx/apidom-core';
21
+ import { NumberElement } from '@speclynx/apidom-core';
22
+ import { ObjectElement } from '@speclynx/apidom-core';
23
+ import { StringElement } from '@speclynx/apidom-core';
24
+
25
+ /**
26
+ * @public
27
+ */
28
+ export declare class AllOfVisitor extends AllOfVisitor_base {
29
+ readonly element: ArrayElement;
30
+ constructor(options: AllOfVisitorOptions);
31
+ ArrayElement(arrayElement: ArrayElement): {};
32
+ }
33
+
34
+ declare const AllOfVisitor_base: Class<any[], SpecificationVisitor & ParentSchemaAwareVisitor & FallbackVisitor, typeof SpecificationVisitor & typeof ParentSchemaAwareVisitor & typeof FallbackVisitor>;
35
+
36
+ /**
37
+ * @public
38
+ */
39
+ export declare interface AllOfVisitorOptions extends SpecificationVisitorOptions, ParentSchemaAwareVisitorOptions, VisitorOptions {
40
+ }
41
+
42
+ /**
43
+ * @public
44
+ */
45
+ export declare class AlternatingVisitor extends SpecificationVisitor {
46
+ protected alternator: Alternator[];
47
+ constructor({ alternator, ...rest }: AlternatingVisitorOptions);
48
+ enter(element: Element_2): {};
49
+ }
50
+
51
+ /**
52
+ * @public
53
+ */
54
+ declare interface AlternatingVisitorOptions extends SpecificationVisitorOptions {
55
+ readonly alternator: Alternator[];
56
+ }
57
+ export { AlternatingVisitorOptions }
58
+ export { AlternatingVisitorOptions as SchemaOrReferenceVisitorOptions }
59
+
60
+ /**
61
+ * @public
62
+ */
63
+ export declare type Alternator = {
64
+ predicate: (element: unknown) => boolean;
65
+ specPath: string[];
66
+ };
67
+
68
+ /**
69
+ * @public
70
+ */
71
+ export declare class AnyOfVisitor extends AnyOfVisitor_base {
72
+ readonly element: ArrayElement;
73
+ constructor(options: AnyOfVisitorOptions);
74
+ ArrayElement(arrayElement: ArrayElement): {};
75
+ }
76
+
77
+ declare const AnyOfVisitor_base: Class<any[], SpecificationVisitor & ParentSchemaAwareVisitor & FallbackVisitor, typeof SpecificationVisitor & typeof ParentSchemaAwareVisitor & typeof FallbackVisitor>;
78
+
79
+ /**
80
+ * @public
81
+ */
82
+ export declare interface AnyOfVisitorOptions extends SpecificationVisitorOptions, ParentSchemaAwareVisitorOptions, VisitorOptions {
83
+ }
84
+
85
+ /**
86
+ * @public
87
+ */
88
+ export declare const createRefractor: (specPath: string[]) => (value: unknown, options?: {}) => Element_2;
89
+
90
+ /**
91
+ * @public
92
+ */
93
+ export declare class DefinitionsVisitor extends DefinitionsVisitor_base {
94
+ readonly element: ObjectElement;
95
+ protected readonly specPath: SpecPath<[
96
+ 'document',
97
+ 'objects',
98
+ 'JSONReference'
99
+ ] | ['document', 'objects', 'JSONSchema']>;
100
+ constructor(options: DefinitionsVisitorOptions);
101
+ }
102
+
103
+ declare const DefinitionsVisitor_base: Class<any[], MapVisitor & ParentSchemaAwareVisitor & FallbackVisitor, typeof MapVisitor & typeof ParentSchemaAwareVisitor & typeof FallbackVisitor>;
104
+
105
+ /**
106
+ * @public
107
+ */
108
+ export declare interface DefinitionsVisitorOptions extends MapVisitorOptions, ParentSchemaAwareVisitorOptions, VisitorOptions {
109
+ }
110
+
111
+ /**
112
+ * @public
113
+ */
114
+ export declare class DependenciesVisitor extends DependenciesVisitor_base {
115
+ readonly element: ObjectElement;
116
+ protected readonly specPath: SpecPath<[
117
+ 'document',
118
+ 'objects',
119
+ 'JSONReference'
120
+ ] | ['document', 'objects', 'JSONSchema']>;
121
+ constructor(options: DependenciesVisitorOptions);
122
+ }
123
+
124
+ declare const DependenciesVisitor_base: Class<any[], MapVisitor & ParentSchemaAwareVisitor & FallbackVisitor, typeof MapVisitor & typeof ParentSchemaAwareVisitor & typeof FallbackVisitor>;
125
+
126
+ /**
127
+ * @public
128
+ */
129
+ export declare interface DependenciesVisitorOptions extends MapVisitorOptions, ParentSchemaAwareVisitorOptions, VisitorOptions {
130
+ }
131
+
132
+ /**
133
+ * @public
134
+ */
135
+ export declare class EnumVisitor extends FallbackVisitor {
136
+ readonly element: ArrayElement;
137
+ ArrayElement(arrayElement: ArrayElement): {};
138
+ }
139
+
140
+ /**
141
+ * @public
142
+ */
143
+ export declare class FallbackVisitor extends Visitor {
144
+ enter(element: Element_2): {};
145
+ }
146
+
147
+ /**
148
+ * @public
149
+ */
150
+ export declare class FixedFieldsVisitor extends SpecificationVisitor {
151
+ protected specPath: SpecPath;
152
+ protected ignoredFields: string[];
153
+ constructor({ specPath, ignoredFields, ...rest }: FixedFieldsVisitorOptions);
154
+ ObjectElement(objectElement: ObjectElement): {};
155
+ }
156
+
157
+ /**
158
+ * @public
159
+ */
160
+ export declare interface FixedFieldsVisitorOptions extends SpecificationVisitorOptions {
161
+ readonly specPath: SpecPath;
162
+ readonly ignoredFields?: string[];
163
+ }
164
+
165
+ /**
166
+ * @public
167
+ */
168
+ export declare type Format = 'generic' | 'json' | 'yaml';
169
+
170
+ /**
171
+ * @public
172
+ */
173
+ export declare const getNodeType: <T extends Element_2>(element: T) => string | undefined;
174
+
175
+ export { isArrayElement }
176
+
177
+ export { isBooleanElement }
178
+
179
+ export { isElement }
180
+
181
+ /**
182
+ * @public
183
+ */
184
+ export declare const isJSONReferenceElement: ElementPredicate<JSONReferenceElement>;
185
+
186
+ /**
187
+ * @public
188
+ */
189
+ export declare const isJSONReferenceLikeElement: (element: unknown) => element is JSONReferenceLikeElement;
190
+
191
+ /**
192
+ * @public
193
+ */
194
+ export declare const isJSONSchemaElement: ElementPredicate<JSONSchemaElement>;
195
+
196
+ /**
197
+ * @public
198
+ */
199
+ export declare const isLinkDescriptionElement: ElementPredicate<LinkDescriptionElement>;
200
+
201
+ export { isLinkElement }
202
+
203
+ /**
204
+ * @public
205
+ */
206
+ export declare const isMediaElement: ElementPredicate<MediaElement>;
207
+
208
+ export { isMemberElement }
209
+
210
+ export { isNullElement }
211
+
212
+ export { isNumberElement }
213
+
214
+ export { isObjectElement }
215
+
216
+ export { isRefElement }
217
+
218
+ export { isStringElement }
219
+
220
+ /**
221
+ * @public
222
+ */
223
+ export declare class ItemsVisitor extends ItemsVisitor_base {
224
+ element: ArrayElement | ObjectElement;
225
+ ObjectElement(objectElement: ObjectElement): {};
226
+ ArrayElement(arrayElement: ArrayElement): {};
227
+ }
228
+
229
+ declare const ItemsVisitor_base: Class<any[], SpecificationVisitor & ParentSchemaAwareVisitor & FallbackVisitor, typeof SpecificationVisitor & typeof ParentSchemaAwareVisitor & typeof FallbackVisitor>;
230
+
231
+ /**
232
+ * @public
233
+ */
234
+ export declare interface ItemsVisitorOptions extends SpecificationVisitorOptions, ParentSchemaAwareVisitorOptions, VisitorOptions {
235
+ }
236
+
237
+ /**
238
+ * @public
239
+ */
240
+ export declare class JSONReference$RefVisitor extends FallbackVisitor {
241
+ readonly element: StringElement;
242
+ StringElement(stringElement: StringElement): {};
243
+ }
244
+
245
+ /**
246
+ * In Draft 4, $ref behaves a little differently. When an object contains a $ref property,
247
+ * the object is considered a reference, not a schema. Therefore, any other properties you put in that object will
248
+ * not be treated as JSON Schema keywords and will be ignored by the validator.
249
+ * $ref can only be used where a schema is expected.
250
+ *
251
+ * URI: https://json-schema.org/understanding-json-schema/structuring.html?highlight=ref#id18
252
+ * @public
253
+ */
254
+ export declare class JSONReferenceElement extends ObjectElement {
255
+ constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes);
256
+ get $ref(): StringElement | undefined;
257
+ set $ref($ref: StringElement | undefined);
258
+ }
259
+
260
+ /**
261
+ * @public
262
+ */
263
+ export declare interface JSONReferenceLikeElement extends ObjectElement {
264
+ hasKey: (value: '$ref') => true;
265
+ }
266
+
267
+ /**
268
+ * @public
269
+ */
270
+ export declare class JSONReferenceVisitor extends JSONReferenceVisitor_base {
271
+ readonly element: JSONReferenceElement;
272
+ protected readonly specPath: SpecPath<['document', 'objects', 'JSONReference']>;
273
+ constructor(options: JSONReferenceVisitorOptions);
274
+ ObjectElement(objectElement: ObjectElement): {};
275
+ }
276
+
277
+ declare const JSONReferenceVisitor_base: Class<any[], FixedFieldsVisitor & FallbackVisitor, typeof FixedFieldsVisitor & typeof FallbackVisitor>;
278
+
279
+ /**
280
+ * @public
281
+ */
282
+ export declare interface JSONReferenceVisitorOptions extends FixedFieldsVisitorOptions, VisitorOptions {
283
+ }
284
+
285
+ /**
286
+ * @public
287
+ */
288
+ declare const jsonSchemaDraft4: {
289
+ namespace: (options: NamespacePluginOptions) => Namespace;
290
+ };
291
+ export default jsonSchemaDraft4;
292
+
293
+ /**
294
+ * @public
295
+ */
296
+ export declare class JSONSchemaDraft4MediaTypes extends MediaTypes<string> {
297
+ filterByFormat(format?: Format): string[];
298
+ findBy(version?: string, format?: Format): string;
299
+ latest(format?: Format): string;
300
+ }
301
+
302
+ /**
303
+ * @public
304
+ */
305
+ export declare class JSONSchemaElement extends ObjectElement {
306
+ constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes);
307
+ /**
308
+ * Core vocabulary
309
+ *
310
+ * URI: https://tools.ietf.org/html/draft-wright-json-schema-00
311
+ */
312
+ get idProp(): StringElement | undefined;
313
+ set idProp(idProp: StringElement | undefined);
314
+ get $schema(): StringElement | undefined;
315
+ set $schema($schema: StringElement | undefined);
316
+ /**
317
+ * Validation vocabulary
318
+ *
319
+ * URI: https://tools.ietf.org/html/draft-wright-json-schema-validation-00
320
+ */
321
+ /**
322
+ * Validation keywords for numeric instances (number and integer)
323
+ */
324
+ get multipleOf(): NumberElement | undefined;
325
+ set multipleOf(multipleOf: NumberElement | undefined);
326
+ get maximum(): NumberElement | undefined;
327
+ set maximum(maximum: NumberElement | undefined);
328
+ get exclusiveMaximum(): BooleanElement | undefined;
329
+ set exclusiveMaximum(exclusiveMaximum: BooleanElement | undefined);
330
+ get minimum(): NumberElement | undefined;
331
+ set minimum(minimum: NumberElement | undefined);
332
+ get exclusiveMinimum(): BooleanElement | undefined;
333
+ set exclusiveMinimum(exclusiveMinimum: BooleanElement | undefined);
334
+ /**
335
+ * Validation keywords for strings
336
+ */
337
+ get maxLength(): NumberElement | undefined;
338
+ set maxLength(maxLength: NumberElement | undefined);
339
+ get minLength(): NumberElement | undefined;
340
+ set minLength(minLength: NumberElement | undefined);
341
+ get pattern(): StringElement | undefined;
342
+ set pattern(pattern: StringElement | undefined);
343
+ /**
344
+ * Validation keywords for arrays
345
+ */
346
+ get additionalItems(): this | JSONReferenceElement | BooleanElement | undefined;
347
+ set additionalItems(additionalItems: this | JSONReferenceElement | BooleanElement | undefined);
348
+ get items(): this | JSONReferenceElement | ArrayElement | undefined;
349
+ set items(items: this | JSONReferenceElement | ArrayElement | undefined);
350
+ get maxItems(): NumberElement | undefined;
351
+ set maxItems(maxItems: NumberElement | undefined);
352
+ get minItems(): NumberElement | undefined;
353
+ set minItems(minItems: NumberElement | undefined);
354
+ get uniqueItems(): BooleanElement | undefined;
355
+ set uniqueItems(uniqueItems: BooleanElement | undefined);
356
+ /**
357
+ * Validation keywords for objects
358
+ */
359
+ get maxProperties(): NumberElement | undefined;
360
+ set maxProperties(maxProperties: NumberElement | undefined);
361
+ get minProperties(): NumberElement | undefined;
362
+ set minProperties(minProperties: NumberElement | undefined);
363
+ get required(): ArrayElement | undefined;
364
+ set required(required: ArrayElement | undefined);
365
+ get properties(): ObjectElement | undefined;
366
+ set properties(properties: ObjectElement | undefined);
367
+ get additionalProperties(): this | JSONReferenceElement | BooleanElement | undefined;
368
+ set additionalProperties(additionalProperties: this | JSONReferenceElement | BooleanElement | undefined);
369
+ get patternProperties(): ObjectElement | undefined;
370
+ set patternProperties(patternProperties: ObjectElement | undefined);
371
+ get dependencies(): ObjectElement | undefined;
372
+ set dependencies(dependencies: ObjectElement | undefined);
373
+ /**
374
+ * Validation keywords for any instance type
375
+ */
376
+ get enum(): ArrayElement | undefined;
377
+ set enum(enumValue: ArrayElement | undefined);
378
+ get type(): ArrayElement | StringElement | undefined;
379
+ set type(type: ArrayElement | StringElement | undefined);
380
+ get allOf(): ArrayElement | undefined;
381
+ set allOf(allOf: ArrayElement | undefined);
382
+ get anyOf(): ArrayElement | undefined;
383
+ set anyOf(anyOf: ArrayElement | undefined);
384
+ get oneOf(): ArrayElement | undefined;
385
+ set oneOf(oneOf: ArrayElement | undefined);
386
+ get not(): this | JSONReferenceElement | undefined;
387
+ set not(not: this | JSONReferenceElement | undefined);
388
+ get definitions(): ObjectElement | undefined;
389
+ set definitions(definitions: ObjectElement | undefined);
390
+ /**
391
+ * Metadata keywords
392
+ *
393
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-6
394
+ */
395
+ get title(): StringElement | undefined;
396
+ set title(title: StringElement | undefined);
397
+ get description(): StringElement | undefined;
398
+ set description(description: StringElement | undefined);
399
+ get default(): Element_2 | undefined;
400
+ set default(defaultValue: Element_2 | undefined);
401
+ /**
402
+ * Semantic validation with "format"
403
+ *
404
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-7
405
+ */
406
+ get format(): StringElement | undefined;
407
+ set format(format: StringElement | undefined);
408
+ /**
409
+ * JSON Hyper-Schema
410
+ *
411
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-00
412
+ */
413
+ get base(): StringElement | undefined;
414
+ set base(base: StringElement | undefined);
415
+ get links(): ArrayElement | undefined;
416
+ set links(links: ArrayElement | undefined);
417
+ get media(): MediaElement | undefined;
418
+ set media(media: MediaElement | undefined);
419
+ get readOnly(): BooleanElement | undefined;
420
+ set readOnly(readOnly: BooleanElement | undefined);
421
+ }
422
+
423
+ /**
424
+ * @public
425
+ */
426
+ export declare class JSONSchemaVisitor extends JSONSchemaVisitor_base {
427
+ element: JSONSchemaElement;
428
+ protected readonly specPath: SpecPath<['document', 'objects', 'JSONSchema']>;
429
+ constructor(options: JSONSchemaVisitorOptions);
430
+ get defaultDialectIdentifier(): string;
431
+ ObjectElement(objectElement: ObjectElement): {};
432
+ handleDialectIdentifier(objectElement: ObjectElement): void;
433
+ handleSchemaIdentifier(objectElement: ObjectElement, identifierKeyword?: string): void;
434
+ }
435
+
436
+ declare const JSONSchemaVisitor_base: Class<any[], FixedFieldsVisitor & ParentSchemaAwareVisitor & FallbackVisitor, typeof FixedFieldsVisitor & typeof ParentSchemaAwareVisitor & typeof FallbackVisitor>;
437
+
438
+ /**
439
+ * @public
440
+ */
441
+ export declare interface JSONSchemaVisitorOptions extends FixedFieldsVisitorOptions, ParentSchemaAwareVisitorOptions, VisitorOptions {
442
+ }
443
+
444
+ /**
445
+ * @public
446
+ */
447
+ export declare const keyMap: {
448
+ ObjectElement: string[];
449
+ ArrayElement: string[];
450
+ MemberElement: string[];
451
+ StringElement: never[];
452
+ BooleanElement: never[];
453
+ NumberElement: never[];
454
+ NullElement: never[];
455
+ RefElement: never[];
456
+ LinkElement: never[];
457
+ Annotation: never[];
458
+ Comment: never[];
459
+ ParseResultElement: string[];
460
+ SourceMap: string[];
461
+ JSONSchemaDraft4Element: string[];
462
+ JSONReferenceElement: string[];
463
+ MediaElement: string[];
464
+ LinkDescriptionElement: string[];
465
+ };
466
+
467
+ /**
468
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-00#section-5
469
+ * @public
470
+ */
471
+ export declare class LinkDescriptionElement extends ObjectElement {
472
+ constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes);
473
+ get href(): StringElement | undefined;
474
+ set href(href: StringElement | undefined);
475
+ get rel(): StringElement | undefined;
476
+ set rel(rel: StringElement | undefined);
477
+ get title(): StringElement | undefined;
478
+ set title(title: StringElement | undefined);
479
+ get targetSchema(): JSONSchemaElement | JSONReferenceElement | undefined;
480
+ set targetSchema(targetSchema: JSONSchemaElement | JSONReferenceElement | undefined);
481
+ get mediaType(): StringElement | undefined;
482
+ set mediaType(mediaType: StringElement | undefined);
483
+ get method(): StringElement | undefined;
484
+ set method(method: StringElement | undefined);
485
+ get encType(): StringElement | undefined;
486
+ set encType(encType: StringElement | undefined);
487
+ get schema(): JSONSchemaElement | JSONReferenceElement | undefined;
488
+ set schema(schema: JSONSchemaElement | JSONReferenceElement | undefined);
489
+ }
490
+
491
+ /**
492
+ * @public
493
+ */
494
+ export declare class LinkDescriptionVisitor extends LinkDescriptionVisitor_base {
495
+ readonly element: LinkDescriptionElement;
496
+ protected readonly specPath: SpecPath<['document', 'objects', 'LinkDescription']>;
497
+ constructor(options: LinkDescriptionVisitorOptions);
498
+ }
499
+
500
+ declare const LinkDescriptionVisitor_base: Class<any[], FixedFieldsVisitor & FallbackVisitor, typeof FixedFieldsVisitor & typeof FallbackVisitor>;
501
+
502
+ /**
503
+ * @public
504
+ */
505
+ export declare interface LinkDescriptionVisitorOptions extends FixedFieldsVisitorOptions, VisitorOptions {
506
+ }
507
+
508
+ /**
509
+ * @public
510
+ */
511
+ export declare class LinksVisitor extends LinksVisitor_base {
512
+ readonly element: ArrayElement;
513
+ constructor(options: LinksVisitorOptions);
514
+ ArrayElement(arrayElement: ArrayElement): {};
515
+ }
516
+
517
+ declare const LinksVisitor_base: Class<any[], SpecificationVisitor & ParentSchemaAwareVisitor & FallbackVisitor, typeof SpecificationVisitor & typeof ParentSchemaAwareVisitor & typeof FallbackVisitor>;
518
+
519
+ /**
520
+ * @public
521
+ */
522
+ export declare interface LinksVisitorOptions extends SpecificationVisitorOptions, ParentSchemaAwareVisitorOptions, VisitorOptions {
523
+ }
524
+
525
+ /**
526
+ * @public
527
+ */
528
+ export declare class MapVisitor extends PatternedFieldsVisitor {
529
+ constructor(options: MapVisitorOptions);
530
+ }
531
+
532
+ /**
533
+ * @public
534
+ */
535
+ export declare interface MapVisitorOptions extends PatternedFieldsVisitorOptions {
536
+ }
537
+
538
+ /**
539
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-00#section-4.3
540
+ * @public
541
+ */
542
+ export declare class MediaElement extends ObjectElement {
543
+ constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes);
544
+ get binaryEncoding(): StringElement | undefined;
545
+ set binaryEncoding(binaryEncoding: StringElement | undefined);
546
+ get type(): StringElement | undefined;
547
+ set type(type: StringElement | undefined);
548
+ }
549
+
550
+ /**
551
+ * @public
552
+ */
553
+ export declare const mediaTypes: JSONSchemaDraft4MediaTypes;
554
+
555
+ /**
556
+ * @public
557
+ */
558
+ export declare class MediaVisitor extends MediaVisitor_base {
559
+ readonly element: MediaElement;
560
+ protected readonly specPath: SpecPath<['document', 'objects', 'Media']>;
561
+ constructor(options: MediaVisitorOptions);
562
+ }
563
+
564
+ declare const MediaVisitor_base: Class<any[], FixedFieldsVisitor & FallbackVisitor, typeof FixedFieldsVisitor & typeof FallbackVisitor>;
565
+
566
+ /**
567
+ * @public
568
+ */
569
+ export declare interface MediaVisitorOptions extends FixedFieldsVisitorOptions, VisitorOptions {
570
+ }
571
+
572
+ /**
573
+ * @public
574
+ */
575
+ export declare class OneOfVisitor extends OneOfVisitor_base {
576
+ readonly element: ArrayElement;
577
+ constructor(options: OneOfVisitorOptions);
578
+ ArrayElement(arrayElement: ArrayElement): {};
579
+ }
580
+
581
+ declare const OneOfVisitor_base: Class<any[], SpecificationVisitor & ParentSchemaAwareVisitor & FallbackVisitor, typeof SpecificationVisitor & typeof ParentSchemaAwareVisitor & typeof FallbackVisitor>;
582
+
583
+ /**
584
+ * @public
585
+ */
586
+ export declare interface OneOfVisitorOptions extends SpecificationVisitorOptions, ParentSchemaAwareVisitorOptions, VisitorOptions {
587
+ }
588
+
589
+ /**
590
+ * @public
591
+ */
592
+ export declare class ParentSchemaAwareVisitor {
593
+ parent: Element_2;
594
+ constructor({ parent }: ParentSchemaAwareVisitorOptions);
595
+ }
596
+
597
+ /**
598
+ * @public
599
+ */
600
+ export declare interface ParentSchemaAwareVisitorOptions {
601
+ readonly parent: Element_2;
602
+ }
603
+
604
+ /**
605
+ * @public
606
+ */
607
+ export declare class PatternedFieldsVisitor extends SpecificationVisitor {
608
+ protected specPath: SpecPath;
609
+ protected ignoredFields: string[];
610
+ protected fieldPatternPredicate: (value: unknown) => boolean;
611
+ constructor({ specPath, ignoredFields, fieldPatternPredicate, ...rest }: PatternedFieldsVisitorOptions);
612
+ ObjectElement(objectElement: ObjectElement): {};
613
+ }
614
+
615
+ /**
616
+ * @public
617
+ */
618
+ export declare interface PatternedFieldsVisitorOptions extends SpecificationVisitorOptions {
619
+ readonly specPath: SpecPath;
620
+ readonly ignoredFields?: string[];
621
+ readonly fieldPatternPredicate?: (...args: unknown[]) => boolean;
622
+ }
623
+
624
+ /**
625
+ * @public
626
+ */
627
+ export declare class PatternPropertiesVisitor extends PatternPropertiesVisitor_base {
628
+ readonly element: ObjectElement;
629
+ protected readonly specPath: SpecPath<[
630
+ 'document',
631
+ 'objects',
632
+ 'JSONReference'
633
+ ] | ['document', 'objects', 'JSONSchema']>;
634
+ constructor(options: PatternPropertiesVisitorOptions);
635
+ }
636
+
637
+ declare const PatternPropertiesVisitor_base: Class<any[], MapVisitor & ParentSchemaAwareVisitor & FallbackVisitor, typeof MapVisitor & typeof ParentSchemaAwareVisitor & typeof FallbackVisitor>;
638
+
639
+ /**
640
+ * @public
641
+ */
642
+ export declare interface PatternPropertiesVisitorOptions extends MapVisitorOptions, ParentSchemaAwareVisitorOptions, VisitorOptions {
643
+ }
644
+
645
+ /**
646
+ * @public
647
+ */
648
+ export declare class PropertiesVisitor extends PropertiesVisitor_base {
649
+ readonly element: ObjectElement;
650
+ protected readonly specPath: SpecPath<[
651
+ 'document',
652
+ 'objects',
653
+ 'JSONReference'
654
+ ] | ['document', 'objects', 'JSONSchema']>;
655
+ constructor(options: PropertiesVisitorOptions);
656
+ }
657
+
658
+ declare const PropertiesVisitor_base: Class<any[], MapVisitor & ParentSchemaAwareVisitor & FallbackVisitor, typeof MapVisitor & typeof ParentSchemaAwareVisitor & typeof FallbackVisitor>;
659
+
660
+ /**
661
+ * @public
662
+ */
663
+ export declare interface PropertiesVisitorOptions extends MapVisitorOptions, ParentSchemaAwareVisitorOptions, VisitorOptions {
664
+ }
665
+
666
+ /**
667
+ * @public
668
+ */
669
+ export declare const refract: <T extends Element_2>(value: unknown, { specPath, plugins, specificationObj, }?: {
670
+ specPath?: string[];
671
+ plugins?: any[];
672
+ specificationObj?: object;
673
+ }) => T;
674
+
675
+ /**
676
+ * @public
677
+ */
678
+ export declare const refractorPluginReplaceEmptyElement: () => () => {
679
+ visitor: {
680
+ StringElement(element: StringElement, key: any, parent: any, path: any, ancestors: any[]): any;
681
+ };
682
+ };
683
+
684
+ /**
685
+ * @public
686
+ */
687
+ export declare class RequiredVisitor extends FallbackVisitor {
688
+ readonly element: ArrayElement;
689
+ ArrayElement(arrayElement: ArrayElement): {};
690
+ }
691
+
692
+ /**
693
+ * @public
694
+ */
695
+ export declare class SchemaOrReferenceVisitor extends AlternatingVisitor {
696
+ constructor(options: AlternatingVisitorOptions);
697
+ }
698
+
699
+ /**
700
+ * Specification object allows us to have complete control over visitors
701
+ * when traversing the ApiDOM.
702
+ * Specification also allows us to create amended refractors from
703
+ * existing ones by manipulating it.
704
+ *
705
+ * Note: Specification object allows to use absolute internal JSON pointers.
706
+ * @public
707
+ */
708
+ export declare const specificationObj: {
709
+ visitors: {
710
+ value: typeof FallbackVisitor;
711
+ JSONSchemaOrJSONReferenceVisitor: typeof SchemaOrReferenceVisitor;
712
+ document: {
713
+ objects: {
714
+ JSONSchema: {
715
+ $visitor: typeof JSONSchemaVisitor;
716
+ fixedFields: {
717
+ id: {
718
+ $ref: string;
719
+ };
720
+ $schema: {
721
+ $ref: string;
722
+ };
723
+ multipleOf: {
724
+ $ref: string;
725
+ };
726
+ maximum: {
727
+ $ref: string;
728
+ };
729
+ exclusiveMaximum: {
730
+ $ref: string;
731
+ };
732
+ minimum: {
733
+ $ref: string;
734
+ };
735
+ exclusiveMinimum: {
736
+ $ref: string;
737
+ };
738
+ maxLength: {
739
+ $ref: string;
740
+ };
741
+ minLength: {
742
+ $ref: string;
743
+ };
744
+ pattern: {
745
+ $ref: string;
746
+ };
747
+ additionalItems: typeof SchemaOrReferenceVisitor;
748
+ items: typeof ItemsVisitor;
749
+ maxItems: {
750
+ $ref: string;
751
+ };
752
+ minItems: {
753
+ $ref: string;
754
+ };
755
+ uniqueItems: {
756
+ $ref: string;
757
+ };
758
+ maxProperties: {
759
+ $ref: string;
760
+ };
761
+ minProperties: {
762
+ $ref: string;
763
+ };
764
+ required: typeof RequiredVisitor;
765
+ properties: typeof PropertiesVisitor;
766
+ additionalProperties: typeof SchemaOrReferenceVisitor;
767
+ patternProperties: typeof PatternPropertiesVisitor;
768
+ dependencies: typeof DependenciesVisitor;
769
+ enum: typeof EnumVisitor;
770
+ type: typeof TypeVisitor;
771
+ allOf: typeof AllOfVisitor;
772
+ anyOf: typeof AnyOfVisitor;
773
+ oneOf: typeof OneOfVisitor;
774
+ not: typeof SchemaOrReferenceVisitor;
775
+ definitions: typeof DefinitionsVisitor;
776
+ title: {
777
+ $ref: string;
778
+ };
779
+ description: {
780
+ $ref: string;
781
+ };
782
+ default: {
783
+ $ref: string;
784
+ };
785
+ format: {
786
+ $ref: string;
787
+ };
788
+ base: {
789
+ $ref: string;
790
+ };
791
+ links: typeof LinksVisitor;
792
+ media: {
793
+ $ref: string;
794
+ };
795
+ readOnly: {
796
+ $ref: string;
797
+ };
798
+ };
799
+ };
800
+ JSONReference: {
801
+ $visitor: typeof JSONReferenceVisitor;
802
+ fixedFields: {
803
+ $ref: typeof JSONReference$RefVisitor;
804
+ };
805
+ };
806
+ Media: {
807
+ $visitor: typeof MediaVisitor;
808
+ fixedFields: {
809
+ binaryEncoding: {
810
+ $ref: string;
811
+ };
812
+ type: {
813
+ $ref: string;
814
+ };
815
+ };
816
+ };
817
+ LinkDescription: {
818
+ $visitor: typeof LinkDescriptionVisitor;
819
+ fixedFields: {
820
+ href: {
821
+ $ref: string;
822
+ };
823
+ rel: {
824
+ $ref: string;
825
+ };
826
+ title: {
827
+ $ref: string;
828
+ };
829
+ targetSchema: typeof SchemaOrReferenceVisitor;
830
+ mediaType: {
831
+ $ref: string;
832
+ };
833
+ method: {
834
+ $ref: string;
835
+ };
836
+ encType: {
837
+ $ref: string;
838
+ };
839
+ schema: typeof SchemaOrReferenceVisitor;
840
+ };
841
+ };
842
+ };
843
+ };
844
+ };
845
+ };
846
+
847
+ /**
848
+ * @public
849
+ */
850
+ export declare class SpecificationVisitor extends Visitor {
851
+ protected readonly specObj: typeof specificationObj;
852
+ protected readonly passingOptionsNames: string[];
853
+ constructor({ specObj, ...rest }: SpecificationVisitorOptions);
854
+ retrievePassingOptions(): string[];
855
+ retrieveFixedFields(specPath: string[]): string[];
856
+ retrieveVisitor(specPath: string[]): unknown;
857
+ retrieveVisitorInstance(specPath: string[], options?: {}): Visitor;
858
+ toRefractedElement(specPath: string[], element: any, options?: {}): any;
859
+ }
860
+
861
+ /**
862
+ * This is a base Type for every visitor that does
863
+ * internal look-ups to retrieve other child visitors.
864
+ * @public
865
+ */
866
+ export declare interface SpecificationVisitorOptions extends VisitorOptions {
867
+ readonly specObj: typeof specificationObj;
868
+ }
869
+
870
+ /**
871
+ * @public
872
+ */
873
+ export declare type SpecPath<T = string[]> = (element: unknown) => T;
874
+
875
+ /**
876
+ * @public
877
+ */
878
+ export declare class TypeVisitor extends FallbackVisitor {
879
+ readonly element: StringElement | ArrayElement;
880
+ StringElement(stringElement: StringElement): {};
881
+ ArrayElement(arrayElement: ArrayElement): {};
882
+ }
883
+
884
+ /**
885
+ * @public
886
+ */
887
+ export declare class Visitor {
888
+ element: Element_2;
889
+ constructor(options: VisitorOptions);
890
+ copyMetaAndAttributes(from: Element_2, to: Element_2): void;
891
+ }
892
+
893
+ /**
894
+ * @public
895
+ */
896
+ declare interface VisitorOptions {
897
+ }
898
+ export { VisitorOptions as EnumVisitorOptions }
899
+ export { VisitorOptions as FallbackVisitorOptions }
900
+ export { VisitorOptions as JSONReference$RefVisitorOptions }
901
+ export { VisitorOptions as RequiredVisitorOptions }
902
+ export { VisitorOptions as TypeVisitorOptions }
903
+ export { VisitorOptions }
904
+
905
+ export { }