@formspec/core 0.1.0-alpha.21 → 0.1.0-alpha.26

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.
package/dist/core.d.ts CHANGED
@@ -10,14 +10,7 @@
10
10
  * @packageDocumentation
11
11
  */
12
12
 
13
- /**
14
- * Discriminated union of all annotation types.
15
- * Annotations are value-influencing: they describe or present a field
16
- * but do not affect which values are valid.
17
- *
18
- * @public
19
- */
20
- export declare type AnnotationNode = DisplayNameAnnotationNode | DescriptionAnnotationNode | RemarksAnnotationNode | FormatAnnotationNode | PlaceholderAnnotationNode | DefaultValueAnnotationNode | DeprecatedAnnotationNode | FormatHintAnnotationNode | CustomAnnotationNode;
13
+ /* Excluded from this release type: AnnotationNode */
21
14
 
22
15
  /**
23
16
  * Union of all field types.
@@ -26,18 +19,7 @@ export declare type AnnotationNode = DisplayNameAnnotationNode | DescriptionAnno
26
19
  */
27
20
  export declare type AnyField = TextField<string> | NumberField<string> | BooleanField<string> | StaticEnumField<string, readonly EnumOptionValue[]> | DynamicEnumField<string, string> | DynamicSchemaField<string> | ArrayField<string, readonly FormElement[]> | ObjectField<string, readonly FormElement[]>;
28
21
 
29
- /**
30
- * Array uniqueness constraint.
31
- *
32
- * @public
33
- */
34
- export declare interface ArrayCardinalityConstraintNode {
35
- readonly kind: "constraint";
36
- readonly constraintKind: "uniqueItems";
37
- readonly value: true;
38
- readonly path?: PathTarget;
39
- readonly provenance: Provenance;
40
- }
22
+ /* Excluded from this release type: ArrayCardinalityConstraintNode */
41
23
 
42
24
  /**
43
25
  * An array field containing repeating items.
@@ -68,15 +50,7 @@ export declare interface ArrayField<N extends string, Items extends readonly For
68
50
  readonly maxItems?: number;
69
51
  }
70
52
 
71
- /**
72
- * Array type with a single items type.
73
- *
74
- * @public
75
- */
76
- export declare interface ArrayTypeNode {
77
- readonly kind: "array";
78
- readonly items: TypeNode;
79
- }
53
+ /* Excluded from this release type: ArrayTypeNode */
80
54
 
81
55
  /**
82
56
  * A boolean checkbox field.
@@ -98,31 +72,6 @@ export declare interface BooleanField<N extends string> {
98
72
  readonly required?: boolean;
99
73
  }
100
74
 
101
- /**
102
- * Built-in constraint names mapped to their expected value type for parsing.
103
- * Constraints are surface-agnostic — they manifest as both TSDoc tags
104
- * (e.g., `@minimum 0`) and chain DSL options (e.g., `{ minimum: 0 }`).
105
- *
106
- * Keys use camelCase matching JSON Schema property names.
107
- *
108
- * @public
109
- */
110
- export declare const BUILTIN_CONSTRAINT_DEFINITIONS: {
111
- readonly minimum: "number";
112
- readonly maximum: "number";
113
- readonly exclusiveMinimum: "number";
114
- readonly exclusiveMaximum: "number";
115
- readonly multipleOf: "number";
116
- readonly minLength: "number";
117
- readonly maxLength: "number";
118
- readonly minItems: "number";
119
- readonly maxItems: "number";
120
- readonly uniqueItems: "boolean";
121
- readonly pattern: "string";
122
- readonly const: "json";
123
- readonly enumOptions: "json";
124
- };
125
-
126
75
  /**
127
76
  * Registration for mapping a built-in TSDoc tag onto a custom constraint when
128
77
  * it is used on a particular custom type.
@@ -135,7 +84,7 @@ export declare interface BuiltinConstraintBroadeningRegistration {
135
84
  /** The custom constraint to emit for this built-in tag. */
136
85
  readonly constraintName: string;
137
86
  /** Parser from raw TSDoc text to extension payload. */
138
- readonly parseValue: (raw: string) => JsonValue;
87
+ readonly parseValue: (raw: string) => ExtensionPayloadValue;
139
88
  }
140
89
 
141
90
  /**
@@ -143,7 +92,7 @@ export declare interface BuiltinConstraintBroadeningRegistration {
143
92
  *
144
93
  * @public
145
94
  */
146
- export declare type BuiltinConstraintName = keyof typeof BUILTIN_CONSTRAINT_DEFINITIONS;
95
+ export declare type BuiltinConstraintName = "minimum" | "maximum" | "exclusiveMinimum" | "exclusiveMaximum" | "multipleOf" | "minLength" | "maxLength" | "minItems" | "maxItems" | "uniqueItems" | "pattern" | "const" | "enumOptions";
147
96
 
