@orpc/interop 0.0.0-next.d31094d

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.
@@ -0,0 +1,1240 @@
1
+ declare const draft: "2020-12";
2
+ declare const $schema: "https://json-schema.org/draft/2020-12/schema";
3
+ type MaybeReadonlyArray<T> = Array<T> | ReadonlyArray<T>;
4
+ type ValueOf<T> = T[keyof T];
5
+ /**
6
+ * JSON Schema [Draft 2020-12](https://json-schema.org/draft/2020-12/json-schema-validation.html)
7
+ */
8
+ type JSONSchema<Value = any, SchemaType = Value extends boolean ? "boolean" : Value extends null ? "null" : Value extends number ? "number" | "integer" : Value extends string ? "string" : Value extends unknown[] ? "array" : Value extends Record<string | number, unknown> ? "object" : JSONSchema.TypeValue> = boolean | {
9
+ /**
10
+ * Using JSON Pointer fragments requires knowledge of the structure of the
11
+ * schema. When writing schema documents with the intention to provide
12
+ * re-usable schemas, it may be preferable to use a plain name fragment
13
+ * that is not tied to any particular structural location. This allows a
14
+ * subschema to be relocated without requiring JSON Pointer references to
15
+ * be updated.
16
+ *
17
+ * The `$anchor` keyword is used to specify such a fragment. It is an
18
+ * identifier keyword that can only be used to create plain name fragments.
19
+ *
20
+ * If present, the value of this keyword MUST be a string, which MUST start
21
+ * with a letter `[A-Za-z]`, followed by any number of letters, digits
22
+ * `[0-9]`, hyphens `-`, underscores `_`, colons `:`,
23
+ * or periods `.`.
24
+ *
25
+ * Note that the anchor string does not include the `#` character,
26
+ * as it is not a URI-reference. An `{"$anchor": "foo"}` becomes the
27
+ * fragment `#foo` when used in a URI.
28
+ *
29
+ * The base URI to which the resulting fragment is appended is determined
30
+ * by the `$id` keyword as explained in the previous section.
31
+ * Two `$anchor` keywords in the same schema document MAY have the same
32
+ * value if they apply to different base URIs, as the resulting full URIs
33
+ * will be distinct. However, the effect of two `$anchor` keywords
34
+ * with the same value and the same base URI is undefined. Implementations
35
+ * MAY raise an error if such usage is detected.
36
+ */
37
+ $anchor?: string;
38
+ /**
39
+ * This keyword reserves a location for comments from schema authors to
40
+ * readers or maintainers of the schema.
41
+ *
42
+ * The value of this keyword MUST be a string. Implementations MUST NOT
43
+ * present this string to end users. Tools for editing schemas SHOULD
44
+ * support displaying and editing this keyword. The value of this keyword
45
+ * MAY be used in debug or error output which is intended for developers
46
+ * making use of schemas.
47
+ *
48
+ * Schema vocabularies SHOULD allow `$comment` within any object
49
+ * containing vocabulary keywords. Implementations MAY assume `$comment`
50
+ * is allowed unless the vocabulary specifically forbids it. Vocabularies
51
+ * MUST NOT specify any effect of `$comment` beyond what is described in
52
+ * this specification.
53
+ *
54
+ * Tools that translate other media types or programming languages
55
+ * to and from `application/schema+json` MAY choose to convert that media
56
+ * type or programming language's native comments to or from `$comment`
57
+ * values. The behavior of such translation when both native comments and
58
+ * `$comment` properties are present is implementation-dependent.
59
+ *
60
+ * Implementations MAY strip `$comment` values at any point during
61
+ * processing. In particular, this allows for shortening schemas when the
62
+ * size of deployed schemas is a concern.
63
+ *
64
+ * Implementations MUST NOT take any other action based on the presence,
65
+ * absence, or contents of `$comment` properties. In particular, the
66
+ * value of `$comment` MUST NOT be collected as an annotation result.
67
+ */
68
+ $comment?: string;
69
+ /**
70
+ * The `$defs` keyword reserves a location for schema authors to inline
71
+ * re-usable JSON Schemas into a more general schema. The keyword does not
72
+ * directly affect the validation result.
73
+ *
74
+ * This keyword's value MUST be an object. Each member value of this object
75
+ * MUST be a valid JSON Schema.
76
+ */
77
+ $defs?: Record<string, JSONSchema>;
78
+ /**
79
+ * "The `$dynamicAnchor` indicates that the fragment is an extension
80
+ * point when used with the `$dynamicRef` keyword. This low-level,
81
+ * advanced feature makes it easier to extend recursive schemas such as the
82
+ * meta-schemas, without imposing any particular semantics on that
83
+ * extension. See `$dynamicRef` for more details.
84
+ */
85
+ $dynamicAnchor?: string;
86
+ /**
87
+ * The `$dynamicRef` keyword is an applicator that allows for deferring
88
+ * the full resolution until runtime, at which point it is resolved each
89
+ * time it is encountered while evaluating an instance.
90
+ *
91
+ * Together with `$dynamicAnchor`, `$dynamicRef` implements a
92
+ * cooperative extension mechanism that is primarily useful with recursive
93
+ * schemas (schemas that reference themselves). Both the extension point
94
+ * and the runtime-determined extension target are defined with
95
+ * `$dynamicAnchor`, and only exhibit runtime dynamic behavior when
96
+ * referenced with `$dynamicRef`.
97
+ *
98
+ * The value of the `$dynamicRef` property MUST be a string which is
99
+ * a URI-Reference. Resolved against the current URI base, it produces
100
+ * the URI used as the starting point for runtime resolution. This initial
101
+ * resolution is safe to perform on schema load.
102
+ *
103
+ * If the initially resolved starting point URI includes a fragment that
104
+ * was created by the `$dynamicAnchor` keyword, the initial URI MUST be
105
+ * replaced by the URI (including the fragment) for the outermost schema
106
+ * resource in the [dynamic scope][scopes] that defines
107
+ * an identically named fragment with `$dynamicAnchor`.
108
+ *
109
+ * Otherwise, its behavior is identical to `$ref`, and no runtime
110
+ * resolution is needed.
111
+ *
112
+ * [scopes]: https://json-schema.org/draft/2020-12/json-schema-core.html#scopes
113
+ *
114
+ * @format "uri-reference"
115
+ */
116
+ $dynamicRef?: string;
117
+ /**
118
+ * The `$id` keyword identifies a schema resource with its
119
+ * [canonical][[RFC6596]] URI.
120
+ *
121
+ * Note that this URI is an identifier and not necessarily a network
122
+ * locator. In the case of a network-addressable URL, a schema need not be
123
+ * downloadable from its canonical URI.
124
+ *
125
+ * If present, the value for this keyword MUST be a string, and MUST
126
+ * represent a valid [URI-reference][RFC3986]. This URI-reference SHOULD
127
+ * be normalized, and MUST resolve to an [absolute-URI][RFC3986] (without a
128
+ * fragment). Therefore, `$id` MUST NOT contain a non-empty fragment,
129
+ * and SHOULD NOT contain an empty fragment.
130
+ *
131
+ * Since an empty fragment in the context of the
132
+ * `application/schema+json` media type refers to the same resource as
133
+ * the base URI without a fragment, an implementation MAY normalize a URI
134
+ * ending with an empty fragment by removing the fragment. However, schema
135
+ * authors SHOULD NOT rely on this behavior across implementations.
136
+ *
137
+ * This URI also serves as the base URI for relative URI-references in
138
+ * keywords within the schema resource, in accordance with
139
+ * [RFC 3986][RFC3986] section 5.1.1 regarding base URIs embedded in
140
+ * content.
141
+ *
142
+ * The presence of `$id` in a subschema indicates that the subschema
143
+ * constitutes a distinct schema resource within a single schema document.
144
+ * Furthermore, in accordance with [RFC 3986][RFC3986] section 5.1.2
145
+ * regarding encapsulating entities, if an `$id` in a subschema is a
146
+ * relative URI-reference, the base URI for resolving that reference is the
147
+ * URI of the parent schema resource.
148
+ *
149
+ * If no parent schema object explicitly identifies itself as a resource
150
+ * with `$id`, the base URI is that of the entire document.
151
+ *
152
+ * The root schema of a JSON Schema document SHOULD contain an `$id`
153
+ * keyword with an [absolute-URI][RFC3986] (containing a scheme, but no
154
+ * fragment).
155
+ *
156
+ * [RFC6596]: https://datatracker.ietf.org/doc/html/rfc6596
157
+ * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986
158
+ *
159
+ * @format "uri-reference"
160
+ */
161
+ $id?: string;
162
+ /**
163
+ * The `$ref` keyword is an applicator that is used to reference a
164
+ * statically identified schema. Its results are the results of the
165
+ * referenced schema. Other keywords can appear alongside of `$ref` in
166
+ * the same schema object.
167
+ *
168
+ * The value of the `$ref` property MUST be a string which is a
169
+ * URI-Reference. Resolved against the current URI base, it produces the
170
+ * URI of the schema to apply.
171
+ *
172
+ * @format "uri-reference"
173
+ */
174
+ $ref?: string;
175
+ /**
176
+ * The `$schema` keyword is both used as a JSON Schema dialect identifier
177
+ * and as the identifier of a resource which is itself a JSON Schema, which
178
+ * describes the set of valid schemas written for this particular dialect.
179
+ *
180
+ * The value of this keyword MUST be a [URI][RFC3986] (containing a scheme)
181
+ * and this URI MUST be normalized. The current schema MUST be valid
182
+ * against the meta-schema identified by this URI.
183
+ *
184
+ * If this URI identifies a retrievable resource, that resource SHOULD be
185
+ * of media type `application/schema+json`.
186
+ *
187
+ * The `$schema` keyword SHOULD be used in the document root schema
188
+ * object, and MAY be used in the root schema objects of embedded schema
189
+ * resources. It MUST NOT appear in non-resource root schema objects. If
190
+ * absent from the document root schema, the resulting behavior is
191
+ * implementation-defined.
192
+ *
193
+ * Values for this property are defined elsewhere in this and other
194
+ * documents, and by other parties.
195
+ *
196
+ * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986
197
+ *
198
+ * @format "uri"
199
+ */
200
+ $schema?: string;
201
+ /**
202
+ * The `$vocabulary` keyword is used in meta-schemas to identify the
203
+ * vocabularies available for use in schemas described by that meta-schema.
204
+ * It is also used to indicate whether each vocabulary is required or
205
+ * optional, in the sense that an implementation MUST understand the
206
+ * required vocabularies in order to successfully process the schema.
207
+ * Together, this information forms a dialect. Any vocabulary that is
208
+ * understood by the implementation MUST be processed in a manner
209
+ * consistent with the semantic definitions contained within the
210
+ * vocabulary.
211
+ *
212
+ * The value of this keyword MUST be an object. The property names in the
213
+ * object MUST be URIs (containing a scheme) and this URI MUST be
214
+ * normalized. Each URI that appears as a property name identifies a
215
+ * specific set of keywords and their semantics.
216
+ *
217
+ * The URI MAY be a URL, but the nature of the retrievable resource is
218
+ * currently undefined, and reserved for future use. Vocabulary authors
219
+ * MAY use the URL of the vocabulary specification, in a human-readable
220
+ * media type such as `text/html` or `text/plain`, as the vocabulary
221
+ * URI.
222
+ *
223
+ * The values of the object properties MUST be booleans. If the value is
224
+ * `true`, then implementations that do not recognize the vocabulary MUST
225
+ * refuse to process any schemas that declare this meta-schema with
226
+ * `$schema`. If the value is `false`, implementations that do not
227
+ * recognize the vocabulary SHOULD proceed with processing such schemas.
228
+ * The value has no impact if the implementation understands the
229
+ * vocabulary.
230
+ *
231
+ * Unrecognized keywords SHOULD be ignored. This remains the case for
232
+ * keywords defined by unrecognized vocabularies. It is not currently
233
+ * possible to distinguish between unrecognized keywords that are defined
234
+ * in vocabularies from those that are not part of any vocabulary.
235
+ *
236
+ * The `$vocabulary` keyword SHOULD be used in the root schema of any
237
+ * schema document intended for use as a meta-schema. It MUST NOT appear
238
+ * in subschemas.
239
+ *
240
+ * The `$vocabulary` keyword MUST be ignored in schema documents that are
241
+ * not being processed as a meta-schema.
242
+ */
243
+ $vocabulary?: Record<string, string>;
244
+ /**
245
+ * @deprecated `additionalItems` has been deprecated in favor of `prefixItems`
246
+ * paired with `items`.
247
+ */
248
+ additionalItems?: JSONSchema;
249
+ /**
250
+ * The value of `additionalProperties` MUST be a valid JSON Schema.
251
+ *
252
+ * The behavior of this keyword depends on the presence and annotation
253
+ * results of `properties` and `patternProperties` within the same
254
+ * schema object. Validation with `additionalProperties` applies only to
255
+ * the child values of instance names that do not appear in the annotation
256
+ * results of either `properties` or `patternProperties`.
257
+ *
258
+ * For all such properties, validation succeeds if the child instance
259
+ * validates against the `additionalProperties` schema.
260
+ *
261
+ * The annotation result of this keyword is the set of instance property
262
+ * names validated by this keyword's subschema. Annotation results for
263
+ * `additionalProperties` keywords from multiple schemas applied to the
264
+ * same instance location are combined by taking the union of the sets.
265
+ *
266
+ * Omitting this keyword has the same assertion behavior as an empty
267
+ * schema.
268
+ *
269
+ * Implementations MAY choose to implement or optimize this keyword in
270
+ * another way that produces the same effect, such as by directly checking
271
+ * the names in `properties` and the patterns in `patternProperties`
272
+ * against the instance property set.
273
+ */
274
+ additionalProperties?: JSONSchema;
275
+ /**
276
+ * This keyword's value MUST be a non-empty array. Each item of the array
277
+ * MUST be a valid JSON Schema.
278
+ *
279
+ * An instance validates successfully against this keyword if it validates
280
+ * successfully against all schemas defined by this keyword's value.
281
+ */
282
+ allOf?: MaybeReadonlyArray<JSONSchema<Value, SchemaType>>;
283
+ /**
284
+ * This keyword's value MUST be a non-empty array. Each item of the array
285
+ * MUST be a valid JSON Schema.
286
+ *
287
+ * An instance validates successfully against this keyword if it validates
288
+ * successfully against at least one schema defined by this keyword's
289
+ * value.
290
+ */
291
+ anyOf?: MaybeReadonlyArray<JSONSchema<Value, SchemaType>>;
292
+ /**
293
+ * An instance validates successfully against this keyword if its value is
294
+ * equal to the value of the keyword.
295
+ *
296
+ * Use of this keyword is functionally equivalent to the `enum` keyword
297
+ * with a single value.
298
+ */
299
+ const?: Value;
300
+ /**
301
+ * The value of this keyword MUST be a valid JSON Schema.
302
+ *
303
+ * An array instance is valid against `contains` if at least one of its
304
+ * elements is valid against the given schema. The subschema MUST be
305
+ * applied to every array element even after the first match has been
306
+ * found, in order to collect annotations for use by other keywords.
307
+ * This is to ensure that all possible annotations are collected.
308
+ *
309
+ * Logically, the validation result of applying the value subschema to each
310
+ * item in the array MUST be OR'ed with `false`, resulting in an overall
311
+ * validation result.
312
+ *
313
+ * This keyword produces an annotation value which is an array of the
314
+ * indexes to which this keyword validates successfully when applying its
315
+ * subschema, in ascending order. The value MAY be a boolean `true` if
316
+ * the subschema validates successfully when applied to every index of the
317
+ * instance. The annotation MUST be present if the instance array to which
318
+ * this keyword's schema applies is empty.
319
+ */
320
+ contains?: JSONSchema<Value, SchemaType>;
321
+ /**
322
+ * If the instance value is a string, this property defines that the
323
+ * string SHOULD be interpreted as binary data and decoded using the
324
+ * encoding named by this property. [RFC 2045, Sec 6.1][RFC2045] lists the
325
+ * possible values for this property.
326
+ *
327
+ * The value of this property SHOULD be ignored if the instance described
328
+ * is not a string.
329
+ *
330
+ * If this keyword is absent, but `contentMediaType` is present, this
331
+ * indicates that the media type could be encoded into `UTF-8` like any
332
+ * other JSON string value, and does not require additional decoding.
333
+ *
334
+ * The value of this property MUST be a string.
335
+ *
336
+ * [RFC2045]: https://datatracker.ietf.org/doc/html/rfc2045#section-6.1
337
+ */
338
+ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token";
339
+ /**
340
+ * If the instance is a string, this property indicates the media type
341
+ * of the contents of the string. If `contentEncoding` is present,
342
+ * this property describes the decoded string.
343
+ *
344
+ * The value of this property must be a media type, as defined by
345
+ * [RFC 2046][RFC2046]. This property defines the media type of instances
346
+ * which this schema defines.
347
+ *
348
+ * The value of this property SHOULD be ignored if the instance described
349
+ * is not a string.
350
+ *
351
+ * If the `contentEncoding` property is not present, but the instance
352
+ * value is a string, then the value of this property SHOULD specify a text
353
+ * document type, and the character set SHOULD be the character set into
354
+ * which the JSON string value was decoded (for which the default is
355
+ * Unicode).
356
+ *
357
+ * [RFC2046]: https://datatracker.ietf.org/doc/html/rfc2046
358
+ */
359
+ contentMediaType?: string;
360
+ /**
361
+ * If the instance is a string, and if `contentMediaType` is present,
362
+ * this property contains a schema which describes the structure of the
363
+ * string.
364
+ *
365
+ * This keyword MAY be used with any media type that can be mapped into
366
+ * JSON Schema's data model.
367
+ *
368
+ * The value of this property MUST be a valid JSON schema. It SHOULD be
369
+ * ignored if `contentMediaType` is not present.
370
+ */
371
+ contentSchema?: JSONSchema<Value, SchemaType>;
372
+ /**
373
+ * This keyword can be used to supply a default JSON value associated with
374
+ * a particular schema. It is RECOMMENDED that a `default` value be valid
375
+ * against the associated schema.
376
+ */
377
+ default?: Value;
378
+ /**
379
+ * @deprecated `definitions` has been renamed to `$defs`.
380
+ */
381
+ definitions?: Record<string, JSONSchema>;
382
+ /**
383
+ * @deprecated `dependencies` has been split into two keywords:
384
+ * `dependentSchemas` and `dependentRequired`.
385
+ */
386
+ dependencies?: Record<string, MaybeReadonlyArray<string> | JSONSchema>;
387
+ /**
388
+ * The value of this keyword MUST be an object. Properties in
389
+ * this object, if any, MUST be arrays. Elements in each array,
390
+ * if any, MUST be strings, and MUST be unique.
391
+ *
392
+ * This keyword specifies properties that are required if a specific
393
+ * other property is present. Their requirement is dependent on the
394
+ * presence of the other property.
395
+ *
396
+ * Validation succeeds if, for each name that appears in both
397
+ * the instance and as a name within this keyword's value, every
398
+ * item in the corresponding array is also the name of a property
399
+ * in the instance.
400
+ *
401
+ * Omitting this keyword has the same behavior as an empty object.
402
+ */
403
+ dependentRequired?: Record<string, MaybeReadonlyArray<string>>;
404
+ /**
405
+ * This keyword specifies subschemas that are evaluated if the instance is
406
+ * an object and contains a certain property.
407
+ *
408
+ * This keyword's value MUST be an object. Each value in the object MUST be
409
+ * a valid JSON Schema.
410
+ *
411
+ * If the object key is a property in the instance, the entire instance
412
+ * must validate against the subschema. Its use is dependent on the
413
+ * presence of the property.
414
+ *
415
+ * Omitting this keyword has the same behavior as an empty object.
416
+ */
417
+ dependentSchemas?: Record<string, JSONSchema>;
418
+ /**
419
+ * The value of this keyword MUST be a boolean. When multiple occurrences
420
+ * of this keyword are applicable to a single sub-instance, applications
421
+ * SHOULD consider the instance location to be deprecated if any occurrence
422
+ * specifies a `true` value.
423
+ *
424
+ * If `deprecated` has a value of boolean `true`, it indicates that
425
+ * applications SHOULD refrain from usage of the declared property. It MAY
426
+ * mean the property is going to be removed in the future.
427
+ *
428
+ * A root schema containing `deprecated` with a value of `true`
429
+ * indicates that the entire resource being described MAY be removed in the
430
+ * future.
431
+ *
432
+ * The `deprecated` keyword applies to each instance location to which
433
+ * the schema object containing the keyword successfully applies. This can
434
+ * result in scenarios where every array item or object property is
435
+ * deprecated even though the containing array or object is not.
436
+ *
437
+ * Omitting this keyword has the same behavior as a value of `false`.
438
+ */
439
+ deprecated?: boolean;
440
+ /**
441
+ * Can be used to decorate a user interface with explanation or information
442
+ * about the data produced.
443
+ */
444
+ description?: string;
445
+ /**
446
+ * This keyword's value MUST be a valid JSON Schema.
447
+ *
448
+ * When `if` is present, and the instance fails to validate against its
449
+ * subschema, then validation succeeds against this keyword if the instance
450
+ * successfully validates against this keyword's subschema.
451
+ *
452
+ * This keyword has no effect when `if` is absent, or when the instance
453
+ * successfully validates against its subschema. Implementations MUST NOT
454
+ * evaluate the instance against this keyword, for either validation or
455
+ * annotation collection purposes, in such cases.
456
+ */
457
+ else?: JSONSchema<Value, SchemaType>;
458
+ /**
459
+ * The value of this keyword MUST be an array. This array SHOULD have at
460
+ * least one element. Elements in the array SHOULD be unique.
461
+ *
462
+ * An instance validates successfully against this keyword if its value is
463
+ * equal to one of the elements in this keyword's array value.
464
+ *
465
+ * Elements in the array might be of any type, including `null`.
466
+ */
467
+ enum?: MaybeReadonlyArray<Value>;
468
+ /**
469
+ * The value of this keyword MUST be an array. When multiple occurrences of
470
+ * this keyword are applicable to a single sub-instance, implementations
471
+ * MUST provide a flat array of all values rather than an array of arrays.
472
+ *
473
+ * This keyword can be used to provide sample JSON values associated with a
474
+ * particular schema, for the purpose of illustrating usage. It is
475
+ * RECOMMENDED that these values be valid against the associated schema.
476
+ *
477
+ * Implementations MAY use the value(s) of `default`, if present, as an
478
+ * additional example. If `examples` is absent, `default` MAY still be
479
+ * used in this manner.
480
+ */
481
+ examples?: MaybeReadonlyArray<Value>;
482
+ /**
483
+ * The value of `exclusiveMaximum` MUST be a number, representing an
484
+ * exclusive upper limit for a numeric instance.
485
+ *
486
+ * If the instance is a number, then the instance is valid only if it has a
487
+ * value strictly less than (not equal to) `exclusiveMaximum`.
488
+ */
489
+ exclusiveMaximum?: number;
490
+ /**
491
+ * The value of `exclusiveMinimum` MUST be a number, representing an
492
+ * exclusive lower limit for a numeric instance.
493
+ *
494
+ * If the instance is a number, then the instance is valid only if it has a
495
+ * value strictly greater than (not equal to) `exclusiveMinimum`.
496
+ */
497
+ exclusiveMinimum?: number;
498
+ /**
499
+ * Implementations MAY treat `format` as an assertion in addition to an
500
+ * annotation, and attempt to validate the value's conformance to the
501
+ * specified semantics.
502
+ *
503
+ * The value of this keyword is called a format attribute. It MUST be a
504
+ * string. A format attribute can generally only validate a given set
505
+ * of instance types. If the type of the instance to validate is not in
506
+ * this set, validation for this format attribute and instance SHOULD
507
+ * succeed. Format attributes are most often applied to strings, but can
508
+ * be specified to apply to any type.
509
+ *
510
+ * Implementations MAY support custom format attributes. Save for agreement
511
+ * between parties, schema authors SHALL NOT expect a peer implementation
512
+ * to support such custom format attributes. An implementation MUST NOT
513
+ * fail validation or cease processing due to an unknown format attribute.
514
+ * When treating `format` as an annotation, implementations SHOULD
515
+ * collect both known and unknown format attribute values.
516
+ */
517
+ format?: string;
518
+ /**
519
+ * This keyword's value MUST be a valid JSON Schema.
520
+ *
521
+ * This validation outcome of this keyword's subschema has no direct effect
522
+ * on the overall validation result. Rather, it controls which of the
523
+ * `then` or `else` keywords are evaluated.
524
+ *
525
+ * Instances that successfully validate against this keyword's subschema
526
+ * MUST also be valid against the subschema value of the `then` keyword,
527
+ * if present.
528
+ *
529
+ * Instances that fail to validate against this keyword's subschema MUST
530
+ * also be valid against the subschema value of the `else` keyword, if
531
+ * present.
532
+ *
533
+ * If annotations are being collected, they are collected
534
+ * from this keyword's subschema in the usual way, including when the
535
+ * keyword is present without either `then` or `else`.
536
+ */
537
+ if?: JSONSchema<Value, SchemaType>;
538
+ /**
539
+ * The value of `items` MUST be a valid JSON Schema.
540
+ *
541
+ * This keyword applies its subschema to all instance elements at indexes
542
+ * greater than the length of the `prefixItems` array in the same schema
543
+ * object, as reported by the annotation result of that `prefixItems`
544
+ * keyword. If no such annotation result exists, `items` applies its
545
+ * subschema to all instance array elements.
546
+ *
547
+ * Note that the behavior of `items` without `prefixItems` is identical
548
+ * to that of the schema form of `items` in prior drafts.
549
+ *
550
+ * When `prefixItems` is present, the behavior of `items` is identical
551
+ * to the former `additionalItems` keyword.
552
+ *
553
+ * If the `items` subschema is applied to any positions within the
554
+ * instance array, it produces an annotation result of boolean `true`,
555
+ * indicating that all remaining array elements have been evaluated against
556
+ * this keyword's subschema.
557
+ *
558
+ * Omitting this keyword has the same assertion behavior as an empty
559
+ * schema.
560
+ *
561
+ * Implementations MAY choose to implement or optimize this keyword
562
+ * in another way that produces the same effect, such as by directly
563
+ * checking for the presence and size of a `prefixItems` array.
564
+ */
565
+ items?: JSONSchema;
566
+ /**
567
+ * The value of this keyword MUST be a non-negative integer.
568
+ *
569
+ * If `contains` is not present within the same schema object, then this
570
+ * keyword has no effect.
571
+ *
572
+ * An instance array is valid against `maxContains` in two ways,
573
+ * depending on the form of the annotation result of an adjacent
574
+ * `contains` keyword. The first way is if the annotation result is an
575
+ * array and the length of that array is less than or equal to the
576
+ * `maxContains` value. The second way is if the annotation result is a
577
+ * boolean `true` and the instance array length is less than or equal to
578
+ * the `maxContains` value.
579
+ */
580
+ maxContains?: number;
581
+ /**
582
+ * The value of `maximum` MUST be a number, representing an inclusive
583
+ * upper limit for a numeric instance.
584
+ *
585
+ * If the instance is a number, then this keyword validates only if the
586
+ * instance is less than or exactly equal to `maximum`.
587
+ */
588
+ maximum?: number;
589
+ /**
590
+ * The value of this keyword MUST be a non-negative integer.
591
+ *
592
+ * An array instance is valid against `maxItems` if its size is less
593
+ * than, or equal to, the value of this keyword.
594
+ *
595
+ * @minimum 0
596
+ */
597
+ maxItems?: number;
598
+ /**
599
+ * The value of this keyword MUST be a non-negative integer.
600
+ *
601
+ * A string instance is valid against this keyword if its length is less
602
+ * than, or equal to, the value of this keyword.
603
+ *
604
+ * The length of a string instance is defined as the number of its
605
+ * characters as defined by [RFC 8259][RFC8259].
606
+ *
607
+ * [RFC8259]: https://datatracker.ietf.org/doc/html/rfc8259
608
+ *
609
+ * @minimum 0
610
+ */
611
+ maxLength?: number;
612
+ /**
613
+ * The value of this keyword MUST be a non-negative integer.
614
+ *
615
+ * An object instance is valid against `maxProperties` if its number of
616
+ * `properties` is less than, or equal to, the value of this keyword.
617
+ *
618
+ * @minimum 0
619
+ */
620
+ maxProperties?: number;
621
+ /**
622
+ * The value of this keyword MUST be a non-negative integer.
623
+ *
624
+ * If `contains` is not present within the same schema object, then this
625
+ * keyword has no effect.
626
+ *
627
+ * An instance array is valid against `minContains` in two ways,
628
+ * depending on the form of the annotation result of an adjacent
629
+ * `contains` keyword. The first way is if the annotation result is an
630
+ * array and the length of that array is greater than or equal to the
631
+ * `minContains` value. The second way is if the annotation result is a
632
+ * boolean `true` and the instance array length is greater than or equal
633
+ * to the `minContains` value.
634
+ *
635
+ * A value of `0` is allowed, but is only useful for setting a range
636
+ * of occurrences from `0` to the value of `maxContains`. A value of
637
+ * `0` with no `maxContains` causes `contains` to always pass
638
+ * validation.
639
+ *
640
+ * Omitting this keyword has the same behavior as a value of `1`.
641
+ *
642
+ * @default 1
643
+ */
644
+ minContains?: number;
645
+ /**
646
+ * The value of `minimum` MUST be a number, representing an inclusive
647
+ * lower limit for a numeric instance.
648
+ *
649
+ * If the instance is a number, then this keyword validates only if the
650
+ * instance is greater than or exactly equal to `minimum`.
651
+ */
652
+ minimum?: number;
653
+ /**
654
+ * The value of this keyword MUST be a non-negative integer.
655
+ *
656
+ * An array instance is valid against `minItems` if its size is greater
657
+ * than, or equal to, the value of this keyword.
658
+ *
659
+ * Omitting this keyword has the same behavior as a value of `0`.
660
+ *
661
+ * @default 0
662
+ * @minimum 0
663
+ */
664
+ minItems?: number;
665
+ /**
666
+ * The value of this keyword MUST be a non-negative integer.
667
+ *
668
+ * A string instance is valid against this keyword if its length is greater
669
+ * than, or equal to, the value of this keyword.
670
+ *
671
+ * The length of a string instance is defined as the number of its
672
+ * characters as defined by [RFC 8259][RFC8259].
673
+ *
674
+ * Omitting this keyword has the same behavior as a value of `0`.
675
+ *
676
+ * [RFC8259]: https://datatracker.ietf.org/doc/html/rfc8259
677
+ *
678
+ * @default 0
679
+ * @minimum 0
680
+ */
681
+ minLength?: number;
682
+ /**
683
+ * The value of this keyword MUST be a non-negative integer.
684
+ *
685
+ * An object instance is valid against `minProperties` if its number of
686
+ * `properties` is greater than, or equal to, the value of this keyword.
687
+ *
688
+ * Omitting this keyword has the same behavior as a value of `0`.
689
+ *
690
+ * @default 0
691
+ * @minimum 0
692
+ */
693
+ minProperties?: number;
694
+ /**
695
+ * The value of `multipleOf` MUST be a number, strictly greater than
696
+ * `0`.
697
+ *
698
+ * A numeric instance is valid only if division by this keyword's value
699
+ * results in an integer.
700
+ *
701
+ * @exclusiveMinimum 0
702
+ */
703
+ multipleOf?: number;
704
+ /**
705
+ * This keyword's value MUST be a valid JSON Schema.
706
+ *
707
+ * An instance is valid against this keyword if it fails to validate
708
+ * successfully against the schema defined by this keyword.
709
+ */
710
+ not?: JSONSchema<Value, SchemaType>;
711
+ /**
712
+ * This keyword's value MUST be a non-empty array. Each item of the array
713
+ * MUST be a valid JSON Schema.
714
+ *
715
+ * An instance validates successfully against this keyword if it validates
716
+ * successfully against exactly one schema defined by this keyword's value.
717
+ */
718
+ oneOf?: MaybeReadonlyArray<JSONSchema<Value, SchemaType>>;
719
+ /**
720
+ * The value of this keyword MUST be a string. This string SHOULD be a
721
+ * valid regular expression, according to the [ECMA-262][ecma262] regular
722
+ * expression dialect.
723
+ *
724
+ * A string instance is considered valid if the regular expression matches
725
+ * the instance successfully. Recall: regular expressions are not
726
+ * implicitly anchored.
727
+ *
728
+ * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/
729
+ *
730
+ * @format "regex"
731
+ */
732
+ pattern?: string;
733
+ /**
734
+ * The value of `patternProperties` MUST be an object. Each property name
735
+ * of this object SHOULD be a valid regular expression, according to the
736
+ * [ECMA-262][ecma262] regular expression dialect. Each property value of
737
+ * this object MUST be a valid JSON Schema.
738
+ *
739
+ * Validation succeeds if, for each instance name that matches any regular
740
+ * expressions that appear as a property name in this keyword's value,
741
+ * the child instance for that name successfully validates against each
742
+ * schema that corresponds to a matching regular expression.
743
+ *
744
+ * The annotation result of this keyword is the set of instance property
745
+ * names matched by this keyword. Omitting this keyword has the same
746
+ * assertion behavior as an empty object.
747
+ *
748
+ * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/
749
+ */
750
+ patternProperties?: Record<string, JSONSchema>;
751
+ /**
752
+ * The value of `prefixItems` MUST be a non-empty array of valid JSON
753
+ * Schemas.
754
+ *
755
+ * Validation succeeds if each element of the instance validates against
756
+ * the schema at the same position, if any. This keyword does not
757
+ * constrain the length of the array. If the array is longer than this
758
+ * keyword's value, this keyword validates only the prefix of matching
759
+ * length.
760
+ *
761
+ * This keyword produces an annotation value which is the largest index to
762
+ * which this keyword applied a subschema. The value MAY be a boolean
763
+ * `true` if a subschema was applied to every index of the instance, such
764
+ * as is produced by the `items` keyword.
765
+ * This annotation affects the behavior of `items` and
766
+ * `unevaluatedItems`.
767
+ *
768
+ * Omitting this keyword has the same assertion behavior as an empty array.
769
+ */
770
+ prefixItems?: MaybeReadonlyArray<JSONSchema> | JSONSchema;
771
+ /**
772
+ * The value of `properties` MUST be an object. Each value of this object
773
+ * MUST be a valid JSON Schema.
774
+ *
775
+ * Validation succeeds if, for each name that appears in both the instance
776
+ * and as a name within this keyword's value, the child instance for that
777
+ * name successfully validates against the corresponding schema.
778
+ *
779
+ * The annotation result of this keyword is the set of instance property
780
+ * names matched by this keyword.
781
+ *
782
+ * Omitting this keyword has the same assertion behavior as an empty
783
+ * object.
784
+ */
785
+ properties?: Record<string, JSONSchema>;
786
+ /**
787
+ * The value of `propertyNames` MUST be a valid JSON Schema.
788
+ *
789
+ * If the instance is an object, this keyword validates if every property
790
+ * name in the instance validates against the provided schema.
791
+ * Note the property name that the schema is testing will always be a
792
+ * string.
793
+ *
794
+ * Omitting this keyword has the same behavior as an empty schema.
795
+ */
796
+ propertyNames?: JSONSchema;
797
+ /**
798
+ * The value of this keyword MUST be a boolean. When multiple occurrences
799
+ * of this keyword are applicable to a single sub-instance, the resulting
800
+ * value MUST be `true` if any occurrence specifies a `true` value, and
801
+ * MUST be `false` otherwise.
802
+ *
803
+ * If `readOnly` has a value of boolean `true`, it indicates that the
804
+ * value of the instance is managed exclusively by the owning authority,
805
+ * and attempts by an application to modify the value of this property are
806
+ * expected to be ignored or rejected by that owning authority.
807
+ *
808
+ * An instance document that is marked as `readOnly` for the entire
809
+ * document MAY be ignored if sent to the owning authority, or MAY result
810
+ * in an error, at the authority's discretion.
811
+ *
812
+ * For example, `readOnly` would be used to mark a database-generated
813
+ * serial number as read-only.
814
+ *
815
+ * This keyword can be used to assist in user interface instance
816
+ * generation.
817
+ *
818
+ * @default false
819
+ */
820
+ readOnly?: boolean;
821
+ /**
822
+ * The value of this keyword MUST be an array. Elements of this array, if
823
+ * any, MUST be strings, and MUST be unique.
824
+ *
825
+ * An object instance is valid against this keyword if every item in the
826
+ * array is the name of a property in the instance.
827
+ *
828
+ * Omitting this keyword has the same behavior as an empty array.
829
+ */
830
+ required?: MaybeReadonlyArray<string>;
831
+ /**
832
+ * This keyword's value MUST be a valid JSON Schema.
833
+ *
834
+ * When `if` is present, and the instance successfully validates against
835
+ * its subschema, then validation succeeds against this keyword if the
836
+ * instance also successfully validates against this keyword's subschema.
837
+ *
838
+ * This keyword has no effect when `if` is absent, or when the instance
839
+ * fails to validate against its subschema. Implementations MUST NOT
840
+ * evaluate the instance against this keyword, for either validation or
841
+ * annotation collection purposes, in such cases.
842
+ */
843
+ then?: JSONSchema<Value, SchemaType>;
844
+ /**
845
+ * Can be used to decorate a user interface with a short label about the
846
+ * data produced.
847
+ */
848
+ title?: string;
849
+ /**
850
+ * The value of this keyword MUST be either a string or an array. If it is
851
+ * an array, elements of the array MUST be strings and MUST be unique.
852
+ *
853
+ * String values MUST be one of the six primitive types (`"null"`,
854
+ * `"boolean"`, `"object"`, `"array"`, `"number"`, or
855
+ * `"string"`), or `"integer"` which matches any number with a zero
856
+ * fractional part.
857
+ *
858
+ * An instance validates if and only if the instance is in any of the sets
859
+ * listed for this keyword.
860
+ */
861
+ type?: SchemaType;
862
+ /**
863
+ * The value of `unevaluatedItems` MUST be a valid JSON Schema.
864
+ *
865
+ * The behavior of this keyword depends on the annotation results of
866
+ * adjacent keywords that apply to the instance location being validated.
867
+ * Specifically, the annotations from `prefixItems`, `items`, and
868
+ * `contains`, which can come from those keywords when they are adjacent
869
+ * to the `unevaluatedItems` keyword. Those three annotations, as well as
870
+ * `unevaluatedItems`, can also result from any and all adjacent
871
+ * [in-place applicator][in-place-applicator] keywords.
872
+ *
873
+ * If no relevant annotations are present, the `unevaluatedItems`
874
+ * subschema MUST be applied to all locations in the array.
875
+ * If a boolean `true` value is present from any of the relevant
876
+ * annotations, `unevaluatedItems` MUST be ignored. Otherwise, the
877
+ * subschema MUST be applied to any index greater than the largest
878
+ * annotation value for `prefixItems`, which does not appear in any
879
+ * annotation value for `contains`.
880
+ *
881
+ * This means that `prefixItems`, `items`, `contains`, and all
882
+ * in-place applicators MUST be evaluated before this keyword can be
883
+ * evaluated. Authors of extension keywords MUST NOT define an in-place
884
+ * applicator that would need to be evaluated after this keyword.
885
+ *
886
+ * If the `unevaluatedItems` subschema is applied to any positions within
887
+ * the instance array, it produces an annotation result of boolean
888
+ * `true`, analogous to the behavior of `items`.
889
+ *
890
+ * Omitting this keyword has the same assertion behavior as an empty
891
+ * schema.
892
+ *
893
+ * [in-place-applicator]: https://json-schema.org/draft/2020-12/json-schema-core.html#in-place
894
+ */
895
+ unevaluatedItems?: JSONSchema;
896
+ /**
897
+ * The value of `unevaluatedProperties` MUST be a valid JSON Schema.
898
+ *
899
+ * The behavior of this keyword depends on the annotation results of
900
+ * adjacent keywords that apply to the instance location being validated.
901
+ * Specifically, the annotations from `properties`,
902
+ * `patternProperties`, and `additionalProperties`, which can come from
903
+ * those keywords when they are adjacent to the `unevaluatedProperties`
904
+ * keyword. Those three annotations, as well as `unevaluatedProperties`,
905
+ * can also result from any and all adjacent
906
+ * [in-place applicator][in-place-applicator] keywords.
907
+ *
908
+ * Validation with `unevaluatedProperties` applies only to the child
909
+ * values of instance names that do not appear in the `properties`,
910
+ * `patternProperties`, `additionalProperties`, or
911
+ * `unevaluatedProperties` annotation results that apply to the
912
+ * instance location being validated.
913
+ *
914
+ * For all such properties, validation succeeds if the child instance
915
+ * validates against the "unevaluatedProperties" schema.
916
+ *
917
+ * This means that `properties`, `patternProperties`,
918
+ * `additionalProperties`, and all in-place applicators MUST be evaluated
919
+ * before this keyword can be evaluated. Authors of extension keywords
920
+ * MUST NOT define an in-place applicator that would need to be evaluated
921
+ * after this keyword.
922
+ *
923
+ * The annotation result of this keyword is the set of instance property
924
+ * names validated by this keyword's subschema.
925
+ *
926
+ * Omitting this keyword has the same assertion behavior as an empty
927
+ * schema.
928
+ *
929
+ * [in-place-applicator]: https://json-schema.org/draft/2020-12/json-schema-core.html#in-place
930
+ */
931
+ unevaluatedProperties?: JSONSchema;
932
+ /**
933
+ * The value of this keyword MUST be a boolean.
934
+ *
935
+ * If this keyword has boolean value `false`, the instance validates
936
+ * successfully. If it has boolean value `true`, the instance validates
937
+ * successfully if all of its elements are unique.
938
+ *
939
+ * Omitting this keyword has the same behavior as a value of `false`.
940
+ *
941
+ * @default false
942
+ */
943
+ uniqueItems?: boolean;
944
+ /**
945
+ * The value of this keyword MUST be a boolean. When multiple occurrences
946
+ * of this keyword is applicable to a single sub-instance, the resulting
947
+ * value MUST be `true` if any occurrence specifies a `true` value, and
948
+ * MUST be `false` otherwise.
949
+ *
950
+ * If `writeOnly` has a value of boolean `true`, it indicates that the
951
+ * value is never present when the instance is retrieved from the owning
952
+ * authority. It can be present when sent to the owning authority to update
953
+ * or create the document (or the resource it represents), but it will not
954
+ * be included in any updated or newly created version of the instance.
955
+ *
956
+ * An instance document that is marked as `writeOnly` for the entire
957
+ * document MAY be returned as a blank document of some sort, or MAY
958
+ * produce an error upon retrieval, or have the retrieval request ignored,
959
+ * at the authority's discretion.
960
+ *
961
+ * For example, `writeOnly` would be used to mark a password input field.
962
+ *
963
+ * These keywords can be used to assist in user interface instance
964
+ * generation. In particular, an application MAY choose to use a widget
965
+ * that hides input values as they are typed for write-only fields.
966
+ *
967
+ * @default false
968
+ */
969
+ writeOnly?: boolean;
970
+ };
971
+ declare namespace JSONSchema {
972
+ type TypeValue = (ValueOf<TypeName> | TypeName | Array<ValueOf<TypeName> | TypeName> | ReadonlyArray<ValueOf<TypeName> | TypeName>);
973
+ /**
974
+ * JSON Schema interface
975
+ */
976
+ type Interface<Value = any, SchemaType extends TypeValue = TypeValue> = Exclude<JSONSchema<Value, SchemaType>, boolean>;
977
+ type Array<T = any> = Pick<Interface<T, "array">, KeywordByType.Any | KeywordByType.Array>;
978
+ type Boolean = Pick<Interface<boolean, "boolean">, KeywordByType.Any>;
979
+ type Integer = Pick<Interface<number, "integer">, KeywordByType.Any | KeywordByType.Number>;
980
+ type Number = Pick<Interface<number, "number">, KeywordByType.Any | KeywordByType.Number>;
981
+ type Null = Pick<Interface<null, "null">, KeywordByType.Any>;
982
+ type Object<T = any> = Pick<Interface<T, "object">, KeywordByType.Any | KeywordByType.Object>;
983
+ type String = Pick<Interface<string, "string">, KeywordByType.Any | KeywordByType.String>;
984
+ }
985
+ declare namespace KeywordByType {
986
+ type Any = "$anchor" | "$comment" | "$defs" | "$dynamicAnchor" | "$dynamicRef" | "$id" | "$ref" | "$schema" | "$vocabulary" | "allOf" | "anyOf" | "const" | "default" | "definitions" | "deprecated" | "description" | "else" | "enum" | "examples" | "format" | "if" | "not" | "oneOf" | "readOnly" | "then" | "title" | "type" | "writeOnly";
987
+ type Array = "additionalItems" | "contains" | "items" | "maxContains" | "maxItems" | "minContains" | "minItems" | "prefixItems" | "unevaluatedItems" | "uniqueItems";
988
+ type Number = "exclusiveMaximum" | "exclusiveMinimum" | "maximum" | "minimum" | "multipleOf";
989
+ type Object = "additionalProperties" | "dependencies" | "dependentRequired" | "dependentSchemas" | "maxProperties" | "minProperties" | "patternProperties" | "properties" | "propertyNames" | "required" | "unevaluatedProperties";
990
+ type String = "contentEncoding" | "contentMediaType" | "contentSchema" | "maxLength" | "minLength" | "pattern";
991
+ }
992
+ /**
993
+ * Content encoding strategy enum.
994
+ *
995
+ * - [Content-Transfer-Encoding Syntax](https://datatracker.ietf.org/doc/html/rfc2045#section-6.1)
996
+ * - [7bit vs 8bit encoding](https://stackoverflow.com/questions/25710599/content-transfer-encoding-7bit-or-8-bit/28531705#28531705)
997
+ */
998
+ declare enum ContentEncoding {
999
+ /**
1000
+ * Only US-ASCII characters, which use the lower 7 bits for each character.
1001
+ *
1002
+ * Each line must be less than 1,000 characters.
1003
+ */
1004
+ "7bit" = "7bit",
1005
+ /**
1006
+ * Allow extended ASCII characters which can use the 8th (highest) bit to
1007
+ * indicate special characters not available in 7bit.
1008
+ *
1009
+ * Each line must be less than 1,000 characters.
1010
+ */
1011
+ "8bit" = "8bit",
1012
+ /**
1013
+ * Useful for data that is mostly non-text.
1014
+ */
1015
+ Base64 = "base64",
1016
+ /**
1017
+ * Same character set as 8bit, with no line length restriction.
1018
+ */
1019
+ Binary = "binary",
1020
+ /**
1021
+ * An extension token defined by a standards-track RFC and registered with
1022
+ * IANA.
1023
+ */
1024
+ IETFToken = "ietf-token",
1025
+ /**
1026
+ * Lines are limited to 76 characters, and line breaks are represented using
1027
+ * special characters that are escaped.
1028
+ */
1029
+ QuotedPrintable = "quoted-printable",
1030
+ /**
1031
+ * The two characters "X-" or "x-" followed, with no intervening white space,
1032
+ * by any token.
1033
+ */
1034
+ XToken = "x-token"
1035
+ }
1036
+ /**
1037
+ * This enum provides well-known formats that apply to strings.
1038
+ */
1039
+ declare enum Format {
1040
+ /**
1041
+ * A string instance is valid against this attribute if it is a valid
1042
+ * representation according to the "full-date" production in
1043
+ * [RFC 3339][RFC3339].
1044
+ *
1045
+ * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339
1046
+ */
1047
+ Date = "date",
1048
+ /**
1049
+ * A string instance is valid against this attribute if it is a valid
1050
+ * representation according to the "date-time" production in
1051
+ * [RFC 3339][RFC3339].
1052
+ *
1053
+ * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339
1054
+ */
1055
+ DateTime = "date-time",
1056
+ /**
1057
+ * A string instance is valid against this attribute if it is a valid
1058
+ * representation according to the "duration" production.
1059
+ */
1060
+ Duration = "duration",
1061
+ /**
1062
+ * A string instance is valid against this attribute if it is a valid Internet
1063
+ * email address as defined by by the "Mailbox" ABNF rule in [RFC
1064
+ * 5321][RFC5322], section 4.1.2.
1065
+ *
1066
+ * [RFC5321]: https://datatracker.ietf.org/doc/html/rfc5321
1067
+ */
1068
+ Email = "email",
1069
+ /**
1070
+ * As defined by [RFC 1123, section 2.1][RFC1123], including host names
1071
+ * produced using the Punycode algorithm specified in
1072
+ * [RFC 5891, section 4.4][RFC5891].
1073
+ *
1074
+ * [RFC1123]: https://datatracker.ietf.org/doc/html/rfc1123
1075
+ * [RFC5891]: https://datatracker.ietf.org/doc/html/rfc5891
1076
+ */
1077
+ Hostname = "hostname",
1078
+ /**
1079
+ * A string instance is valid against this attribute if it is a valid Internet
1080
+ * email address as defined by the extended "Mailbox" ABNF rule in
1081
+ * [RFC 6531][RFC6531], section 3.3.
1082
+ *
1083
+ * [RFC6531]: https://datatracker.ietf.org/doc/html/rfc6531
1084
+ */
1085
+ IDNEmail = "idn-email",
1086
+ /**
1087
+ * As defined by either [RFC 1123, section 2.1][RFC1123] as for hostname, or
1088
+ * an internationalized hostname as defined by
1089
+ * [RFC 5890, section 2.3.2.3][RFC5890].
1090
+ *
1091
+ * [RFC1123]: https://datatracker.ietf.org/doc/html/rfc1123
1092
+ * [RFC5890]: https://datatracker.ietf.org/doc/html/rfc5890
1093
+ */
1094
+ IDNHostname = "idn-hostname",
1095
+ /**
1096
+ * An IPv4 address according to the "dotted-quad" ABNF syntax as defined in
1097
+ * [RFC 2673, section 3.2][RFC2673].
1098
+ *
1099
+ * [RFC2673]: https://datatracker.ietf.org/doc/html/rfc2673
1100
+ */
1101
+ IPv4 = "ipv4",
1102
+ /**
1103
+ * An IPv6 address as defined in [RFC 4291, section 2.2][RFC4291].
1104
+ *
1105
+ * [RFC4291]: https://datatracker.ietf.org/doc/html/rfc4291
1106
+ */
1107
+ IPv6 = "ipv6",
1108
+ /**
1109
+ * A string instance is valid against this attribute if it is a valid IRI,
1110
+ * according to [RFC 3987][RFC3987].
1111
+ *
1112
+ * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987
1113
+ */
1114
+ IRI = "iri",
1115
+ /**
1116
+ * A string instance is valid against this attribute if it is a valid IRI
1117
+ * Reference (either an IRI or a relative-reference), according to
1118
+ * [RFC 3987][RFC3987].
1119
+ *
1120
+ * [RFC3987]: https://datatracker.ietf.org/doc/html/rfc3987
1121
+ */
1122
+ IRIReference = "iri-reference",
1123
+ /**
1124
+ * A string instance is valid against this attribute if it is a valid JSON
1125
+ * string representation of a JSON Pointer, according to
1126
+ * [RFC 6901, section 5][RFC6901].
1127
+ *
1128
+ * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901
1129
+ */
1130
+ JSONPointer = "json-pointer",
1131
+ /**
1132
+ * A string instance is valid against this attribute if it is a valid JSON
1133
+ * string representation of a JSON Pointer fragment, according to
1134
+ * [RFC 6901, section 5][RFC6901].
1135
+ *
1136
+ * [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901
1137
+ */
1138
+ JSONPointerURIFragment = "json-pointer-uri-fragment",
1139
+ /**
1140
+ * This attribute applies to string instances.
1141
+ *
1142
+ * A regular expression, which SHOULD be valid according to the
1143
+ * [ECMA-262][ecma262] regular expression dialect.
1144
+ *
1145
+ * Implementations that validate formats MUST accept at least the subset of
1146
+ * [ECMA-262][ecma262] defined in the [Regular Expressions][regexInterop]
1147
+ * section of this specification, and SHOULD accept all valid
1148
+ * [ECMA-262][ecma262] expressions.
1149
+ *
1150
+ * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/
1151
+ * [regexInterop]: https://json-schema.org/draft/2020-12/json-schema-validation.html#regexInterop
1152
+ */
1153
+ RegEx = "regex",
1154
+ /**
1155
+ * A string instance is valid against this attribute if it is a valid
1156
+ * [Relative JSON Pointer][relative-json-pointer].
1157
+ *
1158
+ * [relative-json-pointer]: https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer-01
1159
+ */
1160
+ RelativeJSONPointer = "relative-json-pointer",
1161
+ /**
1162
+ * A string instance is valid against this attribute if it is a valid
1163
+ * representation according to the "time" production in [RFC 3339][RFC3339].
1164
+ *
1165
+ * [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339
1166
+ */
1167
+ Time = "time",
1168
+ /**
1169
+ * A string instance is valid against this attribute if it is a valid URI,
1170
+ * according to [RFC3986][RFC3986].
1171
+ *
1172
+ * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986
1173
+ */
1174
+ URI = "uri",
1175
+ /**
1176
+ * A string instance is valid against this attribute if it is a valid URI
1177
+ * Reference (either a URI or a relative-reference), according to
1178
+ * [RFC3986][RFC3986].
1179
+ *
1180
+ * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986
1181
+ */
1182
+ URIReference = "uri-reference",
1183
+ /**
1184
+ * A string instance is valid against this attribute if it is a valid URI
1185
+ * Template (of any level), according to [RFC 6570][RFC6570].
1186
+ *
1187
+ * Note that URI Templates may be used for IRIs; there is no separate IRI
1188
+ * Template specification.
1189
+ *
1190
+ * [RFC6570]: https://datatracker.ietf.org/doc/html/rfc6570
1191
+ */
1192
+ URITemplate = "uri-template",
1193
+ /**
1194
+ * A string instance is valid against this attribute if it is a valid string
1195
+ * representation of a UUID, according to [RFC 4122][RFC4122].
1196
+ *
1197
+ * [RFC4122]: https://datatracker.ietf.org/doc/html/rfc4122
1198
+ */
1199
+ UUID = "uuid"
1200
+ }
1201
+ /**
1202
+ * Enum consisting of simple type names for the `type` keyword
1203
+ */
1204
+ declare enum TypeName {
1205
+ /**
1206
+ * Value MUST be an array.
1207
+ */
1208
+ Array = "array",
1209
+ /**
1210
+ * Value MUST be a boolean.
1211
+ */
1212
+ Boolean = "boolean",
1213
+ /**
1214
+ * Value MUST be an integer, no floating point numbers are allowed. This is a
1215
+ * subset of the number type.
1216
+ */
1217
+ Integer = "integer",
1218
+ /**
1219
+ * Value MUST be null. Note this is mainly for purpose of being able use union
1220
+ * types to define nullability. If this type is not included in a union, null
1221
+ * values are not allowed (the primitives listed above do not allow nulls on
1222
+ * their own).
1223
+ */
1224
+ Null = "null",
1225
+ /**
1226
+ * Value MUST be a number, floating point numbers are allowed.
1227
+ */
1228
+ Number = "number",
1229
+ /**
1230
+ * Value MUST be an object.
1231
+ */
1232
+ Object = "object",
1233
+ /**
1234
+ * Value MUST be a string.
1235
+ */
1236
+ String = "string"
1237
+ }
1238
+ declare const keywords: readonly ["$anchor", "$comment", "$defs", "$dynamicAnchor", "$dynamicRef", "$id", "$ref", "$schema", "$vocabulary", "additionalItems", "additionalProperties", "allOf", "anyOf", "const", "contains", "contentEncoding", "contentMediaType", "contentSchema", "default", "definitions", "dependencies", "dependentRequired", "dependentSchemas", "deprecated", "description", "else", "enum", "examples", "exclusiveMaximum", "exclusiveMinimum", "format", "if", "items", "maxContains", "maximum", "maxItems", "maxLength", "maxProperties", "minContains", "minimum", "minItems", "minLength", "minProperties", "multipleOf", "not", "oneOf", "pattern", "patternProperties", "prefixItems", "properties", "propertyNames", "readOnly", "required", "then", "title", "type", "unevaluatedItems", "unevaluatedProperties", "uniqueItems", "writeOnly"];
1239
+
1240
+ export { $schema, ContentEncoding, Format, JSONSchema, TypeName, draft, keywords };