@stripe/extensibility-jsonschema-tools 0.6.3

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,2598 @@
1
+ import { ExtendedJSONSchema7 } from '@formspec/build/browser';
2
+ import { getSchemaExtension } from '@formspec/build/browser';
3
+ import { jsonSchema7Schema } from '@formspec/build/browser';
4
+ import { setSchemaExtension } from '@formspec/build/browser';
5
+ import * as ts from 'typescript';
6
+ import { uiSchemaSchema } from '@formspec/build/browser';
7
+
8
+ /**
9
+ * Registration for mapping a built-in TSDoc tag onto a custom constraint when
10
+ * it is used on a particular custom type.
11
+ *
12
+ * @public
13
+ */
14
+ export declare interface BuiltinConstraintBroadeningRegistration {
15
+ /** The built-in tag being broadened, without the `@` prefix. */
16
+ readonly tagName: BuiltinConstraintName;
17
+ /** The custom constraint to emit for this built-in tag. */
18
+ readonly constraintName: string;
19
+ /** Parser from raw TSDoc text to extension payload. */
20
+ readonly parseValue: (raw: string) => ExtensionPayloadValue;
21
+ }
22
+
23
+ /**
24
+ * Registration for mapping a built-in TSDoc tag onto a custom constraint when
25
+ * it is used on a particular custom type.
26
+ *
27
+ * @public
28
+ */
29
+ declare interface BuiltinConstraintBroadeningRegistration_2 {
30
+ /** The built-in tag being broadened, without the `@` prefix. */
31
+ readonly tagName: BuiltinConstraintName$1;
32
+ /** The custom constraint to emit for this built-in tag. */
33
+ readonly constraintName: string;
34
+ /** Parser from raw TSDoc text to extension payload. */
35
+ readonly parseValue: (raw: string) => ExtensionPayloadValue$1;
36
+ }
37
+
38
+ /**
39
+ * Registration for mapping a built-in TSDoc tag onto a custom constraint when
40
+ * it is used on a particular custom type.
41
+ *
42
+ * @public
43
+ */
44
+ declare interface BuiltinConstraintBroadeningRegistration_3 {
45
+ /** The built-in tag being broadened, without the `@` prefix. */
46
+ readonly tagName: BuiltinConstraintName_2;
47
+ /** The custom constraint to emit for this built-in tag. */
48
+ readonly constraintName: string;
49
+ /** Parser from raw TSDoc text to extension payload. */
50
+ readonly parseValue: (raw: string) => ExtensionPayloadValue_2;
51
+ }
52
+
53
+ /**
54
+ * Type of a built-in constraint name.
55
+ *
56
+ * @public
57
+ */
58
+ declare type BuiltinConstraintName$1 = "const" | "enumOptions" | "exclusiveMaximum" | "exclusiveMinimum" | "maximum" | "maxItems" | "maxLength" | "minimum" | "minItems" | "minLength" | "multipleOf" | "pattern" | "uniqueItems";
59
+
60
+ /**
61
+ * Type of a built-in constraint name.
62
+ *
63
+ * @public
64
+ */
65
+ export declare type BuiltinConstraintName = "const" | "enumOptions" | "exclusiveMaximum" | "exclusiveMinimum" | "maximum" | "maxItems" | "maxLength" | "minimum" | "minItems" | "minLength" | "multipleOf" | "pattern" | "uniqueItems";
66
+
67
+ /**
68
+ * Type of a built-in constraint name.
69
+ *
70
+ * @public
71
+ */
72
+ declare type BuiltinConstraintName_2 = "const" | "enumOptions" | "exclusiveMaximum" | "exclusiveMinimum" | "maximum" | "maxItems" | "maxLength" | "minimum" | "minItems" | "minLength" | "multipleOf" | "pattern" | "uniqueItems";
73
+
74
+ /**
75
+ * A Categorization element (tab-based layout).
76
+ *
77
+ * @public
78
+ */
79
+ export declare interface Categorization {
80
+ /** Discriminator identifying a categorization layout. */
81
+ readonly type: "Categorization";
82
+ /** Categories rendered as tabs or steps. */
83
+ readonly elements: Category[];
84
+ /** Optional label for the overall categorization container. */
85
+ readonly label?: string | undefined;
86
+ /** Optional rule controlling visibility or enablement. */
87
+ readonly rule?: Rule | undefined;
88
+ /** Renderer-specific categorization options. */
89
+ readonly options?: Record<string, unknown> | undefined;
90
+ /** Additional renderer-specific extension properties. */
91
+ readonly [k: string]: unknown;
92
+ }
93
+
94
+ /**
95
+ * A Category element, used inside a Categorization layout.
96
+ *
97
+ * @public
98
+ */
99
+ export declare interface Category {
100
+ /** Discriminator identifying a category inside a categorization layout. */
101
+ readonly type: "Category";
102
+ /** Category label shown in tabs or step navigation. */
103
+ readonly label: string;
104
+ /** Child elements rendered inside the category. */
105
+ readonly elements: UISchemaElement[];
106
+ /** Optional rule controlling visibility or enablement. */
107
+ readonly rule?: Rule | undefined;
108
+ /** Renderer-specific category options. */
109
+ readonly options?: Record<string, unknown> | undefined;
110
+ /** Additional renderer-specific extension properties. */
111
+ readonly [k: string]: unknown;
112
+ }
113
+
114
+ /* Excluded from this release type: _ConfigSchemaResult */
115
+
116
+ /* Excluded from this release type: _ConfigTypeRef */
117
+
118
+ /* Excluded from this release type: _ConfigUiSchema */
119
+
120
+ /**
121
+ * Complete constraint configuration for a FormSpec project.
122
+ *
123
+ * @public
124
+ */
125
+ declare interface ConstraintConfig {
126
+ /** Field type constraints */
127
+ fieldTypes?: FieldTypeConstraints;
128
+ /** Layout and structure constraints */
129
+ layout?: LayoutConstraints;
130
+ /** UI Schema feature constraints */
131
+ uiSchema?: UISchemaConstraints;
132
+ /** Field configuration option constraints */
133
+ fieldOptions?: FieldOptionConstraints;
134
+ /** Control options constraints */
135
+ controlOptions?: ControlOptionConstraints;
136
+ }
137
+
138
+ /**
139
+ * Semantic metadata for ordered custom constraints that should participate in
140
+ * the generic contradiction/broadening logic.
141
+ *
142
+ * @public
143
+ */
144
+ declare interface ConstraintSemanticRole$1 {
145
+ /**
146
+ * Logical family identifier shared by related constraints, for example
147
+ * `"decimal-bound"` or `"date-bound"`.
148
+ */
149
+ readonly family: string;
150
+ /** Whether this constraint acts as a lower or upper bound. */
151
+ readonly bound: "exact" | "lower" | "upper";
152
+ /** Whether equality is allowed when comparing against the bound. */
153
+ readonly inclusive: boolean;
154
+ }
155
+
156
+ /**
157
+ * Semantic metadata for ordered custom constraints that should participate in
158
+ * the generic contradiction/broadening logic.
159
+ *
160
+ * @public
161
+ */
162
+ export declare interface ConstraintSemanticRole {
163
+ /**
164
+ * Logical family identifier shared by related constraints, for example
165
+ * `"decimal-bound"` or `"date-bound"`.
166
+ */
167
+ readonly family: string;
168
+ /** Whether this constraint acts as a lower or upper bound. */
169
+ readonly bound: "exact" | "lower" | "upper";
170
+ /** Whether equality is allowed when comparing against the bound. */
171
+ readonly inclusive: boolean;
172
+ }
173
+
174
+ /**
175
+ * Semantic metadata for ordered custom constraints that should participate in
176
+ * the generic contradiction/broadening logic.
177
+ *
178
+ * @public
179
+ */
180
+ declare interface ConstraintSemanticRole_2 {
181
+ /**
182
+ * Logical family identifier shared by related constraints, for example
183
+ * `"decimal-bound"` or `"date-bound"`.
184
+ */
185
+ readonly family: string;
186
+ /** Whether this constraint acts as a lower or upper bound. */
187
+ readonly bound: "exact" | "lower" | "upper";
188
+ /** Whether equality is allowed when comparing against the bound. */
189
+ readonly inclusive: boolean;
190
+ }
191
+
192
+ /**
193
+ * Declarative authoring-side registration for a custom TSDoc constraint tag.
194
+ *
195
+ * @public
196
+ */
197
+ export declare interface ConstraintTagRegistration {
198
+ /** Tag name without the `@` prefix, e.g. `"maxSigFig"`. */
199
+ readonly tagName: string;
200
+ /** The custom constraint that this tag should produce. */
201
+ readonly constraintName: string;
202
+ /** Parser from raw TSDoc text to JSON-serializable payload. */
203
+ readonly parseValue: (raw: string) => ExtensionPayloadValue;
204
+ /**
205
+ * Optional precise applicability predicate for the field type being parsed.
206
+ * When omitted, the target custom constraint registration controls type
207
+ * applicability during validation.
208
+ */
209
+ readonly isApplicableToType?: (type: ExtensionApplicableType) => boolean;
210
+ }
211
+
212
+ /**
213
+ * Declarative authoring-side registration for a custom TSDoc constraint tag.
214
+ *
215
+ * @public
216
+ */
217
+ declare interface ConstraintTagRegistration_2 {
218
+ /** Tag name without the `@` prefix, e.g. `"maxSigFig"`. */
219
+ readonly tagName: string;
220
+ /** The custom constraint that this tag should produce. */
221
+ readonly constraintName: string;
222
+ /** Parser from raw TSDoc text to JSON-serializable payload. */
223
+ readonly parseValue: (raw: string) => ExtensionPayloadValue$1;
224
+ /**
225
+ * Optional precise applicability predicate for the field type being parsed.
226
+ * When omitted, the target custom constraint registration controls type
227
+ * applicability during validation.
228
+ */
229
+ readonly isApplicableToType?: (type: ExtensionApplicableType$1) => boolean;
230
+ }
231
+
232
+ /**
233
+ * Declarative authoring-side registration for a custom TSDoc constraint tag.
234
+ *
235
+ * @public
236
+ */
237
+ declare interface ConstraintTagRegistration_3 {
238
+ /** Tag name without the `@` prefix, e.g. `"maxSigFig"`. */
239
+ readonly tagName: string;
240
+ /** The custom constraint that this tag should produce. */
241
+ readonly constraintName: string;
242
+ /** Parser from raw TSDoc text to JSON-serializable payload. */
243
+ readonly parseValue: (raw: string) => ExtensionPayloadValue_2;
244
+ /**
245
+ * Optional precise applicability predicate for the field type being parsed.
246
+ * When omitted, the target custom constraint registration controls type
247
+ * applicability during validation.
248
+ */
249
+ readonly isApplicableToType?: (type: ExtensionApplicableType_2) => boolean;
250
+ }
251
+
252
+ /**
253
+ * A Control element that binds to a JSON Schema property.
254
+ *
255
+ * @public
256
+ */
257
+ export declare interface ControlElement {
258
+ /** Discriminator identifying a JSON Forms control element. */
259
+ readonly type: "Control";
260
+ /** JSON Pointer scope that this control binds to. */
261
+ readonly scope: string;
262
+ /** Optional label override, or `false` to suppress the label. */
263
+ readonly label?: false | string | undefined;
264
+ /** Optional rule controlling visibility or enablement. */
265
+ readonly rule?: Rule | undefined;
266
+ /** Renderer-specific control options. */
267
+ readonly options?: Record<string, unknown> | undefined;
268
+ /** Additional renderer-specific extension properties. */
269
+ readonly [k: string]: unknown;
270
+ }
271
+
272
+ /**
273
+ * Control options constraints - control which JSONForms Control.options are allowed.
274
+ * These are renderer-specific options that may not be universally supported.
275
+ *
276
+ * @public
277
+ */
278
+ declare interface ControlOptionConstraints {
279
+ /** format - renderer format hint (e.g., "radio", "textarea") */
280
+ format?: Severity;
281
+ /** readonly - read-only mode */
282
+ readonly?: Severity;
283
+ /** multi - multi-select for enums */
284
+ multi?: Severity;
285
+ /** showUnfocusedDescription - show description when unfocused */
286
+ showUnfocusedDescription?: Severity;
287
+ /** hideRequiredAsterisk - hide required indicator */
288
+ hideRequiredAsterisk?: Severity;
289
+ /** Custom control options (extensible dictionary) */
290
+ custom?: Record<string, Severity>;
291
+ }
292
+
293
+ /**
294
+ * Registration for a custom annotation that may produce JSON Schema keywords.
295
+ *
296
+ * Custom annotations are referenced by FormSpec's internal custom-annotation nodes.
297
+ * They describe or present a field but do not affect which values are valid.
298
+ *
299
+ * @public
300
+ */
301
+ export declare interface CustomAnnotationRegistration {
302
+ /** The annotation name, unique within the extension. */
303
+ readonly annotationName: string;
304
+ /**
305
+ * Optionally converts the annotation value into JSON Schema keywords.
306
+ * If omitted, the annotation has no JSON Schema representation (UI-only).
307
+ */
308
+ readonly toJsonSchema?: (value: ExtensionPayloadValue, vendorPrefix: string) => Record<string, unknown>;
309
+ }
310
+
311
+ /**
312
+ * Registration for a custom annotation that may produce JSON Schema keywords.
313
+ *
314
+ * Custom annotations are referenced by FormSpec's internal custom-annotation nodes.
315
+ * They describe or present a field but do not affect which values are valid.
316
+ *
317
+ * @public
318
+ */
319
+ declare interface CustomAnnotationRegistration_2 {
320
+ /** The annotation name, unique within the extension. */
321
+ readonly annotationName: string;
322
+ /**
323
+ * Optionally converts the annotation value into JSON Schema keywords.
324
+ * If omitted, the annotation has no JSON Schema representation (UI-only).
325
+ */
326
+ readonly toJsonSchema?: (value: ExtensionPayloadValue$1, vendorPrefix: string) => Record<string, unknown>;
327
+ }
328
+
329
+ /**
330
+ * Registration for a custom annotation that may produce JSON Schema keywords.
331
+ *
332
+ * Custom annotations are referenced by FormSpec's internal custom-annotation nodes.
333
+ * They describe or present a field but do not affect which values are valid.
334
+ *
335
+ * @public
336
+ */
337
+ declare interface CustomAnnotationRegistration_3 {
338
+ /** The annotation name, unique within the extension. */
339
+ readonly annotationName: string;
340
+ /**
341
+ * Optionally converts the annotation value into JSON Schema keywords.
342
+ * If omitted, the annotation has no JSON Schema representation (UI-only).
343
+ */
344
+ readonly toJsonSchema?: (value: ExtensionPayloadValue_2, vendorPrefix: string) => Record<string, unknown>;
345
+ }
346
+
347
+ /**
348
+ * Registration for a custom constraint that maps to JSON Schema keywords.
349
+ *
350
+ * Custom constraints are referenced by FormSpec's internal custom-constraint nodes.
351
+ *
352
+ * @public
353
+ */
354
+ export declare interface CustomConstraintRegistration {
355
+ /** The constraint name, unique within the extension. */
356
+ readonly constraintName: string;
357
+ /**
358
+ * How this constraint composes with other constraints of the same kind.
359
+ * - "intersect": combine with logical AND (both must hold)
360
+ * - "override": last writer wins
361
+ */
362
+ readonly compositionRule: "intersect" | "override";
363
+ /**
364
+ * TypeNode kinds this constraint is applicable to, or `null` for any type.
365
+ * Used by the validator to emit TYPE_MISMATCH diagnostics.
366
+ */
367
+ readonly applicableTypes: null | readonly ExtensionApplicableType["kind"][];
368
+ /**
369
+ * Optional precise type predicate used when kind-level applicability is too
370
+ * broad (for example, constraints that apply to integer-like primitives but
371
+ * not strings).
372
+ */
373
+ readonly isApplicableToType?: (type: ExtensionApplicableType) => boolean;
374
+ /**
375
+ * Optional comparator for payloads belonging to the same custom constraint.
376
+ * Return values follow the `Array.prototype.sort()` contract.
377
+ */
378
+ readonly comparePayloads?: (left: ExtensionPayloadValue, right: ExtensionPayloadValue) => number;
379
+ /**
380
+ * Optional semantic family metadata for generic contradiction/broadening
381
+ * handling across ordered constraints.
382
+ */
383
+ readonly semanticRole?: ConstraintSemanticRole;
384
+ /**
385
+ * Converts the custom constraint's payload into JSON Schema keywords.
386
+ *
387
+ * @param payload - The opaque JSON payload stored on the custom constraint node.
388
+ * @param vendorPrefix - The vendor prefix for extension keywords.
389
+ * @returns A JSON Schema fragment with the constraint keywords.
390
+ */
391
+ readonly toJsonSchema: (payload: ExtensionPayloadValue, vendorPrefix: string) => Record<string, unknown>;
392
+ /**
393
+ * When true, `toJsonSchema` may emit vocabulary keywords that do not carry
394
+ * the vendor prefix. By default, all keys returned from `toJsonSchema` must
395
+ * start with `${vendorPrefix}-`; setting this flag relaxes that check so
396
+ * the constraint can produce standard or custom vocabulary keywords such as
397
+ * `decimalMinimum`.
398
+ *
399
+ * Use this for constraints that define their own JSON Schema vocabulary
400
+ * rather than namespacing under the vendor prefix.
401
+ */
402
+ readonly emitsVocabularyKeywords?: boolean;
403
+ }
404
+
405
+ /**
406
+ * Registration for a custom constraint that maps to JSON Schema keywords.
407
+ *
408
+ * Custom constraints are referenced by FormSpec's internal custom-constraint nodes.
409
+ *
410
+ * @public
411
+ */
412
+ declare interface CustomConstraintRegistration_2 {
413
+ /** The constraint name, unique within the extension. */
414
+ readonly constraintName: string;
415
+ /**
416
+ * How this constraint composes with other constraints of the same kind.
417
+ * - "intersect": combine with logical AND (both must hold)
418
+ * - "override": last writer wins
419
+ */
420
+ readonly compositionRule: "intersect" | "override";
421
+ /**
422
+ * TypeNode kinds this constraint is applicable to, or `null` for any type.
423
+ * Used by the validator to emit TYPE_MISMATCH diagnostics.
424
+ */
425
+ readonly applicableTypes: null | readonly ExtensionApplicableType$1["kind"][];
426
+ /**
427
+ * Optional precise type predicate used when kind-level applicability is too
428
+ * broad (for example, constraints that apply to integer-like primitives but
429
+ * not strings).
430
+ */
431
+ readonly isApplicableToType?: (type: ExtensionApplicableType$1) => boolean;
432
+ /**
433
+ * Optional comparator for payloads belonging to the same custom constraint.
434
+ * Return values follow the `Array.prototype.sort()` contract.
435
+ */
436
+ readonly comparePayloads?: (left: ExtensionPayloadValue$1, right: ExtensionPayloadValue$1) => number;
437
+ /**
438
+ * Optional semantic family metadata for generic contradiction/broadening
439
+ * handling across ordered constraints.
440
+ */
441
+ readonly semanticRole?: ConstraintSemanticRole$1;
442
+ /**
443
+ * Converts the custom constraint's payload into JSON Schema keywords.
444
+ *
445
+ * @param payload - The opaque JSON payload stored on the custom constraint node.
446
+ * @param vendorPrefix - The vendor prefix for extension keywords.
447
+ * @returns A JSON Schema fragment with the constraint keywords.
448
+ */
449
+ readonly toJsonSchema: (payload: ExtensionPayloadValue$1, vendorPrefix: string) => Record<string, unknown>;
450
+ /**
451
+ * When true, `toJsonSchema` may emit vocabulary keywords that do not carry
452
+ * the vendor prefix. By default, all keys returned from `toJsonSchema` must
453
+ * start with `${vendorPrefix}-`; setting this flag relaxes that check so
454
+ * the constraint can produce standard or custom vocabulary keywords such as
455
+ * `decimalMinimum`.
456
+ *
457
+ * Use this for constraints that define their own JSON Schema vocabulary
458
+ * rather than namespacing under the vendor prefix.
459
+ */
460
+ readonly emitsVocabularyKeywords?: boolean;
461
+ }
462
+
463
+ /**
464
+ * Registration for a custom constraint that maps to JSON Schema keywords.
465
+ *
466
+ * Custom constraints are referenced by FormSpec's internal custom-constraint nodes.
467
+ *
468
+ * @public
469
+ */
470
+ declare interface CustomConstraintRegistration_3 {
471
+ /** The constraint name, unique within the extension. */
472
+ readonly constraintName: string;
473
+ /**
474
+ * How this constraint composes with other constraints of the same kind.
475
+ * - "intersect": combine with logical AND (both must hold)
476
+ * - "override": last writer wins
477
+ */
478
+ readonly compositionRule: "intersect" | "override";
479
+ /**
480
+ * TypeNode kinds this constraint is applicable to, or `null` for any type.
481
+ * Used by the validator to emit TYPE_MISMATCH diagnostics.
482
+ */
483
+ readonly applicableTypes: null | readonly ExtensionApplicableType_2["kind"][];
484
+ /**
485
+ * Optional precise type predicate used when kind-level applicability is too
486
+ * broad (for example, constraints that apply to integer-like primitives but
487
+ * not strings).
488
+ */
489
+ readonly isApplicableToType?: (type: ExtensionApplicableType_2) => boolean;
490
+ /**
491
+ * Optional comparator for payloads belonging to the same custom constraint.
492
+ * Return values follow the `Array.prototype.sort()` contract.
493
+ */
494
+ readonly comparePayloads?: (left: ExtensionPayloadValue_2, right: ExtensionPayloadValue_2) => number;
495
+ /**
496
+ * Optional semantic family metadata for generic contradiction/broadening
497
+ * handling across ordered constraints.
498
+ */
499
+ readonly semanticRole?: ConstraintSemanticRole_2;
500
+ /**
501
+ * Converts the custom constraint's payload into JSON Schema keywords.
502
+ *
503
+ * @param payload - The opaque JSON payload stored on the custom constraint node.
504
+ * @param vendorPrefix - The vendor prefix for extension keywords.
505
+ * @returns A JSON Schema fragment with the constraint keywords.
506
+ */
507
+ readonly toJsonSchema: (payload: ExtensionPayloadValue_2, vendorPrefix: string) => Record<string, unknown>;
508
+ /**
509
+ * When true, `toJsonSchema` may emit vocabulary keywords that do not carry
510
+ * the vendor prefix. By default, all keys returned from `toJsonSchema` must
511
+ * start with `${vendorPrefix}-`; setting this flag relaxes that check so
512
+ * the constraint can produce standard or custom vocabulary keywords such as
513
+ * `decimalMinimum`.
514
+ *
515
+ * Use this for constraints that define their own JSON Schema vocabulary
516
+ * rather than namespacing under the vendor prefix.
517
+ */
518
+ readonly emitsVocabularyKeywords?: boolean;
519
+ }
520
+
521
+ /**
522
+ * Registration for a custom type that maps to a JSON Schema representation.
523
+ *
524
+ * Custom types are referenced by FormSpec's internal custom-type IR nodes and
525
+ * resolved to JSON Schema via `toJsonSchema` during generation.
526
+ *
527
+ * @public
528
+ */
529
+ export declare interface CustomTypeRegistration {
530
+ /** The type name, unique within the extension. */
531
+ readonly typeName: string;
532
+ /**
533
+ * Optional TypeScript surface names that should resolve to this custom type
534
+ * during TSDoc/class analysis. Defaults to `typeName` when omitted.
535
+ * @deprecated Prefer `brand` for structural detection or type parameters
536
+ * on `defineCustomType<T>()` for symbol-based detection. String name
537
+ * matching will be removed in a future major version.
538
+ */
539
+ readonly tsTypeNames?: readonly string[];
540
+ /**
541
+ * Optional brand identifier for structural type detection.
542
+ *
543
+ * When provided, the type resolver checks `type.getProperties()` for a
544
+ * computed property whose name matches this identifier. This is more
545
+ * reliable than `tsTypeNames` for aliased branded types because it does not
546
+ * depend on the local type name.
547
+ *
548
+ * Brand detection is attempted after name-based resolution (`tsTypeNames`)
549
+ * as a structural fallback. If both match, name-based resolution wins.
550
+ *
551
+ * The value should match the identifier text of a `unique symbol` declaration
552
+ * used as a computed property key on the branded type. For example, if the
553
+ * type is `string & { readonly [__decimalBrand]: true }`, the brand is
554
+ * `"__decimalBrand"`.
555
+ *
556
+ * Brand identifiers are stored as plain strings in the extension registry, so
557
+ * they must be unique across the extensions loaded into the same build.
558
+ *
559
+ * Note: `"__integerBrand"` is reserved for the builtin Integer type.
560
+ */
561
+ readonly brand?: string;
562
+ /**
563
+ * Converts the custom type's payload into a JSON Schema fragment.
564
+ *
565
+ * @param payload - The opaque JSON payload stored on the custom type node.
566
+ * @param vendorPrefix - The vendor prefix for extension keywords (e.g., "x-stripe").
567
+ * @returns A JSON Schema fragment representing this type.
568
+ */
569
+ readonly toJsonSchema: (payload: ExtensionPayloadValue, vendorPrefix: string) => Record<string, unknown>;
570
+ /* Excluded from this release type: serializeDefault */
571
+ /**
572
+ * Optional broadening of built-in constraint tags so they can apply to this
573
+ * custom type without modifying the core built-in constraint tables.
574
+ */
575
+ readonly builtinConstraintBroadenings?: readonly BuiltinConstraintBroadeningRegistration[];
576
+ }
577
+
578
+ /**
579
+ * Registration for a custom type that maps to a JSON Schema representation.
580
+ *
581
+ * Custom types are referenced by FormSpec's internal custom-type IR nodes and
582
+ * resolved to JSON Schema via `toJsonSchema` during generation.
583
+ *
584
+ * @public
585
+ */
586
+ declare interface CustomTypeRegistration_2 {
587
+ /** The type name, unique within the extension. */
588
+ readonly typeName: string;
589
+ /**
590
+ * Optional TypeScript surface names that should resolve to this custom type
591
+ * during TSDoc/class analysis. Defaults to `typeName` when omitted.
592
+ * @deprecated Prefer `brand` for structural detection or type parameters
593
+ * on `defineCustomType<T>()` for symbol-based detection. String name
594
+ * matching will be removed in a future major version.
595
+ */
596
+ readonly tsTypeNames?: readonly string[];
597
+ /**
598
+ * Optional brand identifier for structural type detection.
599
+ *
600
+ * When provided, the type resolver checks `type.getProperties()` for a
601
+ * computed property whose name matches this identifier. This is more
602
+ * reliable than `tsTypeNames` for aliased branded types because it does not
603
+ * depend on the local type name.
604
+ *
605
+ * Brand detection is attempted after name-based resolution (`tsTypeNames`)
606
+ * as a structural fallback. If both match, name-based resolution wins.
607
+ *
608
+ * The value should match the identifier text of a `unique symbol` declaration
609
+ * used as a computed property key on the branded type. For example, if the
610
+ * type is `string & { readonly [__decimalBrand]: true }`, the brand is
611
+ * `"__decimalBrand"`.
612
+ *
613
+ * Brand identifiers are stored as plain strings in the extension registry, so
614
+ * they must be unique across the extensions loaded into the same build.
615
+ *
616
+ * Note: `"__integerBrand"` is reserved for the builtin Integer type.
617
+ */
618
+ readonly brand?: string;
619
+ /**
620
+ * Converts the custom type's payload into a JSON Schema fragment.
621
+ *
622
+ * @param payload - The opaque JSON payload stored on the custom type node.
623
+ * @param vendorPrefix - The vendor prefix for extension keywords (e.g., "x-stripe").
624
+ * @returns A JSON Schema fragment representing this type.
625
+ */
626
+ readonly toJsonSchema: (payload: ExtensionPayloadValue$1, vendorPrefix: string) => Record<string, unknown>;
627
+ /* Excluded from this release type: serializeDefault */
628
+ /**
629
+ * Optional broadening of built-in constraint tags so they can apply to this
630
+ * custom type without modifying the core built-in constraint tables.
631
+ */
632
+ readonly builtinConstraintBroadenings?: readonly BuiltinConstraintBroadeningRegistration_2[];
633
+ }
634
+
635
+ /**
636
+ * Registration for a custom type that maps to a JSON Schema representation.
637
+ *
638
+ * Custom types are referenced by FormSpec's internal custom-type IR nodes and
639
+ * resolved to JSON Schema via `toJsonSchema` during generation.
640
+ *
641
+ * @public
642
+ */
643
+ declare interface CustomTypeRegistration_3 {
644
+ /** The type name, unique within the extension. */
645
+ readonly typeName: string;
646
+ /**
647
+ * Optional TypeScript surface names that should resolve to this custom type
648
+ * during TSDoc/class analysis. Defaults to `typeName` when omitted.
649
+ * @deprecated Prefer `brand` for structural detection or type parameters
650
+ * on `defineCustomType<T>()` for symbol-based detection. String name
651
+ * matching will be removed in a future major version.
652
+ */
653
+ readonly tsTypeNames?: readonly string[];
654
+ /**
655
+ * Optional brand identifier for structural type detection.
656
+ *
657
+ * When provided, the type resolver checks `type.getProperties()` for a
658
+ * computed property whose name matches this identifier. This is more
659
+ * reliable than `tsTypeNames` for aliased branded types because it does not
660
+ * depend on the local type name.
661
+ *
662
+ * Brand detection is attempted after name-based resolution (`tsTypeNames`)
663
+ * as a structural fallback. If both match, name-based resolution wins.
664
+ *
665
+ * The value should match the identifier text of a `unique symbol` declaration
666
+ * used as a computed property key on the branded type. For example, if the
667
+ * type is `string & { readonly [__decimalBrand]: true }`, the brand is
668
+ * `"__decimalBrand"`.
669
+ *
670
+ * Brand identifiers are stored as plain strings in the extension registry, so
671
+ * they must be unique across the extensions loaded into the same build.
672
+ *
673
+ * Note: `"__integerBrand"` is reserved for the builtin Integer type.
674
+ */
675
+ readonly brand?: string;
676
+ /**
677
+ * Converts the custom type's payload into a JSON Schema fragment.
678
+ *
679
+ * @param payload - The opaque JSON payload stored on the custom type node.
680
+ * @param vendorPrefix - The vendor prefix for extension keywords (e.g., "x-stripe").
681
+ * @returns A JSON Schema fragment representing this type.
682
+ */
683
+ readonly toJsonSchema: (payload: ExtensionPayloadValue_2, vendorPrefix: string) => Record<string, unknown>;
684
+ /* Excluded from this release type: serializeDefault */
685
+ /**
686
+ * Optional broadening of built-in constraint tags so they can apply to this
687
+ * custom type without modifying the core built-in constraint tables.
688
+ */
689
+ readonly builtinConstraintBroadenings?: readonly BuiltinConstraintBroadeningRegistration_3[];
690
+ }
691
+
692
+ /**
693
+ * Per-declaration metadata policy input.
694
+ *
695
+ * @public
696
+ */
697
+ declare interface DeclarationMetadataPolicyInput$1 {
698
+ /** Policy for JSON-facing serialized names. */
699
+ readonly apiName?: MetadataValuePolicyInput$1 | undefined;
700
+ /** Policy for human-facing labels and titles. */
701
+ readonly displayName?: MetadataValuePolicyInput$1 | undefined;
702
+ }
703
+
704
+ /**
705
+ * Per-declaration metadata policy input.
706
+ *
707
+ * @public
708
+ */
709
+ declare interface DeclarationMetadataPolicyInput$2 {
710
+ /** Policy for JSON-facing serialized names. */
711
+ readonly apiName?: MetadataValuePolicyInput$2 | undefined;
712
+ /** Policy for human-facing labels and titles. */
713
+ readonly displayName?: MetadataValuePolicyInput$2 | undefined;
714
+ }
715
+
716
+ /**
717
+ * Per-declaration metadata policy input.
718
+ *
719
+ * @public
720
+ */
721
+ export declare interface DeclarationMetadataPolicyInput {
722
+ /** Policy for JSON-facing serialized names. */
723
+ readonly apiName?: MetadataValuePolicyInput | undefined;
724
+ /** Policy for human-facing labels and titles. */
725
+ readonly displayName?: MetadataValuePolicyInput | undefined;
726
+ }
727
+
728
+ /**
729
+ * Discriminator-specific schema generation options.
730
+ *
731
+ * @public
732
+ */
733
+ export declare interface DiscriminatorResolutionOptions {
734
+ /**
735
+ * Optional prefix applied only to metadata-derived discriminator values.
736
+ *
737
+ * Literal discriminator identities taken directly from a bound type remain
738
+ * unchanged.
739
+ */
740
+ readonly apiNamePrefix?: string | undefined;
741
+ }
742
+
743
+ /**
744
+ * Enum-member display names remain unset unless authored explicitly.
745
+ *
746
+ * @public
747
+ */
748
+ declare interface EnumMemberDisplayNameDisabledPolicyInput$1 {
749
+ /** Leaves missing enum-member display names unresolved. */
750
+ readonly mode: "disabled";
751
+ }
752
+
753
+ /**
754
+ * Enum-member display names remain unset unless authored explicitly.
755
+ *
756
+ * @public
757
+ */
758
+ declare interface EnumMemberDisplayNameDisabledPolicyInput$2 {
759
+ /** Leaves missing enum-member display names unresolved. */
760
+ readonly mode: "disabled";
761
+ }
762
+
763
+ /**
764
+ * Enum-member display names remain unset unless authored explicitly.
765
+ *
766
+ * @public
767
+ */
768
+ declare interface EnumMemberDisplayNameDisabledPolicyInput {
769
+ /** Leaves missing enum-member display names unresolved. */
770
+ readonly mode: "disabled";
771
+ }
772
+
773
+ /**
774
+ * Missing enum-member display names may be inferred.
775
+ *
776
+ * @public
777
+ */
778
+ declare interface EnumMemberDisplayNameInferIfMissingPolicyInput$1 {
779
+ /** Infers an enum-member display name when it is not authored explicitly. */
780
+ readonly mode: "infer-if-missing";
781
+ /** Callback used to infer the missing display name. */
782
+ readonly infer: EnumMemberMetadataInferenceFn$1;
783
+ }
784
+
785
+ /**
786
+ * Missing enum-member display names may be inferred.
787
+ *
788
+ * @public
789
+ */
790
+ declare interface EnumMemberDisplayNameInferIfMissingPolicyInput$2 {
791
+ /** Infers an enum-member display name when it is not authored explicitly. */
792
+ readonly mode: "infer-if-missing";
793
+ /** Callback used to infer the missing display name. */
794
+ readonly infer: EnumMemberMetadataInferenceFn$2;
795
+ }
796
+
797
+ /**
798
+ * Missing enum-member display names may be inferred.
799
+ *
800
+ * @public
801
+ */
802
+ declare interface EnumMemberDisplayNameInferIfMissingPolicyInput {
803
+ /** Infers an enum-member display name when it is not authored explicitly. */
804
+ readonly mode: "infer-if-missing";
805
+ /** Callback used to infer the missing display name. */
806
+ readonly infer: EnumMemberMetadataInferenceFn;
807
+ }
808
+
809
+ /**
810
+ * Enum-member display-name policy input.
811
+ *
812
+ * @public
813
+ */
814
+ declare type EnumMemberDisplayNamePolicyInput$1 = EnumMemberDisplayNameDisabledPolicyInput$1 | EnumMemberDisplayNameInferIfMissingPolicyInput$1 | EnumMemberDisplayNameRequireExplicitPolicyInput$1;
815
+
816
+ /**
817
+ * Enum-member display-name policy input.
818
+ *
819
+ * @public
820
+ */
821
+ declare type EnumMemberDisplayNamePolicyInput$2 = EnumMemberDisplayNameDisabledPolicyInput$2 | EnumMemberDisplayNameInferIfMissingPolicyInput$2 | EnumMemberDisplayNameRequireExplicitPolicyInput$2;
822
+
823
+ /**
824
+ * Enum-member display-name policy input.
825
+ *
826
+ * @public
827
+ */
828
+ declare type EnumMemberDisplayNamePolicyInput = EnumMemberDisplayNameDisabledPolicyInput | EnumMemberDisplayNameInferIfMissingPolicyInput | EnumMemberDisplayNameRequireExplicitPolicyInput;
829
+
830
+ /**
831
+ * Enum members must declare display names explicitly.
832
+ *
833
+ * @public
834
+ */
835
+ declare interface EnumMemberDisplayNameRequireExplicitPolicyInput$1 {
836
+ /** Fails when an enum member has no authored display name. */
837
+ readonly mode: "require-explicit";
838
+ }
839
+
840
+ /**
841
+ * Enum members must declare display names explicitly.
842
+ *
843
+ * @public
844
+ */
845
+ declare interface EnumMemberDisplayNameRequireExplicitPolicyInput$2 {
846
+ /** Fails when an enum member has no authored display name. */
847
+ readonly mode: "require-explicit";
848
+ }
849
+
850
+ /**
851
+ * Enum members must declare display names explicitly.
852
+ *
853
+ * @public
854
+ */
855
+ declare interface EnumMemberDisplayNameRequireExplicitPolicyInput {
856
+ /** Fails when an enum member has no authored display name. */
857
+ readonly mode: "require-explicit";
858
+ }
859
+
860
+ /**
861
+ * Build-facing context passed to enum-member metadata inference callbacks.
862
+ *
863
+ * Enum members are resolved separately from declaration-level metadata so they
864
+ * do not participate in the shared declaration-kind model used by TSDoc and
865
+ * extension metadata slots.
866
+ *
867
+ * @public
868
+ */
869
+ declare interface EnumMemberMetadataInferenceContext$1 {
870
+ /** Authoring surface the enum originated from. */
871
+ readonly surface: MetadataAuthoringSurface_2;
872
+ /** Logical member identifier used for policy inference. */
873
+ readonly logicalName: string;
874
+ /** Underlying enum value before stringification. */
875
+ readonly memberValue: number | string;
876
+ /** Optional build-only context supplied by the resolver. */
877
+ readonly buildContext?: unknown;
878
+ }
879
+
880
+ /**
881
+ * Build-facing context passed to enum-member metadata inference callbacks.
882
+ *
883
+ * Enum members are resolved separately from declaration-level metadata so they
884
+ * do not participate in the shared declaration-kind model used by TSDoc and
885
+ * extension metadata slots.
886
+ *
887
+ * @public
888
+ */
889
+ declare interface EnumMemberMetadataInferenceContext$2 {
890
+ /** Authoring surface the enum originated from. */
891
+ readonly surface: MetadataAuthoringSurface$2;
892
+ /** Logical member identifier used for policy inference. */
893
+ readonly logicalName: string;
894
+ /** Underlying enum value before stringification. */
895
+ readonly memberValue: number | string;
896
+ /** Optional build-only context supplied by the resolver. */
897
+ readonly buildContext?: unknown;
898
+ }
899
+
900
+ /**
901
+ * Build-facing context passed to enum-member metadata inference callbacks.
902
+ *
903
+ * Enum members are resolved separately from declaration-level metadata so they
904
+ * do not participate in the shared declaration-kind model used by TSDoc and
905
+ * extension metadata slots.
906
+ *
907
+ * @public
908
+ */
909
+ declare interface EnumMemberMetadataInferenceContext {
910
+ /** Authoring surface the enum originated from. */
911
+ readonly surface: MetadataAuthoringSurface;
912
+ /** Logical member identifier used for policy inference. */
913
+ readonly logicalName: string;
914
+ /** Underlying enum value before stringification. */
915
+ readonly memberValue: number | string;
916
+ /** Optional build-only context supplied by the resolver. */
917
+ readonly buildContext?: unknown;
918
+ }
919
+
920
+ /**
921
+ * Callback used to infer enum-member display names.
922
+ *
923
+ * @public
924
+ */
925
+ declare type EnumMemberMetadataInferenceFn$1 = (context: EnumMemberMetadataInferenceContext$1) => string;
926
+
927
+ /**
928
+ * Callback used to infer enum-member display names.
929
+ *
930
+ * @public
931
+ */
932
+ declare type EnumMemberMetadataInferenceFn$2 = (context: EnumMemberMetadataInferenceContext$2) => string;
933
+
934
+ /**
935
+ * Callback used to infer enum-member display names.
936
+ *
937
+ * @public
938
+ */
939
+ declare type EnumMemberMetadataInferenceFn = (context: EnumMemberMetadataInferenceContext) => string;
940
+
941
+ /**
942
+ * User-facing enum-member metadata policy input.
943
+ *
944
+ * @public
945
+ */
946
+ declare interface EnumMemberMetadataPolicyInput$1 {
947
+ /** Policy for human-facing enum-member labels. */
948
+ readonly displayName?: EnumMemberDisplayNamePolicyInput$1 | undefined;
949
+ }
950
+
951
+ /**
952
+ * User-facing enum-member metadata policy input.
953
+ *
954
+ * @public
955
+ */
956
+ declare interface EnumMemberMetadataPolicyInput$2 {
957
+ /** Policy for human-facing enum-member labels. */
958
+ readonly displayName?: EnumMemberDisplayNamePolicyInput$2 | undefined;
959
+ }
960
+
961
+ /**
962
+ * User-facing enum-member metadata policy input.
963
+ *
964
+ * @public
965
+ */
966
+ export declare interface EnumMemberMetadataPolicyInput {
967
+ /** Policy for human-facing enum-member labels. */
968
+ readonly displayName?: EnumMemberDisplayNamePolicyInput | undefined;
969
+ }
970
+
971
+ export { ExtendedJSONSchema7 }
972
+
973
+ /**
974
+ * A curated type shape exposed to extension applicability hooks.
975
+ *
976
+ * This intentionally exposes only the fields needed to determine tag/type
977
+ * applicability without committing the entire canonical IR as public API.
978
+ *
979
+ * @public
980
+ */
981
+ declare type ExtensionApplicableType$1 = {
982
+ readonly kind: "custom";
983
+ readonly payload: ExtensionPayloadValue$1;
984
+ readonly typeId: string;
985
+ } | {
986
+ readonly kind: "primitive";
987
+ readonly primitiveKind: "bigint" | "boolean" | "integer" | "null" | "number" | "string";
988
+ } | { readonly kind: Exclude<ExtensionTypeKind$1, "custom" | "primitive"> };
989
+
990
+ /**
991
+ * A curated type shape exposed to extension applicability hooks.
992
+ *
993
+ * This intentionally exposes only the fields needed to determine tag/type
994
+ * applicability without committing the entire canonical IR as public API.
995
+ *
996
+ * @public
997
+ */
998
+ export declare type ExtensionApplicableType = {
999
+ readonly kind: "custom";
1000
+ readonly payload: ExtensionPayloadValue;
1001
+ readonly typeId: string;
1002
+ } | {
1003
+ readonly kind: "primitive";
1004
+ readonly primitiveKind: "bigint" | "boolean" | "integer" | "null" | "number" | "string";
1005
+ } | { readonly kind: Exclude<ExtensionTypeKind, "custom" | "primitive"> };
1006
+
1007
+ /**
1008
+ * A curated type shape exposed to extension applicability hooks.
1009
+ *
1010
+ * This intentionally exposes only the fields needed to determine tag/type
1011
+ * applicability without committing the entire canonical IR as public API.
1012
+ *
1013
+ * @public
1014
+ */
1015
+ declare type ExtensionApplicableType_2 = {
1016
+ readonly kind: "custom";
1017
+ readonly payload: ExtensionPayloadValue_2;
1018
+ readonly typeId: string;
1019
+ } | {
1020
+ readonly kind: "primitive";
1021
+ readonly primitiveKind: "bigint" | "boolean" | "integer" | "null" | "number" | "string";
1022
+ } | { readonly kind: Exclude<ExtensionTypeKind_2, "custom" | "primitive"> };
1023
+
1024
+ /**
1025
+ * A complete extension definition bundling types, constraints, annotations,
1026
+ * and vocabulary keywords.
1027
+ *
1028
+ * @example
1029
+ * ```typescript
1030
+ * const monetaryExtension = defineExtension({
1031
+ * extensionId: "x-stripe/monetary",
1032
+ * types: [
1033
+ * defineCustomType({
1034
+ * typeName: "Decimal",
1035
+ * toJsonSchema: (_payload, prefix) => ({
1036
+ * type: "string",
1037
+ * [`${prefix}-decimal`]: true,
1038
+ * }),
1039
+ * }),
1040
+ * ],
1041
+ * });
1042
+ * ```
1043
+ *
1044
+ * @public
1045
+ */
1046
+ export declare interface ExtensionDefinition {
1047
+ /** Globally unique extension identifier, e.g., "x-stripe/monetary". */
1048
+ readonly extensionId: string;
1049
+ /** Custom type registrations provided by this extension. */
1050
+ readonly types?: readonly CustomTypeRegistration[];
1051
+ /** Custom constraint registrations provided by this extension. */
1052
+ readonly constraints?: readonly CustomConstraintRegistration[];
1053
+ /** Authoring-side TSDoc tag registrations provided by this extension. */
1054
+ readonly constraintTags?: readonly ConstraintTagRegistration[];
1055
+ /** Metadata-slot registrations shared by build- and lint-time analysis. */
1056
+ readonly metadataSlots?: readonly MetadataSlotRegistration[];
1057
+ /** Custom annotation registrations provided by this extension. */
1058
+ readonly annotations?: readonly CustomAnnotationRegistration[];
1059
+ /** Vocabulary keyword registrations provided by this extension. */
1060
+ readonly vocabularyKeywords?: readonly VocabularyKeywordRegistration[];
1061
+ }
1062
+
1063
+ /**
1064
+ * A complete extension definition bundling types, constraints, annotations,
1065
+ * and vocabulary keywords.
1066
+ *
1067
+ * @example
1068
+ * ```typescript
1069
+ * const monetaryExtension = defineExtension({
1070
+ * extensionId: "x-stripe/monetary",
1071
+ * types: [
1072
+ * defineCustomType({
1073
+ * typeName: "Decimal",
1074
+ * toJsonSchema: (_payload, prefix) => ({
1075
+ * type: "string",
1076
+ * [`${prefix}-decimal`]: true,
1077
+ * }),
1078
+ * }),
1079
+ * ],
1080
+ * });
1081
+ * ```
1082
+ *
1083
+ * @public
1084
+ */
1085
+ declare interface ExtensionDefinition_2 {
1086
+ /** Globally unique extension identifier, e.g., "x-stripe/monetary". */
1087
+ readonly extensionId: string;
1088
+ /** Custom type registrations provided by this extension. */
1089
+ readonly types?: readonly CustomTypeRegistration_2[];
1090
+ /** Custom constraint registrations provided by this extension. */
1091
+ readonly constraints?: readonly CustomConstraintRegistration_2[];
1092
+ /** Authoring-side TSDoc tag registrations provided by this extension. */
1093
+ readonly constraintTags?: readonly ConstraintTagRegistration_2[];
1094
+ /** Metadata-slot registrations shared by build- and lint-time analysis. */
1095
+ readonly metadataSlots?: readonly MetadataSlotRegistration$1[];
1096
+ /** Custom annotation registrations provided by this extension. */
1097
+ readonly annotations?: readonly CustomAnnotationRegistration_2[];
1098
+ /** Vocabulary keyword registrations provided by this extension. */
1099
+ readonly vocabularyKeywords?: readonly VocabularyKeywordRegistration$1[];
1100
+ }
1101
+
1102
+ /**
1103
+ * A complete extension definition bundling types, constraints, annotations,
1104
+ * and vocabulary keywords.
1105
+ *
1106
+ * @example
1107
+ * ```typescript
1108
+ * const monetaryExtension = defineExtension({
1109
+ * extensionId: "x-stripe/monetary",
1110
+ * types: [
1111
+ * defineCustomType({
1112
+ * typeName: "Decimal",
1113
+ * toJsonSchema: (_payload, prefix) => ({
1114
+ * type: "string",
1115
+ * [`${prefix}-decimal`]: true,
1116
+ * }),
1117
+ * }),
1118
+ * ],
1119
+ * });
1120
+ * ```
1121
+ *
1122
+ * @public
1123
+ */
1124
+ declare interface ExtensionDefinition_3 {
1125
+ /** Globally unique extension identifier, e.g., "x-stripe/monetary". */
1126
+ readonly extensionId: string;
1127
+ /** Custom type registrations provided by this extension. */
1128
+ readonly types?: readonly CustomTypeRegistration_3[];
1129
+ /** Custom constraint registrations provided by this extension. */
1130
+ readonly constraints?: readonly CustomConstraintRegistration_3[];
1131
+ /** Authoring-side TSDoc tag registrations provided by this extension. */
1132
+ readonly constraintTags?: readonly ConstraintTagRegistration_3[];
1133
+ /** Metadata-slot registrations shared by build- and lint-time analysis. */
1134
+ readonly metadataSlots?: readonly MetadataSlotRegistration_2[];
1135
+ /** Custom annotation registrations provided by this extension. */
1136
+ readonly annotations?: readonly CustomAnnotationRegistration_3[];
1137
+ /** Vocabulary keyword registrations provided by this extension. */
1138
+ readonly vocabularyKeywords?: readonly VocabularyKeywordRegistration_2[];
1139
+ }
1140
+
1141
+ /**
1142
+ * A JSON-serializable payload value used by extension registration hooks.
1143
+ *
1144
+ * @public
1145
+ */
1146
+ declare type ExtensionPayloadValue$1 = { readonly [key: string]: ExtensionPayloadValue$1 } | boolean | null | number | readonly ExtensionPayloadValue$1[] | string;
1147
+
1148
+ /**
1149
+ * A JSON-serializable payload value used by extension registration hooks.
1150
+ *
1151
+ * @public
1152
+ */
1153
+ export declare type ExtensionPayloadValue = { readonly [key: string]: ExtensionPayloadValue } | boolean | null | number | readonly ExtensionPayloadValue[] | string;
1154
+
1155
+ /**
1156
+ * A JSON-serializable payload value used by extension registration hooks.
1157
+ *
1158
+ * @public
1159
+ */
1160
+ declare type ExtensionPayloadValue_2 = { readonly [key: string]: ExtensionPayloadValue_2 } | boolean | null | number | readonly ExtensionPayloadValue_2[] | string;
1161
+
1162
+ /**
1163
+ * A registry of extensions that provides lookup by fully-qualified ID.
1164
+ *
1165
+ * Type IDs follow the format: `<extensionId>/<typeName>`
1166
+ * Constraint IDs follow the format: `<extensionId>/<constraintName>`
1167
+ * Annotation IDs follow the format: `<extensionId>/<annotationName>`
1168
+ *
1169
+ * @public
1170
+ */
1171
+ export declare interface ExtensionRegistry {
1172
+ /** The extensions registered in this registry (in registration order). */
1173
+ readonly extensions: readonly ExtensionDefinition_2[];
1174
+ /* Excluded from this release type: setupDiagnostics */
1175
+ /**
1176
+ * Look up a custom type registration by its fully-qualified type ID.
1177
+ *
1178
+ * @param typeId - The fully-qualified type ID (e.g., "x-stripe/monetary/Decimal").
1179
+ * @returns The registration if found, otherwise `undefined`.
1180
+ */
1181
+ findType(typeId: string): CustomTypeRegistration_2 | undefined;
1182
+ /**
1183
+ * Look up a custom type registration by a TypeScript-facing type name.
1184
+ *
1185
+ * This is used during TSDoc/class analysis to resolve extension-defined
1186
+ * custom types from source-level declarations.
1187
+ */
1188
+ findTypeByName(typeName: string): ExtensionTypeLookupResult | undefined;
1189
+ /**
1190
+ * Look up a custom type registration by a brand identifier.
1191
+ *
1192
+ * This is used during class analysis to resolve extension-defined custom types
1193
+ * via structural brand detection (`unique symbol` computed property keys).
1194
+ * Brand identifiers are stored as plain strings, so they must be unique
1195
+ * across all extensions loaded into the registry.
1196
+ *
1197
+ * @param brand - The identifier text of the `unique symbol` brand variable.
1198
+ */
1199
+ findTypeByBrand(brand: string): ExtensionTypeLookupResult | undefined;
1200
+ /**
1201
+ * Look up a custom type by its TypeScript symbol identity.
1202
+ *
1203
+ * Built from `defineCustomType<T>()` type parameter extraction in the config file.
1204
+ * This is the most precise detection path — it uses `ts.Symbol` identity, which is
1205
+ * immune to import aliases and name collisions.
1206
+ *
1207
+ * Returns `undefined` until {@link MutableExtensionRegistry.setSymbolMap} has been
1208
+ * called (i.e., before the TypeScript program is available), or when the symbol is
1209
+ * not registered via a type parameter.
1210
+ *
1211
+ * @param symbol - The canonical TypeScript symbol to look up.
1212
+ */
1213
+ findTypeBySymbol(symbol: ts.Symbol): ExtensionTypeLookupResult | undefined;
1214
+ /**
1215
+ * Look up a custom constraint registration by its fully-qualified constraint ID.
1216
+ *
1217
+ * @param constraintId - The fully-qualified constraint ID.
1218
+ * @returns The registration if found, otherwise `undefined`.
1219
+ */
1220
+ findConstraint(constraintId: string): CustomConstraintRegistration_2 | undefined;
1221
+ /**
1222
+ * Look up a TSDoc custom constraint-tag registration by tag name.
1223
+ */
1224
+ findConstraintTag(tagName: string): {
1225
+ readonly extensionId: string;
1226
+ readonly registration: ConstraintTagRegistration_2;
1227
+ } | undefined;
1228
+ /**
1229
+ * Look up built-in tag broadening for a given custom type ID.
1230
+ */
1231
+ findBuiltinConstraintBroadening(typeId: string, tagName: string): {
1232
+ readonly extensionId: string;
1233
+ readonly registration: BuiltinConstraintBroadeningRegistration_2;
1234
+ } | undefined;
1235
+ /**
1236
+ * Look up a custom annotation registration by its fully-qualified annotation ID.
1237
+ *
1238
+ * @param annotationId - The fully-qualified annotation ID.
1239
+ * @returns The registration if found, otherwise `undefined`.
1240
+ */
1241
+ findAnnotation(annotationId: string): CustomAnnotationRegistration_2 | undefined;
1242
+ }
1243
+
1244
+ /**
1245
+ * Top-level type kinds that extension applicability hooks may inspect.
1246
+ *
1247
+ * @public
1248
+ */
1249
+ declare type ExtensionTypeKind$1 = "array" | "custom" | "dynamic" | "enum" | "object" | "primitive" | "record" | "reference" | "union";
1250
+
1251
+ /**
1252
+ * Top-level type kinds that extension applicability hooks may inspect.
1253
+ *
1254
+ * @public
1255
+ */
1256
+ export declare type ExtensionTypeKind = "array" | "custom" | "dynamic" | "enum" | "object" | "primitive" | "record" | "reference" | "union";
1257
+
1258
+ /**
1259
+ * Top-level type kinds that extension applicability hooks may inspect.
1260
+ *
1261
+ * @public
1262
+ */
1263
+ declare type ExtensionTypeKind_2 = "array" | "custom" | "dynamic" | "enum" | "object" | "primitive" | "record" | "reference" | "union";
1264
+
1265
+ /**
1266
+ * The result of a successful extension type lookup.
1267
+ *
1268
+ * Returned by {@link ExtensionRegistry.findTypeByName},
1269
+ * {@link ExtensionRegistry.findTypeByBrand}, and
1270
+ * {@link ExtensionRegistry.findTypeBySymbol}.
1271
+ *
1272
+ * @public
1273
+ */
1274
+ export declare interface ExtensionTypeLookupResult {
1275
+ /** The fully-qualified extension ID (e.g., "x-stripe/monetary"). */
1276
+ readonly extensionId: string;
1277
+ /** The custom type registration matched by this lookup. */
1278
+ readonly registration: CustomTypeRegistration_2;
1279
+ }
1280
+
1281
+ /* Excluded from this release type: _extractConfigSchemas */
1282
+
1283
+ /* Excluded from this release type: _ExtractConfigSchemasOptions */
1284
+
1285
+ /* Excluded from this release type: _ExtractConfigSchemasResult */
1286
+
1287
+ /**
1288
+ * Field configuration option constraints - control which field options are allowed.
1289
+ *
1290
+ * @public
1291
+ */
1292
+ declare interface FieldOptionConstraints {
1293
+ /** label - field label text */
1294
+ label?: Severity;
1295
+ /** placeholder - input placeholder text */
1296
+ placeholder?: Severity;
1297
+ /** required - whether field is required */
1298
+ required?: Severity;
1299
+ /** minValue - minimum value for numbers */
1300
+ minValue?: Severity;
1301
+ /** maxValue - maximum value for numbers */
1302
+ maxValue?: Severity;
1303
+ /** minItems - minimum array length */
1304
+ minItems?: Severity;
1305
+ /** maxItems - maximum array length */
1306
+ maxItems?: Severity;
1307
+ }
1308
+
1309
+ /**
1310
+ * Field type constraints - control which field types are allowed.
1311
+ * Fine-grained control over each DSL field builder.
1312
+ *
1313
+ * @public
1314
+ */
1315
+ declare interface FieldTypeConstraints {
1316
+ /** field.text() - basic text input */
1317
+ text?: Severity;
1318
+ /** field.number() - numeric input */
1319
+ number?: Severity;
1320
+ /** field.boolean() - checkbox/toggle */
1321
+ boolean?: Severity;
1322
+ /** field.enum() with literal options */
1323
+ staticEnum?: Severity;
1324
+ /** field.dynamicEnum() - runtime-fetched options */
1325
+ dynamicEnum?: Severity;
1326
+ /** field.dynamicSchema() - runtime-fetched schema */
1327
+ dynamicSchema?: Severity;
1328
+ /** field.array() / field.arrayWithConfig() */
1329
+ array?: Severity;
1330
+ /** field.object() / field.objectWithConfig() */
1331
+ object?: Severity;
1332
+ }
1333
+
1334
+ /* Excluded from this release type: _fixupDecimalPathConstraints */
1335
+
1336
+ /**
1337
+ * Top-level FormSpec configuration file structure.
1338
+ * The .formspec.yml file uses this structure.
1339
+ *
1340
+ * @public
1341
+ */
1342
+ export declare interface FormSpecConfig {
1343
+ /**
1344
+ * Extension definitions providing custom types, constraints,
1345
+ * annotations, and vocabulary keywords.
1346
+ */
1347
+ readonly extensions?: readonly ExtensionDefinition_3[];
1348
+ /** Constraint surface configuration — controls which field types,
1349
+ * layouts, UI features, and field/control options are allowed. */
1350
+ readonly constraints?: ConstraintConfig;
1351
+ /**
1352
+ * Metadata inference and naming policy. Controls how apiName,
1353
+ * displayName, and plural forms are derived when not authored.
1354
+ */
1355
+ readonly metadata?: MetadataPolicyInput_2;
1356
+ /**
1357
+ * Vendor prefix for extension-emitted JSON Schema keywords.
1358
+ * Must start with "x-".
1359
+ * @defaultValue "x-formspec"
1360
+ */
1361
+ readonly vendorPrefix?: string;
1362
+ /**
1363
+ * JSON Schema representation for static enums.
1364
+ * - "enum": compact `enum` output, plus a display-name extension when labels exist
1365
+ * - "oneOf": per-member `const` output, with `title` only for distinct labels
1366
+ * - "smart-size": uses `enum` unless a distinct display label would be lost
1367
+ * @defaultValue "enum"
1368
+ */
1369
+ readonly enumSerialization?: "enum" | "oneOf" | "smart-size";
1370
+ /**
1371
+ * Per-package configuration overrides for monorepos.
1372
+ * Keys are glob patterns matched against file paths relative to
1373
+ * the config file's directory. Values merge with root settings.
1374
+ */
1375
+ readonly packages?: Readonly<Record<string, FormSpecPackageOverride>>;
1376
+ }
1377
+
1378
+ /**
1379
+ * Per-package overrides that merge with the root config.
1380
+ * Only settings that genuinely vary per package are overridable.
1381
+ *
1382
+ * @public
1383
+ */
1384
+ declare interface FormSpecPackageOverride {
1385
+ /** Override constraint surface for this package. */
1386
+ readonly constraints?: ConstraintConfig;
1387
+ /** Override enum serialization for this package. */
1388
+ readonly enumSerialization?: "enum" | "oneOf" | "smart-size";
1389
+ /** Override metadata policy for this package. */
1390
+ readonly metadata?: MetadataPolicyInput_2;
1391
+ }
1392
+
1393
+ /**
1394
+ * Options for generating schemas from a decorated class.
1395
+ *
1396
+ * @public
1397
+ */
1398
+ export declare interface GenerateFromClassOptions extends StaticSchemaGenerationOptions {
1399
+ /** Path to the TypeScript source file */
1400
+ filePath: string;
1401
+ /** Class name to analyze */
1402
+ className: string;
1403
+ }
1404
+
1405
+ /**
1406
+ * Result of generating schemas from a decorated class.
1407
+ *
1408
+ * @public
1409
+ */
1410
+ export declare interface GenerateFromClassResult {
1411
+ /** JSON Schema 2020-12 for validation */
1412
+ jsonSchema: JsonSchema2020;
1413
+ /** JSON Forms UI Schema for rendering */
1414
+ uiSchema: UISchema;
1415
+ }
1416
+
1417
+ /* Excluded from this release type: _generateSchemas */
1418
+
1419
+ /**
1420
+ * Generates JSON Schema and UI Schema from a decorated TypeScript class.
1421
+ *
1422
+ * This is a high-level entry point that handles the entire pipeline:
1423
+ * creating a TypeScript program, finding the class, analyzing it to IR,
1424
+ * and generating schemas — all in one call.
1425
+ *
1426
+ * @example
1427
+ * ```typescript
1428
+ * const result = generateSchemasFromClass({
1429
+ * filePath: "./src/forms.ts",
1430
+ * className: "UserForm",
1431
+ * });
1432
+ * console.log(result.jsonSchema);
1433
+ * ```
1434
+ *
1435
+ * @param options - File path, class name, and optional compiler options
1436
+ * @returns Generated JSON Schema and UI Schema
1437
+ *
1438
+ * @public
1439
+ */
1440
+ export declare function generateSchemasFromClass(options: GenerateFromClassOptions): GenerateFromClassResult;
1441
+
1442
+ /**
1443
+ * Options for generating schemas from a named type (class, interface, or type alias).
1444
+ *
1445
+ * @public
1446
+ */
1447
+ export declare interface GenerateSchemasOptions extends StaticSchemaGenerationOptions {
1448
+ /** Path to the TypeScript source file */
1449
+ readonly filePath: string;
1450
+ /** Name of the exported class, interface, or type alias to analyze */
1451
+ readonly typeName: string;
1452
+ /**
1453
+ * Controls whether error-severity diagnostics throw or are returned in the result.
1454
+ */
1455
+ readonly errorReporting: "diagnostics" | "throw";
1456
+ }
1457
+
1458
+ export { getSchemaExtension }
1459
+
1460
+ /**
1461
+ * A group element with a label.
1462
+ *
1463
+ * @public
1464
+ */
1465
+ export declare interface GroupLayout {
1466
+ /** Discriminator identifying a labeled group container. */
1467
+ readonly type: "Group";
1468
+ /** Group label shown by compatible renderers. */
1469
+ readonly label: string;
1470
+ /** Child elements rendered inside the group. */
1471
+ readonly elements: UISchemaElement[];
1472
+ /** Optional rule controlling visibility or enablement. */
1473
+ readonly rule?: Rule | undefined;
1474
+ /** Renderer-specific group options. */
1475
+ readonly options?: Record<string, unknown> | undefined;
1476
+ /** Additional renderer-specific extension properties. */
1477
+ readonly [k: string]: unknown;
1478
+ }
1479
+
1480
+ /**
1481
+ * A horizontal layout element.
1482
+ *
1483
+ * @public
1484
+ */
1485
+ export declare interface HorizontalLayout {
1486
+ /** Discriminator identifying a horizontal layout container. */
1487
+ readonly type: "HorizontalLayout";
1488
+ /** Child elements rendered side by side. */
1489
+ readonly elements: UISchemaElement[];
1490
+ /** Optional rule controlling visibility or enablement. */
1491
+ readonly rule?: Rule | undefined;
1492
+ /** Renderer-specific layout options. */
1493
+ readonly options?: Record<string, unknown> | undefined;
1494
+ /** Additional renderer-specific extension properties. */
1495
+ readonly [k: string]: unknown;
1496
+ }
1497
+
1498
+ /**
1499
+ * A JSON Schema 2020-12 document, sub-schema, or keyword collection.
1500
+ *
1501
+ * This interface covers the subset of JSON Schema 2020-12 that this generator
1502
+ * emits, plus an index signature for custom `x-formspec-*` extension keywords.
1503
+ *
1504
+ * @public
1505
+ */
1506
+ export declare interface JsonSchema2020 {
1507
+ /** Declared JSON Schema dialect URI for the document root. */
1508
+ $schema?: string;
1509
+ /** Reference to another schema location. */
1510
+ $ref?: string;
1511
+ /** Named reusable schema definitions keyed by definition name. */
1512
+ $defs?: Record<string, JsonSchema2020>;
1513
+ /** JSON Schema type keyword for the current node. */
1514
+ type?: string;
1515
+ /** Object properties keyed by property name. */
1516
+ properties?: Record<string, JsonSchema2020>;
1517
+ /** Property names that must be present on object values. */
1518
+ required?: string[];
1519
+ /** Item schema applied to array elements. */
1520
+ items?: JsonSchema2020;
1521
+ /** Whether, or how, additional object properties are allowed. */
1522
+ additionalProperties?: boolean | JsonSchema2020;
1523
+ /** Closed set of allowed scalar values. */
1524
+ enum?: readonly (number | string)[];
1525
+ /** Literal value the instance must equal. */
1526
+ const?: unknown;
1527
+ /** Schemas that must all validate successfully. */
1528
+ allOf?: readonly JsonSchema2020[];
1529
+ /** Schemas of which exactly one should validate successfully. */
1530
+ oneOf?: readonly JsonSchema2020[];
1531
+ /** Schemas of which at least one may validate successfully. */
1532
+ anyOf?: readonly JsonSchema2020[];
1533
+ /** Inclusive numeric lower bound. */
1534
+ minimum?: number;
1535
+ /** Inclusive numeric upper bound. */
1536
+ maximum?: number;
1537
+ /** Exclusive numeric lower bound. */
1538
+ exclusiveMinimum?: number;
1539
+ /** Exclusive numeric upper bound. */
1540
+ exclusiveMaximum?: number;
1541
+ /** Required numeric step interval. */
1542
+ multipleOf?: number;
1543
+ /** Inclusive minimum string length. */
1544
+ minLength?: number;
1545
+ /** Inclusive maximum string length. */
1546
+ maxLength?: number;
1547
+ /** Inclusive minimum array length. */
1548
+ minItems?: number;
1549
+ /** Inclusive maximum array length. */
1550
+ maxItems?: number;
1551
+ /** Regular expression pattern applied to string values. */
1552
+ pattern?: string;
1553
+ /** Whether array elements must be unique. */
1554
+ uniqueItems?: boolean;
1555
+ /** Format hint for downstream validators and tooling. */
1556
+ format?: string;
1557
+ /** Human-readable title for the schema node. */
1558
+ title?: string;
1559
+ /** Human-readable description for the schema node. */
1560
+ description?: string;
1561
+ /** Default value suggested for the schema node. */
1562
+ default?: unknown;
1563
+ /** Whether the schema node is deprecated. */
1564
+ deprecated?: boolean;
1565
+ /** Additional vendor-prefixed extension keywords. */
1566
+ [key: `x-${string}`]: unknown;
1567
+ }
1568
+
1569
+ export { jsonSchema7Schema }
1570
+
1571
+ /**
1572
+ * A Label element for displaying static text.
1573
+ *
1574
+ * @public
1575
+ */
1576
+ export declare interface LabelElement {
1577
+ /** Discriminator identifying a static text label element. */
1578
+ readonly type: "Label";
1579
+ /** Static text content rendered by the label element. */
1580
+ readonly text: string;
1581
+ /** Optional rule controlling visibility or enablement. */
1582
+ readonly rule?: Rule | undefined;
1583
+ /** Renderer-specific label options. */
1584
+ readonly options?: Record<string, unknown> | undefined;
1585
+ /** Additional renderer-specific extension properties. */
1586
+ readonly [k: string]: unknown;
1587
+ }
1588
+
1589
+ /**
1590
+ * Layout and structure constraints - control grouping, conditionals, nesting.
1591
+ *
1592
+ * @public
1593
+ */
1594
+ declare interface LayoutConstraints {
1595
+ /** group() - visual grouping of fields */
1596
+ group?: Severity;
1597
+ /** when() - conditional field visibility */
1598
+ conditionals?: Severity;
1599
+ /** Maximum nesting depth for objects/arrays (0 = flat only) */
1600
+ maxNestingDepth?: number;
1601
+ }
1602
+
1603
+ /**
1604
+ * JSONForms layout type constraints.
1605
+ *
1606
+ * @public
1607
+ */
1608
+ declare interface LayoutTypeConstraints {
1609
+ /** VerticalLayout - stack elements vertically */
1610
+ VerticalLayout?: Severity;
1611
+ /** HorizontalLayout - arrange elements horizontally */
1612
+ HorizontalLayout?: Severity;
1613
+ /** Group - visual grouping with label */
1614
+ Group?: Severity;
1615
+ /** Categorization - tabbed/wizard interface */
1616
+ Categorization?: Severity;
1617
+ /** Category - individual tab/step in Categorization */
1618
+ Category?: Severity;
1619
+ }
1620
+
1621
+ /**
1622
+ * Authoring surfaces that can contribute metadata.
1623
+ *
1624
+ * @public
1625
+ */
1626
+ declare type MetadataAuthoringSurface$1 = "chain-dsl" | "tsdoc";
1627
+
1628
+ /**
1629
+ * Authoring surfaces that can contribute metadata.
1630
+ *
1631
+ * @public
1632
+ */
1633
+ declare type MetadataAuthoringSurface$2 = "chain-dsl" | "tsdoc";
1634
+
1635
+ /**
1636
+ * Authoring surfaces that can contribute metadata.
1637
+ *
1638
+ * @public
1639
+ */
1640
+ export declare type MetadataAuthoringSurface = "chain-dsl" | "tsdoc";
1641
+
1642
+ /**
1643
+ * Authoring surfaces that can contribute metadata.
1644
+ *
1645
+ * @public
1646
+ */
1647
+ declare type MetadataAuthoringSurface_2 = "chain-dsl" | "tsdoc";
1648
+
1649
+ /**
1650
+ * Declaration categories that metadata policy can target.
1651
+ *
1652
+ * @public
1653
+ */
1654
+ declare type MetadataDeclarationKind$1 = "field" | "method" | "type";
1655
+
1656
+ /**
1657
+ * Declaration categories that metadata policy can target.
1658
+ *
1659
+ * @public
1660
+ */
1661
+ declare type MetadataDeclarationKind$2 = "field" | "method" | "type";
1662
+
1663
+ /**
1664
+ * Declaration categories that metadata policy can target.
1665
+ *
1666
+ * @public
1667
+ */
1668
+ export declare type MetadataDeclarationKind = "field" | "method" | "type";
1669
+
1670
+ /**
1671
+ * Declaration categories that metadata policy can target.
1672
+ *
1673
+ * @public
1674
+ */
1675
+ declare type MetadataDeclarationKind_2 = "field" | "method" | "type";
1676
+
1677
+ /**
1678
+ * Build-facing context passed to metadata inference callbacks.
1679
+ *
1680
+ * `buildContext` is intentionally opaque so browser/runtime packages do not
1681
+ * need to depend on TypeScript compiler types.
1682
+ *
1683
+ * @public
1684
+ */
1685
+ declare interface MetadataInferenceContext$1 {
1686
+ /** Authoring surface the metadata is being resolved for. */
1687
+ readonly surface: MetadataAuthoringSurface$1;
1688
+ /** Declaration kind currently being resolved. */
1689
+ readonly declarationKind: MetadataDeclarationKind$1;
1690
+ /** Logical identifier before any metadata policy is applied. */
1691
+ readonly logicalName: string;
1692
+ /** Optional build-only context supplied by the resolver. */
1693
+ readonly buildContext?: unknown;
1694
+ }
1695
+
1696
+ /**
1697
+ * Build-facing context passed to metadata inference callbacks.
1698
+ *
1699
+ * `buildContext` is intentionally opaque so browser/runtime packages do not
1700
+ * need to depend on TypeScript compiler types.
1701
+ *
1702
+ * @public
1703
+ */
1704
+ declare interface MetadataInferenceContext$2 {
1705
+ /** Authoring surface the metadata is being resolved for. */
1706
+ readonly surface: MetadataAuthoringSurface$2;
1707
+ /** Declaration kind currently being resolved. */
1708
+ readonly declarationKind: MetadataDeclarationKind$2;
1709
+ /** Logical identifier before any metadata policy is applied. */
1710
+ readonly logicalName: string;
1711
+ /** Optional build-only context supplied by the resolver. */
1712
+ readonly buildContext?: unknown;
1713
+ }
1714
+
1715
+ /**
1716
+ * Build-facing context passed to metadata inference callbacks.
1717
+ *
1718
+ * `buildContext` is intentionally opaque so browser/runtime packages do not
1719
+ * need to depend on TypeScript compiler types.
1720
+ *
1721
+ * @public
1722
+ */
1723
+ export declare interface MetadataInferenceContext {
1724
+ /** Authoring surface the metadata is being resolved for. */
1725
+ readonly surface: MetadataAuthoringSurface;
1726
+ /** Declaration kind currently being resolved. */
1727
+ readonly declarationKind: MetadataDeclarationKind;
1728
+ /** Logical identifier before any metadata policy is applied. */
1729
+ readonly logicalName: string;
1730
+ /** Optional build-only context supplied by the resolver. */
1731
+ readonly buildContext?: unknown;
1732
+ }
1733
+
1734
+ /**
1735
+ * Build-facing context passed to metadata inference callbacks.
1736
+ *
1737
+ * `buildContext` is intentionally opaque so browser/runtime packages do not
1738
+ * need to depend on TypeScript compiler types.
1739
+ *
1740
+ * @public
1741
+ */
1742
+ declare interface MetadataInferenceContext_2 {
1743
+ /** Authoring surface the metadata is being resolved for. */
1744
+ readonly surface: MetadataAuthoringSurface_2;
1745
+ /** Declaration kind currently being resolved. */
1746
+ readonly declarationKind: MetadataDeclarationKind_2;
1747
+ /** Logical identifier before any metadata policy is applied. */
1748
+ readonly logicalName: string;
1749
+ /** Optional build-only context supplied by the resolver. */
1750
+ readonly buildContext?: unknown;
1751
+ }
1752
+
1753
+ /**
1754
+ * Callback used to infer a scalar metadata value.
1755
+ *
1756
+ * @public
1757
+ */
1758
+ declare type MetadataInferenceFn$1 = (context: MetadataInferenceContext_2) => string;
1759
+
1760
+ /**
1761
+ * Callback used to infer a scalar metadata value.
1762
+ *
1763
+ * @public
1764
+ */
1765
+ declare type MetadataInferenceFn$2 = (context: MetadataInferenceContext$2) => string;
1766
+
1767
+ /**
1768
+ * Callback used to infer a scalar metadata value.
1769
+ *
1770
+ * @public
1771
+ */
1772
+ export declare type MetadataInferenceFn = (context: MetadataInferenceContext) => string;
1773
+
1774
+ /**
1775
+ * Context passed to pluralization callbacks.
1776
+ *
1777
+ * @public
1778
+ */
1779
+ declare interface MetadataPluralizationContext$1 extends MetadataInferenceContext_2 {
1780
+ /** Singular value that pluralization should derive from. */
1781
+ readonly singular: string;
1782
+ }
1783
+
1784
+ /**
1785
+ * Context passed to pluralization callbacks.
1786
+ *
1787
+ * @public
1788
+ */
1789
+ declare interface MetadataPluralizationContext$2 extends MetadataInferenceContext$2 {
1790
+ /** Singular value that pluralization should derive from. */
1791
+ readonly singular: string;
1792
+ }
1793
+
1794
+ /**
1795
+ * Context passed to pluralization callbacks.
1796
+ *
1797
+ * @public
1798
+ */
1799
+ declare interface MetadataPluralizationContext extends MetadataInferenceContext {
1800
+ /** Singular value that pluralization should derive from. */
1801
+ readonly singular: string;
1802
+ }
1803
+
1804
+ /**
1805
+ * Pluralization disabled.
1806
+ *
1807
+ * @public
1808
+ */
1809
+ declare interface MetadataPluralizationDisabledPolicyInput$1 {
1810
+ /** Disables automatic plural-value generation. */
1811
+ readonly mode?: "disabled" | undefined;
1812
+ }
1813
+
1814
+ /**
1815
+ * Pluralization disabled.
1816
+ *
1817
+ * @public
1818
+ */
1819
+ declare interface MetadataPluralizationDisabledPolicyInput$2 {
1820
+ /** Disables automatic plural-value generation. */
1821
+ readonly mode?: "disabled" | undefined;
1822
+ }
1823
+
1824
+ /**
1825
+ * Pluralization disabled.
1826
+ *
1827
+ * @public
1828
+ */
1829
+ export declare interface MetadataPluralizationDisabledPolicyInput {
1830
+ /** Disables automatic plural-value generation. */
1831
+ readonly mode?: "disabled" | undefined;
1832
+ }
1833
+
1834
+ /**
1835
+ * Callback used to derive plural metadata from a singular value.
1836
+ *
1837
+ * @public
1838
+ */
1839
+ declare type MetadataPluralizationFn$1 = (context: MetadataPluralizationContext$1) => string;
1840
+
1841
+ /**
1842
+ * Callback used to derive plural metadata from a singular value.
1843
+ *
1844
+ * @public
1845
+ */
1846
+ declare type MetadataPluralizationFn$2 = (context: MetadataPluralizationContext$2) => string;
1847
+
1848
+ /**
1849
+ * Callback used to derive plural metadata from a singular value.
1850
+ *
1851
+ * @public
1852
+ */
1853
+ export declare type MetadataPluralizationFn = (context: MetadataPluralizationContext) => string;
1854
+
1855
+ /**
1856
+ * Pluralization may be inferred when absent.
1857
+ *
1858
+ * @public
1859
+ */
1860
+ declare interface MetadataPluralizationInferIfMissingPolicyInput$1 {
1861
+ /** Infers plural values whenever no explicit plural is present. */
1862
+ readonly mode: "infer-if-missing";
1863
+ /** Callback that derives a plural form from the resolved singular value. */
1864
+ readonly inflect: MetadataPluralizationFn$1;
1865
+ }
1866
+
1867
+ /**
1868
+ * Pluralization may be inferred when absent.
1869
+ *
1870
+ * @public
1871
+ */
1872
+ declare interface MetadataPluralizationInferIfMissingPolicyInput$2 {
1873
+ /** Infers plural values whenever no explicit plural is present. */
1874
+ readonly mode: "infer-if-missing";
1875
+ /** Callback that derives a plural form from the resolved singular value. */
1876
+ readonly inflect: MetadataPluralizationFn$2;
1877
+ }
1878
+
1879
+ /**
1880
+ * Pluralization may be inferred when absent.
1881
+ *
1882
+ * @public
1883
+ */
1884
+ export declare interface MetadataPluralizationInferIfMissingPolicyInput {
1885
+ /** Infers plural values whenever no explicit plural is present. */
1886
+ readonly mode: "infer-if-missing";
1887
+ /** Callback that derives a plural form from the resolved singular value. */
1888
+ readonly inflect: MetadataPluralizationFn;
1889
+ }
1890
+
1891
+ /**
1892
+ * Pluralization policy input.
1893
+ *
1894
+ * @public
1895
+ */
1896
+ declare type MetadataPluralizationPolicyInput$1 = MetadataPluralizationDisabledPolicyInput$1 | MetadataPluralizationInferIfMissingPolicyInput$1 | MetadataPluralizationRequireExplicitPolicyInput$1;
1897
+
1898
+ /**
1899
+ * Pluralization policy input.
1900
+ *
1901
+ * @public
1902
+ */
1903
+ declare type MetadataPluralizationPolicyInput$2 = MetadataPluralizationDisabledPolicyInput$2 | MetadataPluralizationInferIfMissingPolicyInput$2 | MetadataPluralizationRequireExplicitPolicyInput$2;
1904
+
1905
+ /**
1906
+ * Pluralization policy input.
1907
+ *
1908
+ * @public
1909
+ */
1910
+ export declare type MetadataPluralizationPolicyInput = MetadataPluralizationDisabledPolicyInput | MetadataPluralizationInferIfMissingPolicyInput | MetadataPluralizationRequireExplicitPolicyInput;
1911
+
1912
+ /**
1913
+ * Pluralization must be authored explicitly.
1914
+ *
1915
+ * @public
1916
+ */
1917
+ declare interface MetadataPluralizationRequireExplicitPolicyInput$1 {
1918
+ /** Requires plural values to be authored directly. */
1919
+ readonly mode: "require-explicit";
1920
+ }
1921
+
1922
+ /**
1923
+ * Pluralization must be authored explicitly.
1924
+ *
1925
+ * @public
1926
+ */
1927
+ declare interface MetadataPluralizationRequireExplicitPolicyInput$2 {
1928
+ /** Requires plural values to be authored directly. */
1929
+ readonly mode: "require-explicit";
1930
+ }
1931
+
1932
+ /**
1933
+ * Pluralization must be authored explicitly.
1934
+ *
1935
+ * @public
1936
+ */
1937
+ export declare interface MetadataPluralizationRequireExplicitPolicyInput {
1938
+ /** Requires plural values to be authored directly. */
1939
+ readonly mode: "require-explicit";
1940
+ }
1941
+
1942
+ /**
1943
+ * User-facing metadata policy configuration.
1944
+ *
1945
+ * @public
1946
+ */
1947
+ declare interface MetadataPolicyInput$1 {
1948
+ /** Policy applied to named types and the analyzed root declaration. */
1949
+ readonly type?: DeclarationMetadataPolicyInput$2 | undefined;
1950
+ /** Policy applied to fields and object properties. */
1951
+ readonly field?: DeclarationMetadataPolicyInput$2 | undefined;
1952
+ /** Policy applied to callable/method declarations. */
1953
+ readonly method?: DeclarationMetadataPolicyInput$2 | undefined;
1954
+ /** Policy applied to enum-member display names during build-time IR resolution. */
1955
+ readonly enumMember?: EnumMemberMetadataPolicyInput$2 | undefined;
1956
+ }
1957
+
1958
+ /**
1959
+ * User-facing metadata policy configuration.
1960
+ *
1961
+ * @public
1962
+ */
1963
+ export declare interface MetadataPolicyInput {
1964
+ /** Policy applied to named types and the analyzed root declaration. */
1965
+ readonly type?: DeclarationMetadataPolicyInput | undefined;
1966
+ /** Policy applied to fields and object properties. */
1967
+ readonly field?: DeclarationMetadataPolicyInput | undefined;
1968
+ /** Policy applied to callable/method declarations. */
1969
+ readonly method?: DeclarationMetadataPolicyInput | undefined;
1970
+ /** Policy applied to enum-member display names during build-time IR resolution. */
1971
+ readonly enumMember?: EnumMemberMetadataPolicyInput | undefined;
1972
+ }
1973
+
1974
+ /**
1975
+ * User-facing metadata policy configuration.
1976
+ *
1977
+ * @public
1978
+ */
1979
+ declare interface MetadataPolicyInput_2 {
1980
+ /** Policy applied to named types and the analyzed root declaration. */
1981
+ readonly type?: DeclarationMetadataPolicyInput$1 | undefined;
1982
+ /** Policy applied to fields and object properties. */
1983
+ readonly field?: DeclarationMetadataPolicyInput$1 | undefined;
1984
+ /** Policy applied to callable/method declarations. */
1985
+ readonly method?: DeclarationMetadataPolicyInput$1 | undefined;
1986
+ /** Policy applied to enum-member display names during build-time IR resolution. */
1987
+ readonly enumMember?: EnumMemberMetadataPolicyInput$1 | undefined;
1988
+ }
1989
+
1990
+ /**
1991
+ * Supported qualifier registration for an extensible metadata slot.
1992
+ *
1993
+ * @public
1994
+ */
1995
+ declare interface MetadataQualifierRegistration$1 {
1996
+ /** Qualifier text without the leading colon. */
1997
+ readonly qualifier: string;
1998
+ /**
1999
+ * Optional source qualifier to use as the base input for this qualifier's
2000
+ * inference hook. Defaults to the slot's bare/default value when omitted.
2001
+ */
2002
+ readonly sourceQualifier?: string | undefined;
2003
+ /** Optional inference hook for this qualified value. */
2004
+ readonly inferValue?: MetadataSlotInferenceFn$1 | undefined;
2005
+ }
2006
+
2007
+ /**
2008
+ * Supported qualifier registration for an extensible metadata slot.
2009
+ *
2010
+ * @public
2011
+ */
2012
+ export declare interface MetadataQualifierRegistration {
2013
+ /** Qualifier text without the leading colon. */
2014
+ readonly qualifier: string;
2015
+ /**
2016
+ * Optional source qualifier to use as the base input for this qualifier's
2017
+ * inference hook. Defaults to the slot's bare/default value when omitted.
2018
+ */
2019
+ readonly sourceQualifier?: string | undefined;
2020
+ /** Optional inference hook for this qualified value. */
2021
+ readonly inferValue?: MetadataSlotInferenceFn | undefined;
2022
+ }
2023
+
2024
+ /**
2025
+ * Supported qualifier registration for an extensible metadata slot.
2026
+ *
2027
+ * @public
2028
+ */
2029
+ declare interface MetadataQualifierRegistration_2 {
2030
+ /** Qualifier text without the leading colon. */
2031
+ readonly qualifier: string;
2032
+ /**
2033
+ * Optional source qualifier to use as the base input for this qualifier's
2034
+ * inference hook. Defaults to the slot's bare/default value when omitted.
2035
+ */
2036
+ readonly sourceQualifier?: string | undefined;
2037
+ /** Optional inference hook for this qualified value. */
2038
+ readonly inferValue?: MetadataSlotInferenceFn_2 | undefined;
2039
+ }
2040
+
2041
+ /**
2042
+ * Stable slot identifier for extensible metadata analysis.
2043
+ *
2044
+ * @public
2045
+ */
2046
+ declare type MetadataSlotId$1 = string;
2047
+
2048
+ /**
2049
+ * Stable slot identifier for extensible metadata analysis.
2050
+ *
2051
+ * @public
2052
+ */
2053
+ export declare type MetadataSlotId = string;
2054
+
2055
+ /**
2056
+ * Stable slot identifier for extensible metadata analysis.
2057
+ *
2058
+ * @public
2059
+ */
2060
+ declare type MetadataSlotId_2 = string;
2061
+
2062
+ /**
2063
+ * Context passed to extensible metadata inference hooks.
2064
+ *
2065
+ * @public
2066
+ */
2067
+ declare interface MetadataSlotInferenceContext$1 extends MetadataInferenceContext$1 {
2068
+ /** Stable logical slot identifier. */
2069
+ readonly slotId: MetadataSlotId$1;
2070
+ /** Tag name associated with the slot, without the `@` prefix. */
2071
+ readonly tagName: string;
2072
+ /** Optional qualifier being inferred (for example `plural`). */
2073
+ readonly qualifier?: string | undefined;
2074
+ /** Resolved bare/default value used as the base input for derived qualifiers. */
2075
+ readonly baseValue?: string | undefined;
2076
+ }
2077
+
2078
+ /**
2079
+ * Context passed to extensible metadata inference hooks.
2080
+ *
2081
+ * @public
2082
+ */
2083
+ export declare interface MetadataSlotInferenceContext extends MetadataInferenceContext {
2084
+ /** Stable logical slot identifier. */
2085
+ readonly slotId: MetadataSlotId;
2086
+ /** Tag name associated with the slot, without the `@` prefix. */
2087
+ readonly tagName: string;
2088
+ /** Optional qualifier being inferred (for example `plural`). */
2089
+ readonly qualifier?: string | undefined;
2090
+ /** Resolved bare/default value used as the base input for derived qualifiers. */
2091
+ readonly baseValue?: string | undefined;
2092
+ }
2093
+
2094
+ /**
2095
+ * Context passed to extensible metadata inference hooks.
2096
+ *
2097
+ * @public
2098
+ */
2099
+ declare interface MetadataSlotInferenceContext_2 extends MetadataInferenceContext_2 {
2100
+ /** Stable logical slot identifier. */
2101
+ readonly slotId: MetadataSlotId_2;
2102
+ /** Tag name associated with the slot, without the `@` prefix. */
2103
+ readonly tagName: string;
2104
+ /** Optional qualifier being inferred (for example `plural`). */
2105
+ readonly qualifier?: string | undefined;
2106
+ /** Resolved bare/default value used as the base input for derived qualifiers. */
2107
+ readonly baseValue?: string | undefined;
2108
+ }
2109
+
2110
+ /**
2111
+ * Callback used to infer an extensible metadata slot value.
2112
+ *
2113
+ * @public
2114
+ */
2115
+ declare type MetadataSlotInferenceFn$1 = (context: MetadataSlotInferenceContext$1) => string;
2116
+
2117
+ /**
2118
+ * Callback used to infer an extensible metadata slot value.
2119
+ *
2120
+ * @public
2121
+ */
2122
+ export declare type MetadataSlotInferenceFn = (context: MetadataSlotInferenceContext) => string;
2123
+
2124
+ /**
2125
+ * Callback used to infer an extensible metadata slot value.
2126
+ *
2127
+ * @public
2128
+ */
2129
+ declare type MetadataSlotInferenceFn_2 = (context: MetadataSlotInferenceContext_2) => string;
2130
+
2131
+ /**
2132
+ * Extensible metadata slot definition shared across build- and lint-time analysis.
2133
+ *
2134
+ * @public
2135
+ */
2136
+ declare interface MetadataSlotRegistration$1 {
2137
+ /** Stable logical slot identifier. */
2138
+ readonly slotId: MetadataSlotId$1;
2139
+ /** Tag name associated with this slot, without the `@` prefix. */
2140
+ readonly tagName: string;
2141
+ /** Declaration kinds where the slot is meaningful. */
2142
+ readonly declarationKinds: readonly MetadataDeclarationKind$1[];
2143
+ /** Whether a bare tag without a qualifier is supported. Defaults to true. */
2144
+ readonly allowBare?: boolean | undefined;
2145
+ /** Supported qualifiers for this slot. */
2146
+ readonly qualifiers?: readonly MetadataQualifierRegistration$1[] | undefined;
2147
+ /** Optional inference hook for the bare/default slot value. */
2148
+ readonly inferValue?: MetadataSlotInferenceFn$1 | undefined;
2149
+ /**
2150
+ * Optional applicability hook for declaration-specific rules beyond
2151
+ * declaration kind. `buildContext` may carry compiler objects.
2152
+ */
2153
+ readonly isApplicable?: ((context: MetadataInferenceContext$1) => boolean) | undefined;
2154
+ }
2155
+
2156
+ /**
2157
+ * Extensible metadata slot definition shared across build- and lint-time analysis.
2158
+ *
2159
+ * @public
2160
+ */
2161
+ export declare interface MetadataSlotRegistration {
2162
+ /** Stable logical slot identifier. */
2163
+ readonly slotId: MetadataSlotId;
2164
+ /** Tag name associated with this slot, without the `@` prefix. */
2165
+ readonly tagName: string;
2166
+ /** Declaration kinds where the slot is meaningful. */
2167
+ readonly declarationKinds: readonly MetadataDeclarationKind[];
2168
+ /** Whether a bare tag without a qualifier is supported. Defaults to true. */
2169
+ readonly allowBare?: boolean | undefined;
2170
+ /** Supported qualifiers for this slot. */
2171
+ readonly qualifiers?: readonly MetadataQualifierRegistration[] | undefined;
2172
+ /** Optional inference hook for the bare/default slot value. */
2173
+ readonly inferValue?: MetadataSlotInferenceFn | undefined;
2174
+ /**
2175
+ * Optional applicability hook for declaration-specific rules beyond
2176
+ * declaration kind. `buildContext` may carry compiler objects.
2177
+ */
2178
+ readonly isApplicable?: ((context: MetadataInferenceContext) => boolean) | undefined;
2179
+ }
2180
+
2181
+ /**
2182
+ * Extensible metadata slot definition shared across build- and lint-time analysis.
2183
+ *
2184
+ * @public
2185
+ */
2186
+ declare interface MetadataSlotRegistration_2 {
2187
+ /** Stable logical slot identifier. */
2188
+ readonly slotId: MetadataSlotId_2;
2189
+ /** Tag name associated with this slot, without the `@` prefix. */
2190
+ readonly tagName: string;
2191
+ /** Declaration kinds where the slot is meaningful. */
2192
+ readonly declarationKinds: readonly MetadataDeclarationKind_2[];
2193
+ /** Whether a bare tag without a qualifier is supported. Defaults to true. */
2194
+ readonly allowBare?: boolean | undefined;
2195
+ /** Supported qualifiers for this slot. */
2196
+ readonly qualifiers?: readonly MetadataQualifierRegistration_2[] | undefined;
2197
+ /** Optional inference hook for the bare/default slot value. */
2198
+ readonly inferValue?: MetadataSlotInferenceFn_2 | undefined;
2199
+ /**
2200
+ * Optional applicability hook for declaration-specific rules beyond
2201
+ * declaration kind. `buildContext` may carry compiler objects.
2202
+ */
2203
+ readonly isApplicable?: ((context: MetadataInferenceContext_2) => boolean) | undefined;
2204
+ }
2205
+
2206
+ /**
2207
+ * Scalar metadata disabled unless provided explicitly elsewhere.
2208
+ *
2209
+ * @public
2210
+ */
2211
+ declare interface MetadataValueDisabledPolicyInput$1 {
2212
+ /** Disables inference for this scalar metadata value. */
2213
+ readonly mode?: "disabled" | undefined;
2214
+ /** Optional policy controlling plural forms of this scalar value. */
2215
+ readonly pluralization?: MetadataPluralizationPolicyInput$1 | undefined;
2216
+ }
2217
+
2218
+ /**
2219
+ * Scalar metadata disabled unless provided explicitly elsewhere.
2220
+ *
2221
+ * @public
2222
+ */
2223
+ declare interface MetadataValueDisabledPolicyInput$2 {
2224
+ /** Disables inference for this scalar metadata value. */
2225
+ readonly mode?: "disabled" | undefined;
2226
+ /** Optional policy controlling plural forms of this scalar value. */
2227
+ readonly pluralization?: MetadataPluralizationPolicyInput$2 | undefined;
2228
+ }
2229
+
2230
+ /**
2231
+ * Scalar metadata disabled unless provided explicitly elsewhere.
2232
+ *
2233
+ * @public
2234
+ */
2235
+ export declare interface MetadataValueDisabledPolicyInput {
2236
+ /** Disables inference for this scalar metadata value. */
2237
+ readonly mode?: "disabled" | undefined;
2238
+ /** Optional policy controlling plural forms of this scalar value. */
2239
+ readonly pluralization?: MetadataPluralizationPolicyInput | undefined;
2240
+ }
2241
+
2242
+ /**
2243
+ * Scalar metadata may be inferred when missing.
2244
+ *
2245
+ * @public
2246
+ */
2247
+ declare interface MetadataValueInferIfMissingPolicyInput$1 {
2248
+ /** Infers this scalar metadata value when it is not authored explicitly. */
2249
+ readonly mode: "infer-if-missing";
2250
+ /** Callback used to infer the missing singular value. */
2251
+ readonly infer: MetadataInferenceFn$1;
2252
+ /** Optional policy controlling plural forms of this scalar value. */
2253
+ readonly pluralization?: MetadataPluralizationPolicyInput$1 | undefined;
2254
+ }
2255
+
2256
+ /**
2257
+ * Scalar metadata may be inferred when missing.
2258
+ *
2259
+ * @public
2260
+ */
2261
+ declare interface MetadataValueInferIfMissingPolicyInput$2 {
2262
+ /** Infers this scalar metadata value when it is not authored explicitly. */
2263
+ readonly mode: "infer-if-missing";
2264
+ /** Callback used to infer the missing singular value. */
2265
+ readonly infer: MetadataInferenceFn$2;
2266
+ /** Optional policy controlling plural forms of this scalar value. */
2267
+ readonly pluralization?: MetadataPluralizationPolicyInput$2 | undefined;
2268
+ }
2269
+
2270
+ /**
2271
+ * Scalar metadata may be inferred when missing.
2272
+ *
2273
+ * @public
2274
+ */
2275
+ export declare interface MetadataValueInferIfMissingPolicyInput {
2276
+ /** Infers this scalar metadata value when it is not authored explicitly. */
2277
+ readonly mode: "infer-if-missing";
2278
+ /** Callback used to infer the missing singular value. */
2279
+ readonly infer: MetadataInferenceFn;
2280
+ /** Optional policy controlling plural forms of this scalar value. */
2281
+ readonly pluralization?: MetadataPluralizationPolicyInput | undefined;
2282
+ }
2283
+
2284
+ /**
2285
+ * Scalar metadata policy input.
2286
+ *
2287
+ * @public
2288
+ */
2289
+ declare type MetadataValuePolicyInput$1 = MetadataValueDisabledPolicyInput$1 | MetadataValueInferIfMissingPolicyInput$1 | MetadataValueRequireExplicitPolicyInput$1;
2290
+
2291
+ /**
2292
+ * Scalar metadata policy input.
2293
+ *
2294
+ * @public
2295
+ */
2296
+ declare type MetadataValuePolicyInput$2 = MetadataValueDisabledPolicyInput$2 | MetadataValueInferIfMissingPolicyInput$2 | MetadataValueRequireExplicitPolicyInput$2;
2297
+
2298
+ /**
2299
+ * Scalar metadata policy input.
2300
+ *
2301
+ * @public
2302
+ */
2303
+ export declare type MetadataValuePolicyInput = MetadataValueDisabledPolicyInput | MetadataValueInferIfMissingPolicyInput | MetadataValueRequireExplicitPolicyInput;
2304
+
2305
+ /**
2306
+ * Scalar metadata must be authored explicitly.
2307
+ *
2308
+ * @public
2309
+ */
2310
+ declare interface MetadataValueRequireExplicitPolicyInput$1 {
2311
+ /** Requires this scalar metadata value to be authored directly. */
2312
+ readonly mode: "require-explicit";
2313
+ /** Optional policy controlling plural forms of this scalar value. */
2314
+ readonly pluralization?: MetadataPluralizationPolicyInput$1 | undefined;
2315
+ }
2316
+
2317
+ /**
2318
+ * Scalar metadata must be authored explicitly.
2319
+ *
2320
+ * @public
2321
+ */
2322
+ declare interface MetadataValueRequireExplicitPolicyInput$2 {
2323
+ /** Requires this scalar metadata value to be authored directly. */
2324
+ readonly mode: "require-explicit";
2325
+ /** Optional policy controlling plural forms of this scalar value. */
2326
+ readonly pluralization?: MetadataPluralizationPolicyInput$2 | undefined;
2327
+ }
2328
+
2329
+ /**
2330
+ * Scalar metadata must be authored explicitly.
2331
+ *
2332
+ * @public
2333
+ */
2334
+ export declare interface MetadataValueRequireExplicitPolicyInput {
2335
+ /** Requires this scalar metadata value to be authored directly. */
2336
+ readonly mode: "require-explicit";
2337
+ /** Optional policy controlling plural forms of this scalar value. */
2338
+ readonly pluralization?: MetadataPluralizationPolicyInput | undefined;
2339
+ }
2340
+
2341
+ /* Excluded from this release type: _resolveConfigTypeArgs */
2342
+
2343
+ /**
2344
+ * Rule for conditional element visibility/enablement.
2345
+ *
2346
+ * @public
2347
+ */
2348
+ export declare interface Rule {
2349
+ /** UI effect to apply when the rule condition matches. */
2350
+ readonly effect: RuleEffect;
2351
+ /** Predicate that controls when the UI effect applies. */
2352
+ readonly condition: SchemaBasedCondition;
2353
+ }
2354
+
2355
+ /**
2356
+ * JSON Schema subset used in rule conditions.
2357
+ *
2358
+ * @public
2359
+ */
2360
+ export declare interface RuleConditionSchema {
2361
+ /** Literal value the condition schema must equal. */
2362
+ const?: unknown;
2363
+ /** Allowed values for the condition schema. */
2364
+ enum?: readonly unknown[];
2365
+ /** JSON Schema type required by the condition schema. */
2366
+ type?: string;
2367
+ /** Negated branch of the condition schema. */
2368
+ not?: RuleConditionSchema;
2369
+ /** Inclusive numeric lower bound in the condition schema. */
2370
+ minimum?: number;
2371
+ /** Inclusive numeric upper bound in the condition schema. */
2372
+ maximum?: number;
2373
+ /** Exclusive numeric lower bound in the condition schema. */
2374
+ exclusiveMinimum?: number;
2375
+ /** Exclusive numeric upper bound in the condition schema. */
2376
+ exclusiveMaximum?: number;
2377
+ /** Inclusive minimum string length in the condition schema. */
2378
+ minLength?: number;
2379
+ /** Nested property conditions keyed by property name. */
2380
+ properties?: Record<string, RuleConditionSchema>;
2381
+ /** Property names that must be present for the condition to match. */
2382
+ required?: string[];
2383
+ /** Schemas that must all match for the condition to succeed. */
2384
+ allOf?: RuleConditionSchema[];
2385
+ }
2386
+
2387
+ /**
2388
+ * JSONForms rule constraints.
2389
+ *
2390
+ * @public
2391
+ */
2392
+ declare interface RuleConstraints {
2393
+ /** Whether rules are enabled at all */
2394
+ enabled?: Severity;
2395
+ /** Fine-grained control over rule effects */
2396
+ effects?: RuleEffectConstraints;
2397
+ }
2398
+
2399
+ /**
2400
+ * JSON Forms UI Schema type definitions.
2401
+ *
2402
+ * These are the consumer-facing TypeScript shapes. Runtime validation remains
2403
+ * defined separately in `./schema.ts`.
2404
+ *
2405
+ * See: https://jsonforms.io/docs/uischema/
2406
+ */
2407
+ /**
2408
+ * Rule effect types for conditional visibility.
2409
+ *
2410
+ * @public
2411
+ */
2412
+ export declare type RuleEffect = "DISABLE" | "ENABLE" | "HIDE" | "SHOW";
2413
+
2414
+ /**
2415
+ * JSONForms rule effect constraints.
2416
+ *
2417
+ * @public
2418
+ */
2419
+ declare interface RuleEffectConstraints {
2420
+ /** SHOW - show element when condition is true */
2421
+ SHOW?: Severity;
2422
+ /** HIDE - hide element when condition is true */
2423
+ HIDE?: Severity;
2424
+ /** ENABLE - enable element when condition is true */
2425
+ ENABLE?: Severity;
2426
+ /** DISABLE - disable element when condition is true */
2427
+ DISABLE?: Severity;
2428
+ }
2429
+
2430
+ /**
2431
+ * Condition for a rule.
2432
+ *
2433
+ * @public
2434
+ */
2435
+ export declare interface SchemaBasedCondition {
2436
+ /** JSON Pointer scope the rule evaluates against. */
2437
+ readonly scope: string;
2438
+ /** JSON Schema fragment evaluated at the scoped location. */
2439
+ readonly schema: RuleConditionSchema;
2440
+ }
2441
+
2442
+ export { setSchemaExtension }
2443
+
2444
+ /**
2445
+ * Severity level for constraint violations.
2446
+ * - "error": Violation fails validation
2447
+ * - "warn": Violation emits warning but passes
2448
+ * - "off": Feature is allowed (no violation)
2449
+ *
2450
+ * @public
2451
+ */
2452
+ declare type Severity = "error" | "off" | "warn";
2453
+
2454
+ /**
2455
+ * Shared options for schema generation flows that support custom extensions.
2456
+ *
2457
+ * @public
2458
+ */
2459
+ export declare interface StaticSchemaGenerationOptions {
2460
+ /**
2461
+ * FormSpec project configuration. When provided, resolves `extensionRegistry`,
2462
+ * `vendorPrefix`, `enumSerialization`, and `metadata` from the config object.
2463
+ * Direct options take precedence over config values.
2464
+ */
2465
+ readonly config?: FormSpecConfig | undefined;
2466
+ /**
2467
+ * Registry used to resolve custom types, constraints, and annotations.
2468
+ * @deprecated Provide a `FormSpecConfig` via the `config` option instead.
2469
+ */
2470
+ readonly extensionRegistry?: ExtensionRegistry | undefined;
2471
+ /**
2472
+ * Vendor prefix for emitted extension keywords.
2473
+ * @defaultValue "x-formspec"
2474
+ * @deprecated Provide a `FormSpecConfig` via the `config` option instead.
2475
+ */
2476
+ readonly vendorPrefix?: string | undefined;
2477
+ /**
2478
+ * JSON Schema representation to use for static enums.
2479
+ * @defaultValue "enum"
2480
+ * @deprecated Provide a `FormSpecConfig` via the `config` option instead.
2481
+ */
2482
+ readonly enumSerialization?: "enum" | "oneOf" | "smart-size";
2483
+ /**
2484
+ * Metadata resolution policy for static schema generation.
2485
+ * @deprecated Provide a `FormSpecConfig` via the `config` option instead.
2486
+ */
2487
+ readonly metadata?: MetadataPolicyInput$1 | undefined;
2488
+ /** Discriminator-specific schema generation behavior. */
2489
+ readonly discriminator?: DiscriminatorResolutionOptions | undefined;
2490
+ /**
2491
+ * Absolute path to the FormSpec config file (e.g., `formspec.config.ts`).
2492
+ *
2493
+ * When provided alongside a `config` that includes extensions, the build
2494
+ * pipeline includes the config file in the TypeScript program and extracts
2495
+ * `defineCustomType<T>()` type parameters. This enables symbol-based custom
2496
+ * type detection — the most precise resolution path, immune to import aliases
2497
+ * and name collisions.
2498
+ *
2499
+ * Obtain this from `loadFormSpecConfig()`:
2500
+ * ```typescript
2501
+ * const { config, configPath } = await loadFormSpecConfig();
2502
+ * await generateSchemas({ filePath, typeName, config, configPath, errorReporting: "throw" });
2503
+ * ```
2504
+ */
2505
+ readonly configPath?: string | undefined;
2506
+ }
2507
+
2508
+ /* Excluded from this release type: _stripeExtensionRegistry */
2509
+
2510
+ /* Excluded from this release type: _stripeFormSpecConfig */
2511
+
2512
+ /* Excluded from this release type: _stripeSchemaDefaults */
2513
+
2514
+ /* Excluded from this release type: _stripeStdlibExtension */
2515
+
2516
+ /**
2517
+ * Root UI Schema (always a layout — not a Control, Category, or Label).
2518
+ *
2519
+ * @public
2520
+ */
2521
+ export declare type UISchema = Categorization | GroupLayout | HorizontalLayout | VerticalLayout;
2522
+
2523
+ /**
2524
+ * UI Schema feature constraints - control JSONForms-specific features.
2525
+ *
2526
+ * @public
2527
+ */
2528
+ declare interface UISchemaConstraints {
2529
+ /** Layout type constraints */
2530
+ layouts?: LayoutTypeConstraints;
2531
+ /** Rule (conditional) constraints */
2532
+ rules?: RuleConstraints;
2533
+ }
2534
+
2535
+ /**
2536
+ * Union of all UI Schema element types.
2537
+ *
2538
+ * @public
2539
+ */
2540
+ export declare type UISchemaElement = Categorization | Category | ControlElement | GroupLayout | HorizontalLayout | LabelElement | VerticalLayout;
2541
+
2542
+ export { uiSchemaSchema }
2543
+
2544
+ /**
2545
+ * A vertical layout element.
2546
+ *
2547
+ * @public
2548
+ */
2549
+ export declare interface VerticalLayout {
2550
+ /** Discriminator identifying a vertical layout container. */
2551
+ readonly type: "VerticalLayout";
2552
+ /** Child elements rendered in vertical order. */
2553
+ readonly elements: UISchemaElement[];
2554
+ /** Optional rule controlling visibility or enablement. */
2555
+ readonly rule?: Rule | undefined;
2556
+ /** Renderer-specific layout options. */
2557
+ readonly options?: Record<string, unknown> | undefined;
2558
+ /** Additional renderer-specific extension properties. */
2559
+ readonly [k: string]: unknown;
2560
+ }
2561
+
2562
+ /**
2563
+ * Registration for a vocabulary keyword to include in a JSON Schema `$vocabulary` declaration.
2564
+ *
2565
+ * @public
2566
+ */
2567
+ declare interface VocabularyKeywordRegistration$1 {
2568
+ /** The keyword name (without vendor prefix). */
2569
+ readonly keyword: string;
2570
+ /** JSON Schema that describes the valid values for this keyword. */
2571
+ readonly schema: ExtensionPayloadValue$1;
2572
+ }
2573
+
2574
+ /**
2575
+ * Registration for a vocabulary keyword to include in a JSON Schema `$vocabulary` declaration.
2576
+ *
2577
+ * @public
2578
+ */
2579
+ export declare interface VocabularyKeywordRegistration {
2580
+ /** The keyword name (without vendor prefix). */
2581
+ readonly keyword: string;
2582
+ /** JSON Schema that describes the valid values for this keyword. */
2583
+ readonly schema: ExtensionPayloadValue;
2584
+ }
2585
+
2586
+ /**
2587
+ * Registration for a vocabulary keyword to include in a JSON Schema `$vocabulary` declaration.
2588
+ *
2589
+ * @public
2590
+ */
2591
+ declare interface VocabularyKeywordRegistration_2 {
2592
+ /** The keyword name (without vendor prefix). */
2593
+ readonly keyword: string;
2594
+ /** JSON Schema that describes the valid values for this keyword. */
2595
+ readonly schema: ExtensionPayloadValue_2;
2596
+ }
2597
+
2598
+ export { }