148
97
  /**
149
98
  * A conditional wrapper that shows/hides elements based on another field's value.
@@ -165,42 +114,11 @@ export declare interface Conditional<FieldName extends string, Value, Elements e
165
114
  readonly elements: Elements;
166
115
  }
167
116
 
168
- /**
169
- * Conditional visibility based on another field's value.
170
- *
171
- * @public
172
- */
173
- export declare interface ConditionalLayoutNode {
174
- readonly kind: "conditional";
175
- /** The field whose value triggers visibility. */
176
- readonly fieldName: string;
177
- /** The value that makes the condition true (SHOW). */
178
- readonly value: JsonValue;
179
- /** Elements shown when the condition is met. */
180
- readonly elements: readonly FormIRElement[];
181
- readonly provenance: Provenance;
182
- }
117
+ /* Excluded from this release type: ConditionalLayoutNode */
183
118
 
184
- /**
185
- * Literal-value equality constraint.
186
- *
187
- * @public
188
- */
189
- export declare interface ConstConstraintNode {
190
- readonly kind: "constraint";
191
- readonly constraintKind: "const";
192
- readonly value: JsonValue;
193
- readonly path?: PathTarget;
194
- readonly provenance: Provenance;
195
- }
119
+ /* Excluded from this release type: ConstConstraintNode */
196
120
 
197
- /**
198
- * Discriminated union of all constraint types.
199
- * Constraints are set-influencing: they narrow the set of valid values.
200
- *
201
- * @public
202
- */
203
- export declare type ConstraintNode = NumericConstraintNode | LengthConstraintNode | PatternConstraintNode | ArrayCardinalityConstraintNode | EnumMemberConstraintNode | ConstConstraintNode | CustomConstraintNode;
121
+ /* Excluded from this release type: ConstraintNode */
204
122
 
205
123
  /**
206
124
  * Semantic metadata for ordered custom constraints that should participate in
@@ -231,13 +149,13 @@ export declare interface ConstraintTagRegistration {
231
149
  /** The custom constraint that this tag should produce. */
232
150
  readonly constraintName: string;
233
151
  /** Parser from raw TSDoc text to JSON-serializable payload. */
234
- readonly parseValue: (raw: string) => JsonValue;
152
+ readonly parseValue: (raw: string) => ExtensionPayloadValue;
235
153
  /**
236
154
  * Optional precise applicability predicate for the field type being parsed.
237
155
  * When omitted, the target custom constraint registration controls type
238
156
  * applicability during validation.
239
157
  */
240
- readonly isApplicableToType?: (type: TypeNode) => boolean;
158
+ readonly isApplicableToType?: (type: ExtensionApplicableType) => boolean;
241
159
  }
242
160
 
243
161
  /**
@@ -251,24 +169,12 @@ export declare interface ConstraintTagRegistration {
251
169
  */
252
170
  export declare function createInitialFieldState<T>(value: T): FieldState<T>;
253
171
 
254
- /**
255
- * Extension-registered custom annotation.
256
- *
257
- * @public
258
- */
259
- export declare interface CustomAnnotationNode {
260
- readonly kind: "annotation";
261
- readonly annotationKind: "custom";
262
- /** Extension-qualified ID: `"<vendor-prefix>/<extension-name>/<annotation-name>"` */
263
- readonly annotationId: string;
264
- readonly value: JsonValue;
265
- readonly provenance: Provenance;
266
- }
172
+ /* Excluded from this release type: CustomAnnotationNode */
267
173
 
268
174
  /**
269
175
  * Registration for a custom annotation that may produce JSON Schema keywords.
270
176
  *
271
- * Custom annotations are referenced via {@link CustomAnnotationNode} in the IR.
177
+ * Custom annotations are referenced by FormSpec's internal custom-annotation nodes.
272
178
  * They describe or present a field but do not affect which values are valid.
273
179
  *
274
180
  * @public
@@ -280,31 +186,15 @@ export declare interface CustomAnnotationRegistration {
280
186
  * Optionally converts the annotation value into JSON Schema keywords.
281
187
  * If omitted, the annotation has no JSON Schema representation (UI-only).
282
188
  */
283
- readonly toJsonSchema?: (value: JsonValue, vendorPrefix: string) => Record<string, unknown>;
189
+ readonly toJsonSchema?: (value: ExtensionPayloadValue, vendorPrefix: string) => Record<string, unknown>;
284
190
  }
285
191
 
286
- /**
287
- * Extension-registered custom constraint.
288
- *
289
- * @public
290
- */
291
- export declare interface CustomConstraintNode {
292
- readonly kind: "constraint";
293
- readonly constraintKind: "custom";
294
- /** Extension-qualified ID: `"<vendor-prefix>/<extension-name>/<constraint-name>"` */
295
- readonly constraintId: string;
296
- /** JSON-serializable payload defined by the extension. */
297
- readonly payload: JsonValue;
298
- /** How this constraint composes with others of the same `constraintId`. */
299
- readonly compositionRule: "intersect" | "override";
300
- readonly path?: PathTarget;
301
- readonly provenance: Provenance;
302
- }
192
+ /* Excluded from this release type: CustomConstraintNode */
303
193
 
304
194
  /**
305
195
  * Registration for a custom constraint that maps to JSON Schema keywords.
306
196
  *
307
- * Custom constraints are referenced via {@link CustomConstraintNode} in the IR.
197
+ * Custom constraints are referenced by FormSpec's internal custom-constraint nodes.
308
198
  *
309
199
  * @public
310
200
  */
