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