@@ -321,18 +211,18 @@ export declare interface CustomConstraintRegistration {
321
211
  * TypeNode kinds this constraint is applicable to, or `null` for any type.
322
212
  * Used by the validator to emit TYPE_MISMATCH diagnostics.
323
213
  */
324
- readonly applicableTypes: readonly TypeNode["kind"][] | null;
214
+ readonly applicableTypes: readonly ExtensionApplicableType["kind"][] | null;
325
215
  /**
326
216
  * Optional precise type predicate used when kind-level applicability is too
327
217
  * broad (for example, constraints that apply to integer-like primitives but
328
218
  * not strings).
329
219
  */
330
- readonly isApplicableToType?: (type: TypeNode) => boolean;
220
+ readonly isApplicableToType?: (type: ExtensionApplicableType) => boolean;
331
221
  /**
332
222
  * Optional comparator for payloads belonging to the same custom constraint.
333
223
  * Return values follow the `Array.prototype.sort()` contract.
334
224
  */
335
- readonly comparePayloads?: (left: JsonValue, right: JsonValue) => number;
225
+ readonly comparePayloads?: (left: ExtensionPayloadValue, right: ExtensionPayloadValue) => number;
336
226
  /**
337
227
  * Optional semantic family metadata for generic contradiction/broadening
338
228
  * handling across ordered constraints.
@@ -341,37 +231,19 @@ export declare interface CustomConstraintRegistration {
341
231
  /**
342
232
  * Converts the custom constraint's payload into JSON Schema keywords.
343
233
  *
344
- * @param payload - The opaque JSON payload from the {@link CustomConstraintNode}.
234
+ * @param payload - The opaque JSON payload stored on the custom constraint node.
345
235
  * @param vendorPrefix - The vendor prefix for extension keywords.
346
236
  * @returns A JSON Schema fragment with the constraint keywords.
347
237
  */
348
- readonly toJsonSchema: (payload: JsonValue, vendorPrefix: string) => Record<string, unknown>;
238
+ readonly toJsonSchema: (payload: ExtensionPayloadValue, vendorPrefix: string) => Record<string, unknown>;
349
239
  }
350
240
 
351
- /**
352
- * Custom type registered by an extension.
353
- *
354
- * @public
355
- */
356
- export declare interface CustomTypeNode {
357
- readonly kind: "custom";
358
- /**
359
- * The extension-qualified type identifier.
360
- * Format: `"<vendor-prefix>/<extension-name>/<type-name>"`
361
- * e.g., `"x-stripe/monetary/MonetaryAmount"`
362
- */
363
- readonly typeId: string;
364
- /**
365
- * Opaque payload serialized by the extension that registered this type.
366
- * Must be JSON-serializable.
367
- */
368
- readonly payload: JsonValue;
369
- }
241
+ /* Excluded from this release type: CustomTypeNode */
370
242
 
371
243
  /**
372
244
  * Registration for a custom type that maps to a JSON Schema representation.
373
245
  *
374
- * Custom types are referenced via {@link CustomTypeNode} in the IR and
246
+ * Custom types are referenced by FormSpec's internal custom-type IR nodes and
375
247
  * resolved to JSON Schema via `toJsonSchema` during generation.
376
248
  *
377
249
  * @public
@@ -387,11 +259,11 @@ export declare interface CustomTypeRegistration {
387
259
  /**
388
260
  * Converts the custom type's payload into a JSON Schema fragment.
389
261
  *
390
- * @param payload - The opaque JSON payload from the {@link CustomTypeNode}.
262
+ * @param payload - The opaque JSON payload stored on the custom type node.
391
263
  * @param vendorPrefix - The vendor prefix for extension keywords (e.g., "x-stripe").
392
264
  * @returns A JSON Schema fragment representing this type.
393
265
  */
394
- readonly toJsonSchema: (payload: JsonValue, vendorPrefix: string) => Record<string, unknown>;
266
+ readonly toJsonSchema: (payload: ExtensionPayloadValue, vendorPrefix: string) => Record<string, unknown>;
395
267
  /**
396
268
  * Optional broadening of built-in constraint tags so they can apply to this
397
269
  * custom type without modifying the core built-in constraint tables.
@@ -447,18 +319,7 @@ export declare type DataSourceValueType<Source extends string> = Source extends
447
319
  id: infer ID;
448
320
  } ? ID : string : string;
449
321
 
450
- /**
451
- * Default-value annotation.
452
- *
453
- * @public
454
- */
455
- export declare interface DefaultValueAnnotationNode {
456
- readonly kind: "annotation";
457
- readonly annotationKind: "defaultValue";
458
- /** Must be JSON-serializable and type-compatible (verified during Validate phase). */
459
- readonly value: JsonValue;
460
- readonly provenance: Provenance;
461
- }
322
+ /* Excluded from this release type: DefaultValueAnnotationNode */
462
323
 
463
324
  /**
464
325
  * Defines a custom annotation registration. Currently an identity function
@@ -514,42 +375,11 @@ export declare function defineCustomType(reg: CustomTypeRegistration): CustomTyp
514
375
  */
515
376
  export declare function defineExtension(def: ExtensionDefinition): ExtensionDefinition;
516
377
 
517
- /**
518
- * Deprecated annotation.
519
- *
520
- * @public
521
- */
522
- export declare interface DeprecatedAnnotationNode {
523
- readonly kind: "annotation";
524
- readonly annotationKind: "deprecated";
525
- /** Optional deprecation message. */
526
- readonly message?: string;
527
- readonly provenance: Provenance;
528
- }
378
+ /* Excluded from this release type: DeprecatedAnnotationNode */
529
379
 
530
- /**
531
- * Description annotation.
532
- *
533
- * @public
534
- */
535
- export declare interface DescriptionAnnotationNode {
536
- readonly kind: "annotation";
537
- readonly annotationKind: "description";
538
- readonly value: string;
539
- readonly provenance: Provenance;
540
- }
380
+ /* Excluded from this release type: DescriptionAnnotationNode */
541
381
 
542
- /**
543
- * Display-name annotation.
544
- *
545
- * @public
546
- */
547
- export declare interface DisplayNameAnnotationNode {
548
- readonly kind: "annotation";
549
- readonly annotationKind: "displayName";
550
- readonly value: string;
551
- readonly provenance: Provenance;
552
- }
382
+ /* Excluded from this release type: DisplayNameAnnotationNode */
553
383
 
554
384
  /**
555
385
  * A field with dynamic enum options (fetched from a data source at runtime).
@@ -600,47 +430,11 @@ export declare interface DynamicSchemaField<N extends string> {
600
430
  readonly params?: readonly string[];
601
431
  }
602
432
 
603
- /**
604
- * Dynamic type whose schema is resolved at runtime from a named data source.
605
- *
606
- * @public
607
- */
608
- export declare interface DynamicTypeNode {
609
- readonly kind: "dynamic";
610
- readonly dynamicKind: "enum" | "schema";
611
- /** Key identifying the runtime data source or schema provider. */
612
- readonly sourceKey: string;
613
- /**
614
- * For dynamic enums: field names whose current values are passed as
615
- * parameters to the data source resolver.
616
- */
617
- readonly parameterFields: readonly string[];
618
- }
433
+ /* Excluded from this release type: DynamicTypeNode */
619
434
 
620
- /**
621
- * A member of a static enum type.
622
- *
623
- * @public
624
- */
625
- export declare interface EnumMember {
626
- /** The serialized value stored in data. */
627
- readonly value: string | number;
628
- /** Optional per-member display name. */
629
- readonly displayName?: string;
630
- }
435
+ /* Excluded from this release type: EnumMember */
631
436
 
632
- /**
633
- * Enum member subset constraint that only narrows the allowed member set.
634
- *
635
- * @public
636
- */
637
- export declare interface EnumMemberConstraintNode {
638
- readonly kind: "constraint";
639
- readonly constraintKind: "allowedMembers";
640
- readonly members: readonly (string | number)[];
641
- readonly path?: PathTarget;
642
- readonly provenance: Provenance;
643
- }
437
+ /* Excluded from this release type: EnumMemberConstraintNode */
644
438
 
645
439
  /**
646
440
  * An enum option with a separate ID and display label.
@@ -650,7 +444,9 @@ export declare interface EnumMemberConstraintNode {
650
444
  * @public
651
445
  */
652
446
  export declare interface EnumOption {
447
+ /** Stored enum value written into submitted data. */
653
448
  readonly id: string;
449
+ /** Human-readable label shown to end users. */
654
450
  readonly label: string;
655
451
  }
656
452
 
@@ -661,15 +457,7 @@ export declare interface EnumOption {
661
457
  */
662
458
  export declare type EnumOptionValue = string | EnumOption;
663
459
 
664
- /**
665
- * Static enum type with members known at build time.
666
- *
667
- * @public
668
- */
669
- export declare interface EnumTypeNode {
670
- readonly kind: "enum";
671
- readonly members: readonly EnumMember[];
672
- }
460
+ /* Excluded from this release type: EnumTypeNode */
673
461
 
674
462
  /**
675
463
  * Predicate types for conditional logic.
@@ -693,6 +481,25 @@ export declare interface EqualsPredicate<K extends string, V> {
693
481
  readonly value: V;
694
482
  }
695
483
 
484
+ /**
485
+ * A curated type shape exposed to extension applicability hooks.
486
+ *
487
+ * This intentionally exposes only the fields needed to determine tag/type
488
+ * applicability without committing the entire canonical IR as public API.
489
+ *
490
+ * @public
491
+ */
492
+ export declare type ExtensionApplicableType = {
493
+ readonly kind: "primitive";
494
+ readonly primitiveKind: "string" | "number" | "integer" | "bigint" | "boolean" | "null";
495
+ } | {
496
+ readonly kind: "custom";
497
+ readonly typeId: string;
498
+ readonly payload: ExtensionPayloadValue;
499
+ } | {
500
+ readonly kind: Exclude<ExtensionTypeKind, "primitive" | "custom">;
501
+ };
502
+
696
503
  /**
697
504
  * A complete extension definition bundling types, constraints, annotations,
698
505
  * and vocabulary keywords.
@@ -730,6 +537,22 @@ export declare interface ExtensionDefinition {
730
537
  readonly vocabularyKeywords?: readonly VocabularyKeywordRegistration[];
731
538
  }
732
539
 
540
+ /**
541
+ * A JSON-serializable payload value used by extension registration hooks.
542
+ *
543
+ * @public
544
+ */
545
+ export declare type ExtensionPayloadValue = null | boolean | number | string | readonly ExtensionPayloadValue[] | {
546
+ readonly [key: string]: ExtensionPayloadValue;
547
+ };
548
+
549
+ /**
550
+ * Top-level type kinds that extension applicability hooks may inspect.
551
+ *
552
+ * @public
553
+ */
554
+ export declare type ExtensionTypeKind = "primitive" | "enum" | "array" | "object" | "record" | "union" | "reference" | "dynamic" | "custom";
555
+
733
556
  /**
734
557
  * Response from a data source resolver function.
735
558
  *
@@ -746,34 +569,7 @@ export declare interface FetchOptionsResponse<T = unknown> {
746
569
  readonly message?: string;
747
570
  }
748
571
 
749
- /**
750
- * A single form field after canonicalization.
751
- *
752
- * @public
753
- */
754
- export declare interface FieldNode {
755
- readonly kind: "field";
756
- /** The field's key in the data schema. */
757
- readonly name: string;
758
- /** The resolved type of this field. */
759
- readonly type: TypeNode;
760
- /** Whether this field is required in the data schema. */
761
- readonly required: boolean;
762
- /** Set-influencing constraints, after merging. */
763
- readonly constraints: readonly ConstraintNode[];
764
- /** Value-influencing annotations, after merging. */
765
- readonly annotations: readonly AnnotationNode[];
766
- /** Where this field was declared. */
767
- readonly provenance: Provenance;
768
- /**
769
- * Debug only — ordered list of constraint/annotation nodes that participated
770
- * in merging, including dominated ones.
771
- */
772
- readonly mergeHistory?: readonly {
773
- readonly node: ConstraintNode | AnnotationNode;
774
- readonly dominated: boolean;
775
- }[];
776
- }
572
+ /* Excluded from this release type: FieldNode */
777
573
 
778
574
  /**
779
575
  * Represents the runtime state of a single form field.
@@ -795,31 +591,9 @@ export declare interface FieldState<T> {
795
591
  readonly errors: readonly string[];
796
592
  }
797
593
 
798
- /**
799
- * Schema format annotation, for example `email`, `date`, or `uri`.
800
- *
801
- * @public
802
- */
803
- export declare interface FormatAnnotationNode {
804
- readonly kind: "annotation";
805
- readonly annotationKind: "format";
806
- readonly value: string;
807
- readonly provenance: Provenance;
808
- }
594
+ /* Excluded from this release type: FormatAnnotationNode */
809
595
 
810
- /**
811
- * UI rendering hint — does not affect schema validation.
812
- * Unlike FormatAnnotationNode, this never emits a JSON Schema `format`.
813
- *
814
- * @public
815
- */
816
- export declare interface FormatHintAnnotationNode {
817
- readonly kind: "annotation";
818
- readonly annotationKind: "formatHint";
819
- /** Renderer-specific format identifier: "textarea", "radio", "date", "color", etc. */
820
- readonly format: string;
821
- readonly provenance: Provenance;
822
- }
596
+ /* Excluded from this release type: FormatHintAnnotationNode */
823
597
 
824
598
  /**
825
599
  * Union of all form element types (fields and structural elements).
@@ -828,44 +602,9 @@ export declare interface FormatHintAnnotationNode {
828
602
  */
829
603
  export declare type FormElement = AnyField | Group<readonly FormElement[]> | Conditional<string, unknown, readonly FormElement[]>;
830
604
 
831
- /**
832
- * The complete Canonical Intermediate Representation for a form.
833
- *
834
- * Output of the Canonicalize phase; input to Validate, Generate (JSON Schema),
835
- * and Generate (UI Schema) phases.
836
- *
837
- * Serializable to JSON — no live compiler objects.
838
- *
839
- * @public
840
- */
841
- export declare interface FormIR {
842
- readonly kind: "form-ir";
843
- /**
844
- * Schema version for the IR format itself.
845
- * Should equal `IR_VERSION`.
846
- */
847
- readonly irVersion: string;
848
- /** Top-level elements of the form: fields and layout nodes. */
849
- readonly elements: readonly FormIRElement[];
850
- /** Root-level annotations derived from the source declaration itself. */
851
- readonly rootAnnotations?: readonly AnnotationNode[];
852
- /**
853
- * Registry of named types referenced by fields in this form.
854
- * Keys are fully-qualified type names matching `ReferenceTypeNode.name`.
855
- */
856
- readonly typeRegistry: Readonly<Record<string, TypeDefinition>>;
857
- /** Root-level metadata for the form itself. */
858
- readonly annotations?: readonly AnnotationNode[];
859
- /** Provenance of the form definition itself. */
860
- readonly provenance: Provenance;
861
- }
605
+ /* Excluded from this release type: FormIR */
862
606
 
863
- /**
864
- * Union of all IR element types.
865
- *
866
- * @public
867
- */
868
- export declare type FormIRElement = FieldNode | LayoutNode;
607
+ /* Excluded from this release type: FormIRElement */
869
608
 
870
609
  /**
871
610
  * A complete form specification.
@@ -917,26 +656,9 @@ export declare interface Group<Elements extends readonly FormElement[]> {
917
656
  readonly elements: Elements;
918
657
  }
919
658
 
920
- /**
921
- * A visual grouping of form elements.
922
- *
923
- * @public
924
- */
925
- export declare interface GroupLayoutNode {
926
- readonly kind: "group";
927
- readonly label: string;
928
- /** Elements contained in this group — may be fields or nested groups. */
929
- readonly elements: readonly FormIRElement[];
930
- readonly provenance: Provenance;
931
- }
659
+ /* Excluded from this release type: GroupLayoutNode */
932
660
 
933
- /**
934
- * The current IR format version. Centralized here so all canonicalizers
935
- * and consumers reference a single source of truth.
936
- *
937
- * @public
938
- */
939
- export declare const IR_VERSION: "0.1.0";
661
+ /* Excluded from this release type: IR_VERSION */
940
662
 
941
663
  /**
942
664
  * Narrows a `FormElement` to an array field.
@@ -952,19 +674,6 @@ export declare function isArrayField(element: FormElement): element is ArrayFiel
952
674
  */
953
675
  export declare function isBooleanField(element: FormElement): element is BooleanField<string>;
954
676
 
955
- /**
956
- * Type guard: checks whether a tag name is a known built-in constraint.
957
- *
958
- * Uses `Object.hasOwn()` rather than `in` to prevent prototype-chain
959
- * matches on names like `"toString"` or `"constructor"`.
960
- *
961
- * Callers should normalize with {@link normalizeConstraintTagName} first
962
- * if the input may be PascalCase.
963
- *
964
- * @public
965
- */
966
- export declare function isBuiltinConstraintName(tagName: string): tagName is BuiltinConstraintName;
967
-
968
677
  /**
969
678
  * Narrows a `FormElement` to a conditional wrapper.
970
679
  *
@@ -1028,56 +737,11 @@ export declare function isStaticEnumField(element: FormElement): element is Stat
1028
737
  */
1029
738
  export declare function isTextField(element: FormElement): element is TextField<string>;
1030
739
 
1031
- /**
1032
- * A JSON-serializable value. All IR nodes must be representable as JSON.
1033
- *
1034
- * @public
1035
- */
1036
- export declare type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
1037
- readonly [key: string]: JsonValue;
1038
- };
740
+ /* Excluded from this release type: JsonValue */
1039
741
 
1040
- /**
1041
- * Union of layout node types.
1042
- *
1043
- * @public
1044
- */
1045
- export declare type LayoutNode = GroupLayoutNode | ConditionalLayoutNode;
742
+ /* Excluded from this release type: LayoutNode */
1046
743
 
1047
- /**
1048
- * String length and array item count constraints.
1049
- *
1050
- * `minLength`/`maxLength` apply to strings; `minItems`/`maxItems` apply to
1051
- * arrays. They share the same node shape because the composition rules are
1052
- * identical.
1053
- *
1054
- * Type applicability: `minLength`/`maxLength` require `PrimitiveTypeNode("string")`;
1055
- * `minItems`/`maxItems` require `ArrayTypeNode`.
1056
- *
1057
- * @public
1058
- */
1059
- export declare interface LengthConstraintNode {
1060
- readonly kind: "constraint";
1061
- readonly constraintKind: "minLength" | "maxLength" | "minItems" | "maxItems";
1062
- readonly value: number;
1063
- readonly path?: PathTarget;
1064
- readonly provenance: Provenance;
1065
- }
1066
-
1067
- /**
1068
- * Normalizes a constraint tag name from PascalCase to camelCase.
1069
- *
1070
- * Lowercases the first character so that e.g. `"Minimum"` becomes `"minimum"`.
1071
- * Callers must strip the `@` prefix before calling this function.
1072
- *
1073
- * @example
1074
- * normalizeConstraintTagName("Minimum") // "minimum"
1075
- * normalizeConstraintTagName("MinLength") // "minLength"
1076
- * normalizeConstraintTagName("minimum") // "minimum" (idempotent)
1077
- *
1078
- * @public
1079
- */
1080
- export declare function normalizeConstraintTagName(tagName: string): string;
744
+ /* Excluded from this release type: LengthConstraintNode */
1081
745
 
1082
746
  /**
1083
747
  * A numeric input field.
@@ -1105,26 +769,7 @@ export declare interface NumberField<N extends string> {
1105
769
  readonly multipleOf?: number;
1106
770
  }
1107
771
 
1108
- /**
1109
- * Numeric constraints: bounds and multipleOf.
1110
- *
1111
- * `minimum` and `maximum` are inclusive; `exclusiveMinimum` and
1112
- * `exclusiveMaximum` are exclusive bounds (matching JSON Schema 2020-12
1113
- * semantics).
1114
- *
1115
- * Type applicability: may only attach to fields with `PrimitiveTypeNode("number")`
1116
- * or a `ReferenceTypeNode` that resolves to one.
1117
- *
1118
- * @public
1119
- */
1120
- export declare interface NumericConstraintNode {
1121
- readonly kind: "constraint";
1122
- readonly constraintKind: "minimum" | "maximum" | "exclusiveMinimum" | "exclusiveMaximum" | "multipleOf";
1123
- readonly value: number;
1124
- /** If present, targets a nested sub-field rather than the field itself. */
1125
- readonly path?: PathTarget;
1126
- readonly provenance: Provenance;
1127
- }
772
+ /* Excluded from this release type: NumericConstraintNode */
1128
773
 
1129
774
  /**
1130
775
  * An object field containing nested properties.
@@ -1151,92 +796,15 @@ export declare interface ObjectField<N extends string, Properties extends readon
1151
796
  readonly required?: boolean;
1152
797
  }
1153
798
 
1154
- /**
1155
- * A named property within an object type.
1156
- *
1157
- * @public
1158
- */
1159
- export declare interface ObjectProperty {
1160
- readonly name: string;
1161
- readonly type: TypeNode;
1162
- readonly optional: boolean;
1163
- /**
1164
- * Use-site constraints on this property.
1165
- * Distinct from constraints on the property's type — these are
1166
- * use-site constraints (e.g., `@minimum :amount 0` targets the
1167
- * `amount` property of a `MonetaryAmount` field).
1168
- */
1169
- readonly constraints: readonly ConstraintNode[];
1170
- /** Use-site annotations on this property. */
1171
- readonly annotations: readonly AnnotationNode[];
1172
- readonly provenance: Provenance;
1173
- }
799
+ /* Excluded from this release type: ObjectProperty */
1174
800
 
1175
- /**
1176
- * Object type with named properties.
1177
- *
1178
- * @public
1179
- */
1180
- export declare interface ObjectTypeNode {
1181
- readonly kind: "object";
1182
- /**
1183
- * Named properties of this object. Order is preserved from the source
1184
- * declaration for deterministic output.
1185
- */
1186
- readonly properties: readonly ObjectProperty[];
1187
- /**
1188
- * Whether additional properties beyond those listed are permitted.
1189
- * Ordinary static object types default to true under the current spec.
1190
- * Explicitly closed-object modes may still set this to false.
1191
- */
1192
- readonly additionalProperties: boolean;
1193
- }
801
+ /* Excluded from this release type: ObjectTypeNode */
1194
802
 
1195
- /**
1196
- * A path targeting a sub-field within a complex type.
1197
- * Used by constraints and annotations to target nested properties.
1198
- *
1199
- * @public
1200
- */
1201
- export declare interface PathTarget {
1202
- /**
1203
- * Sequence of property names forming a path from the annotated field's type
1204
- * to the target sub-field.
1205
- * e.g., `["value"]` or `["address", "zip"]`
1206
- */
1207
- readonly segments: readonly string[];
1208
- }
803
+ /* Excluded from this release type: PathTarget */
1209
804
 
1210
- /**
1211
- * String pattern constraint (ECMA-262 regex without delimiters).
1212
- *
1213
- * Multiple `pattern` constraints on the same field compose via intersection:
1214
- * all patterns must match simultaneously.
1215
- *
1216
- * Type applicability: requires `PrimitiveTypeNode("string")`.
1217
- *
1218
- * @public
1219
- */
1220
- export declare interface PatternConstraintNode {
1221
- readonly kind: "constraint";
1222
- readonly constraintKind: "pattern";
1223
- /** ECMA-262 regular expression, without delimiters. */
1224
- readonly pattern: string;
1225
- readonly path?: PathTarget;
1226
- readonly provenance: Provenance;
1227
- }
805
+ /* Excluded from this release type: PatternConstraintNode */
1228
806
 
1229
- /**
1230
- * Placeholder annotation.
1231
- *
1232
- * @public
1233
- */
1234
- export declare interface PlaceholderAnnotationNode {
1235
- readonly kind: "annotation";
1236
- readonly annotationKind: "placeholder";
1237
- readonly value: string;
1238
- readonly provenance: Provenance;
1239
- }
807
+ /* Excluded from this release type: PlaceholderAnnotationNode */
1240
808
 
1241
809
  /**
1242
810
  * Union of all predicate types.
@@ -1250,94 +818,15 @@ export declare interface PlaceholderAnnotationNode {
1250
818
  */
1251
819
  export declare type Predicate<K extends string = string, V = unknown> = EqualsPredicate<K, V>;
1252
820
 
1253
- /**
1254
- * Primitive types mapping directly to JSON Schema primitives.
1255
- *
1256
- * Note: integer is NOT a primitive kind — integer semantics are expressed
1257
- * via a `multipleOf: 1` constraint on a number type.
1258
- *
1259
- * @public
1260
- */
1261
- export declare interface PrimitiveTypeNode {
1262
- readonly kind: "primitive";
1263
- readonly primitiveKind: "string" | "number" | "integer" | "bigint" | "boolean" | "null";
1264
- }
821
+ /* Excluded from this release type: PrimitiveTypeNode */
1265
822
 
1266
- /**
1267
- * Describes the origin of an IR node.
1268
- * Enables diagnostics that point to the source of a contradiction or error.
1269
- *
1270
- * @public
1271
- */
1272
- export declare interface Provenance {
1273
- /** The authoring surface that produced this node. */
1274
- readonly surface: "tsdoc" | "chain-dsl" | "extension" | "inferred";
1275
- /** Absolute path to the source file. */
1276
- readonly file: string;
1277
- /** 1-based line number in the source file. */
1278
- readonly line: number;
1279
- /** 0-based column number in the source file. */
1280
- readonly column: number;
1281
- /** Length of the source span in characters (for IDE underline ranges). */
1282
- readonly length?: number;
1283
- /**
1284
- * The specific tag, call, or construct that produced this node.
1285
- * Examples: `@minimum`, `field.number({ min: 0 })`, `optional`
1286
- */
1287
- readonly tagName?: string;
1288
- }
823
+ /* Excluded from this release type: Provenance */
1289
824
 
1290
- /**
1291
- * Record (dictionary) type — an object with a string index signature and no
1292
- * named properties. Corresponds to `Record<string, T>` or `{ [k: string]: T }`.
1293
- *
1294
- * Emitted as `{ "type": "object", "additionalProperties": <value schema> }` in
1295
- * JSON Schema per spec 003 §2.5.
1296
- *
1297
- * @public
1298
- */
1299
- export declare interface RecordTypeNode {
1300
- readonly kind: "record";
1301
- /** The type of each value in the dictionary. */
1302
- readonly valueType: TypeNode;
1303
- }
825
+ /* Excluded from this release type: RecordTypeNode */
1304
826
 
1305
- /**
1306
- * Named type reference preserved for `$defs` and `$ref` emission.
1307
- *
1308
- * @public
1309
- */
1310
- export declare interface ReferenceTypeNode {
1311
- readonly kind: "reference";
1312
- /**
1313
- * The fully-qualified name of the referenced type.
1314
- * For TypeScript interfaces/type aliases: `"<module>#<TypeName>"`.
1315
- * For built-in types: the primitive kind string.
1316
- */
1317
- readonly name: string;
1318
- /**
1319
- * Type arguments if this is a generic instantiation.
1320
- * e.g., `Array<string>` → `{ name: "Array", typeArguments: [PrimitiveTypeNode("string")] }`
1321
- */
1322
- readonly typeArguments: readonly TypeNode[];
1323
- }
827
+ /* Excluded from this release type: ReferenceTypeNode */
1324
828
 
1325
- /**
1326
- * Remarks annotation — programmatic-persona documentation carried via
1327
- * the `x-<vendor>-remarks` JSON Schema extension keyword.
1328
- *
1329
- * Populated from `@remarks` TSDoc tag content. SDK codegen can include
1330
- * this in doc comments; API Documenter renders the source `@remarks`
1331
- * natively in a dedicated Remarks section.
1332
- *
1333
- * @public
1334
- */
1335
- export declare interface RemarksAnnotationNode {
1336
- readonly kind: "annotation";
1337
- readonly annotationKind: "remarks";
1338
- readonly value: string;
1339
- readonly provenance: Provenance;
1340
- }
829
+ /* Excluded from this release type: RemarksAnnotationNode */
1341
830
 
1342
831
  /**
1343
832
  * A field with static enum options (known at compile time).
@@ -1398,40 +887,11 @@ export declare interface TextField<N extends string> {
1398
887
  readonly pattern?: string;
1399
888
  }
1400
889
 
1401
- /**
1402
- * A named type definition stored in the type registry.
1403
- *
1404
- * @public
1405
- */
1406
- export declare interface TypeDefinition {
1407
- /** The fully-qualified reference name (key in the registry). */
1408
- readonly name: string;
1409
- /** The resolved type node. */
1410
- readonly type: TypeNode;
1411
- /** Constraints declared on the named type itself. */
1412
- readonly constraints?: readonly ConstraintNode[];
1413
- /** Root-level value metadata for a named type definition. */
1414
- readonly annotations?: readonly AnnotationNode[];
1415
- /** Where this type was declared. */
1416
- readonly provenance: Provenance;
1417
- }
890
+ /* Excluded from this release type: TypeDefinition */
1418
891
 
1419
- /**
1420
- * Discriminated union of all type representations in the IR.
1421
- *
1422
- * @public
1423
- */
1424
- export declare type TypeNode = PrimitiveTypeNode | EnumTypeNode | ArrayTypeNode | ObjectTypeNode | RecordTypeNode | UnionTypeNode | ReferenceTypeNode | DynamicTypeNode | CustomTypeNode;
892
+ /* Excluded from this release type: TypeNode */
1425
893
 
1426
- /**
1427
- * Union type for non-enum unions. Nullable types are represented as `T | null`.
1428
- *
1429
- * @public
1430
- */
1431
- export declare interface UnionTypeNode {
1432
- readonly kind: "union";
1433
- readonly members: readonly TypeNode[];
1434
- }
894
+ /* Excluded from this release type: UnionTypeNode */
1435
895
 
1436
896
  /**
1437
897
  * Represents the validity state of a field or form.
@@ -1453,7 +913,7 @@ export declare interface VocabularyKeywordRegistration {
1453
913
  /** The keyword name (without vendor prefix). */
1454
914
  readonly keyword: string;
1455
915
  /** JSON Schema that describes the valid values for this keyword. */
1456
- readonly schema: JsonValue;
916
+ readonly schema: ExtensionPayloadValue;
1457
917
  }
1458
918
 
1459
919
  export { }