@formspec/core 0.1.0-alpha.23 → 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.
@@ -32,10 +32,15 @@ export declare type AnyField = TextField<string> | NumberField<string> | Boolean
32
32
  * @beta
33
33
  */
34
34
  export declare interface ArrayCardinalityConstraintNode {
35
+ /** Discriminator identifying this node as a constraint. */
35
36
  readonly kind: "constraint";
37
+ /** Specific array-cardinality constraint represented by this node. */
36
38
  readonly constraintKind: "uniqueItems";
39
+ /** Marker value used for boolean-style array uniqueness constraints. */
37
40
  readonly value: true;
41
+ /** Nested path target, when the constraint applies below the field root. */
38
42
  readonly path?: PathTarget;
43
+ /** Source location that produced this constraint. */
39
44
  readonly provenance: Provenance;
40
45
  }
41
46
 
@@ -74,7 +79,9 @@ export declare interface ArrayField<N extends string, Items extends readonly For
74
79
  * @beta
75
80
  */
76
81
  export declare interface ArrayTypeNode {
82
+ /** Discriminator identifying this node as an array type. */
77
83
  readonly kind: "array";
84
+ /** Item type for each array entry. */
78
85
  readonly items: TypeNode;
79
86
  }
80
87
 
@@ -146,6 +153,7 @@ export declare interface Conditional<FieldName extends string, Value, Elements e
146
153
  * @beta
147
154
  */
148
155
  export declare interface ConditionalLayoutNode {
156
+ /** Discriminator identifying this node as a conditional layout. */
149
157
  readonly kind: "conditional";
150
158
  /** The field whose value triggers visibility. */
151
159
  readonly fieldName: string;
@@ -153,6 +161,7 @@ export declare interface ConditionalLayoutNode {
153
161
  readonly value: JsonValue;
154
162
  /** Elements shown when the condition is met. */
155
163
  readonly elements: readonly FormIRElement[];
164
+ /** Source location that produced this layout node. */
156
165
  readonly provenance: Provenance;
157
166
  }
158
167
 
@@ -162,10 +171,15 @@ export declare interface ConditionalLayoutNode {
162
171
  * @beta
163
172
  */
164
173
  export declare interface ConstConstraintNode {
174
+ /** Discriminator identifying this node as a constraint. */
165
175
  readonly kind: "constraint";
176
+ /** Specific literal-equality constraint represented by this node. */
166
177
  readonly constraintKind: "const";
178
+ /** JSON-serializable literal value the field must equal. */
167
179
  readonly value: JsonValue;
180
+ /** Nested path target, when the constraint applies below the field root. */
168
181
  readonly path?: PathTarget;
182
+ /** Source location that produced this constraint. */
169
183
  readonly provenance: Provenance;
170
184
  }
171
185
 
@@ -232,11 +246,15 @@ export declare function createInitialFieldState<T>(value: T): FieldState<T>;
232
246
  * @beta
233
247
  */
234
248
  export declare interface CustomAnnotationNode {
249
+ /** Discriminator identifying this node as an annotation. */
235
250
  readonly kind: "annotation";
251
+ /** Specific annotation kind represented by this node. */
236
252
  readonly annotationKind: "custom";
237
253
  /** Extension-qualified ID: `"<vendor-prefix>/<extension-name>/<annotation-name>"` */
238
254
  readonly annotationId: string;
255
+ /** JSON-serializable extension payload carried by this annotation. */
239
256
  readonly value: JsonValue;
257
+ /** Source location that produced this annotation. */
240
258
  readonly provenance: Provenance;
241
259
  }
242
260
 
@@ -264,7 +282,9 @@ export declare interface CustomAnnotationRegistration {
264
282
  * @beta
265
283
  */
266
284
  export declare interface CustomConstraintNode {
285
+ /** Discriminator identifying this node as a constraint. */
267
286
  readonly kind: "constraint";
287
+ /** Specific custom-constraint marker used for extension nodes. */
268
288
  readonly constraintKind: "custom";
269
289
  /** Extension-qualified ID: `"<vendor-prefix>/<extension-name>/<constraint-name>"` */
270
290
  readonly constraintId: string;
@@ -272,7 +292,9 @@ export declare interface CustomConstraintNode {
272
292
  readonly payload: JsonValue;
273
293
  /** How this constraint composes with others of the same `constraintId`. */
274
294
  readonly compositionRule: "intersect" | "override";
295
+ /** Nested path target, when the constraint applies below the field root. */
275
296
  readonly path?: PathTarget;
297
+ /** Source location that produced this constraint. */
276
298
  readonly provenance: Provenance;
277
299
  }
278
300
 
@@ -329,6 +351,7 @@ export declare interface CustomConstraintRegistration {
329
351
  * @beta
330
352
  */
331
353
  export declare interface CustomTypeNode {
354
+ /** Discriminator identifying this node as an extension-provided type. */
332
355
  readonly kind: "custom";
333
356
  /**
334
357
  * The extension-qualified type identifier.
@@ -428,10 +451,13 @@ export declare type DataSourceValueType<Source extends string> = Source extends
428
451
  * @beta
429
452
  */
430
453
  export declare interface DefaultValueAnnotationNode {
454
+ /** Discriminator identifying this node as an annotation. */
431
455
  readonly kind: "annotation";
456
+ /** Specific annotation kind represented by this node. */
432
457
  readonly annotationKind: "defaultValue";
433
458
  /** Must be JSON-serializable and type-compatible (verified during Validate phase). */
434
459
  readonly value: JsonValue;
460
+ /** Source location that produced this annotation. */
435
461
  readonly provenance: Provenance;
436
462
  }
437
463
 
@@ -495,10 +521,13 @@ export declare function defineExtension(def: ExtensionDefinition): ExtensionDefi
495
521
  * @beta
496
522
  */
497
523
  export declare interface DeprecatedAnnotationNode {
524
+ /** Discriminator identifying this node as an annotation. */
498
525
  readonly kind: "annotation";
526
+ /** Specific annotation kind represented by this node. */
499
527
  readonly annotationKind: "deprecated";
500
528
  /** Optional deprecation message. */
501
529
  readonly message?: string;
530
+ /** Source location that produced this annotation. */
502
531
  readonly provenance: Provenance;
503
532
  }
504
533
 
@@ -508,9 +537,13 @@ export declare interface DeprecatedAnnotationNode {
508
537
  * @beta
509
538
  */
510
539
  export declare interface DescriptionAnnotationNode {
540
+ /** Discriminator identifying this node as an annotation. */
511
541
  readonly kind: "annotation";
542
+ /** Specific annotation kind represented by this node. */
512
543
  readonly annotationKind: "description";
544
+ /** Description text surfaced in generated schemas and tooling. */
513
545
  readonly value: string;
546
+ /** Source location that produced this annotation. */
514
547
  readonly provenance: Provenance;
515
548
  }
516
549
 
@@ -520,9 +553,13 @@ export declare interface DescriptionAnnotationNode {
520
553
  * @beta
521
554
  */
522
555
  export declare interface DisplayNameAnnotationNode {
556
+ /** Discriminator identifying this node as an annotation. */
523
557
  readonly kind: "annotation";
558
+ /** Specific annotation kind represented by this node. */
524
559
  readonly annotationKind: "displayName";
560
+ /** Human-readable display label for the field or type. */
525
561
  readonly value: string;
562
+ /** Source location that produced this annotation. */
526
563
  readonly provenance: Provenance;
527
564
  }
528
565
 
@@ -581,7 +618,9 @@ export declare interface DynamicSchemaField<N extends string> {
581
618
  * @beta
582
619
  */
583
620
  export declare interface DynamicTypeNode {
621
+ /** Discriminator identifying this node as a runtime-resolved type. */
584
622
  readonly kind: "dynamic";
623
+ /** Dynamic schema family resolved for this field. */
585
624
  readonly dynamicKind: "enum" | "schema";
586
625
  /** Key identifying the runtime data source or schema provider. */
587
626
  readonly sourceKey: string;
@@ -610,10 +649,15 @@ export declare interface EnumMember {
610
649
  * @beta
611
650
  */
612
651
  export declare interface EnumMemberConstraintNode {
652
+ /** Discriminator identifying this node as a constraint. */
613
653
  readonly kind: "constraint";
654
+ /** Specific enum-membership constraint represented by this node. */
614
655
  readonly constraintKind: "allowedMembers";
656
+ /** Subset of enum member values that remain valid. */
615
657
  readonly members: readonly (string | number)[];
658
+ /** Nested path target, when the constraint applies below the field root. */
616
659
  readonly path?: PathTarget;
660
+ /** Source location that produced this constraint. */
617
661
  readonly provenance: Provenance;
618
662
  }
619
663
 
@@ -625,7 +669,9 @@ export declare interface EnumMemberConstraintNode {
625
669
  * @public
626
670
  */
627
671
  export declare interface EnumOption {
672
+ /** Stored enum value written into submitted data. */
628
673
  readonly id: string;
674
+ /** Human-readable label shown to end users. */
629
675
  readonly label: string;
630
676
  }
631
677
 
@@ -642,7 +688,9 @@ export declare type EnumOptionValue = string | EnumOption;
642
688
  * @beta
643
689
  */
644
690
  export declare interface EnumTypeNode {
691
+ /** Discriminator identifying this node as an enum type. */
645
692
  readonly kind: "enum";
693
+ /** Allowed enum members in declaration order. */
646
694
  readonly members: readonly EnumMember[];
647
695
  }
648
696
 
@@ -762,6 +810,7 @@ export declare interface FetchOptionsResponse<T = unknown> {
762
810
  * @beta
763
811
  */
764
812
  export declare interface FieldNode {
813
+ /** Discriminator identifying this node as a field. */
765
814
  readonly kind: "field";
766
815
  /** The field's key in the data schema. */
767
816
  readonly name: string;
@@ -811,9 +860,13 @@ export declare interface FieldState<T> {
811
860
  * @beta
812
861
  */
813
862
  export declare interface FormatAnnotationNode {
863
+ /** Discriminator identifying this node as an annotation. */
814
864
  readonly kind: "annotation";
865
+ /** Specific annotation kind represented by this node. */
815
866
  readonly annotationKind: "format";
867
+ /** Schema format keyword value to emit downstream. */
816
868
  readonly value: string;
869
+ /** Source location that produced this annotation. */
817
870
  readonly provenance: Provenance;
818
871
  }
819
872
 
@@ -824,10 +877,13 @@ export declare interface FormatAnnotationNode {
824
877
  * @beta
825
878
  */
826
879
  export declare interface FormatHintAnnotationNode {
880
+ /** Discriminator identifying this node as an annotation. */
827
881
  readonly kind: "annotation";
882
+ /** Specific annotation kind represented by this node. */
828
883
  readonly annotationKind: "formatHint";
829
884
  /** Renderer-specific format identifier: "textarea", "radio", "date", "color", etc. */
830
885
  readonly format: string;
886
+ /** Source location that produced this annotation. */
831
887
  readonly provenance: Provenance;
832
888
  }
833
889
 
@@ -849,6 +905,7 @@ export declare type FormElement = AnyField | Group<readonly FormElement[]> | Con
849
905
  * @beta
850
906
  */
851
907
  export declare interface FormIR {
908
+ /** Discriminator identifying this document as a top-level FormIR payload. */
852
909
  readonly kind: "form-ir";
853
910
  /**
854
911
  * Schema version for the IR format itself.
@@ -933,10 +990,13 @@ export declare interface Group<Elements extends readonly FormElement[]> {
933
990
  * @beta
934
991
  */
935
992
  export declare interface GroupLayoutNode {
993
+ /** Discriminator identifying this node as a group layout. */
936
994
  readonly kind: "group";
995
+ /** Display label associated with the visual group. */
937
996
  readonly label: string;
938
997
  /** Elements contained in this group — may be fields or nested groups. */
939
998
  readonly elements: readonly FormIRElement[];
999
+ /** Source location that produced this layout node. */
940
1000
  readonly provenance: Provenance;
941
1001
  }
942
1002
 
@@ -1054,10 +1114,15 @@ export declare type LayoutNode = GroupLayoutNode | ConditionalLayoutNode;
1054
1114
  * @beta
1055
1115
  */
1056
1116
  export declare interface LengthConstraintNode {
1117
+ /** Discriminator identifying this node as a constraint. */
1057
1118
  readonly kind: "constraint";
1119
+ /** Specific length or cardinality constraint represented by this node. */
1058
1120
  readonly constraintKind: "minLength" | "maxLength" | "minItems" | "maxItems";
1121
+ /** Inclusive bound value carried by the constraint. */
1059
1122
  readonly value: number;
1123
+ /** Nested path target, when the constraint applies below the field root. */
1060
1124
  readonly path?: PathTarget;
1125
+ /** Source location that produced this constraint. */
1061
1126
  readonly provenance: Provenance;
1062
1127
  }
1063
1128
 
@@ -1100,11 +1165,15 @@ export declare interface NumberField<N extends string> {
1100
1165
  * @beta
1101
1166
  */
1102
1167
  export declare interface NumericConstraintNode {
1168
+ /** Discriminator identifying this node as a constraint. */
1103
1169
  readonly kind: "constraint";
1170
+ /** Specific numeric constraint represented by this node. */
1104
1171
  readonly constraintKind: "minimum" | "maximum" | "exclusiveMinimum" | "exclusiveMaximum" | "multipleOf";
1172
+ /** Numeric value carried by the constraint. */
1105
1173
  readonly value: number;
1106
1174
  /** If present, targets a nested sub-field rather than the field itself. */
1107
1175
  readonly path?: PathTarget;
1176
+ /** Source location that produced this constraint. */
1108
1177
  readonly provenance: Provenance;
1109
1178
  }
1110
1179
 
@@ -1139,8 +1208,11 @@ export declare interface ObjectField<N extends string, Properties extends readon
1139
1208
  * @beta
1140
1209
  */
1141
1210
  export declare interface ObjectProperty {
1211
+ /** Property name as it appears in the containing object type. */
1142
1212
  readonly name: string;
1213
+ /** Canonical IR type for this property. */
1143
1214
  readonly type: TypeNode;
1215
+ /** Whether the property may be omitted from object values. */
1144
1216
  readonly optional: boolean;
1145
1217
  /**
1146
1218
  * Use-site constraints on this property.
@@ -1151,6 +1223,7 @@ export declare interface ObjectProperty {
1151
1223
  readonly constraints: readonly ConstraintNode[];
1152
1224
  /** Use-site annotations on this property. */
1153
1225
  readonly annotations: readonly AnnotationNode[];
1226
+ /** Source location that produced this property entry. */
1154
1227
  readonly provenance: Provenance;
1155
1228
  }
1156
1229
 
@@ -1160,6 +1233,7 @@ export declare interface ObjectProperty {
1160
1233
  * @beta
1161
1234
  */
1162
1235
  export declare interface ObjectTypeNode {
1236
+ /** Discriminator identifying this node as an object type. */
1163
1237
  readonly kind: "object";
1164
1238
  /**
1165
1239
  * Named properties of this object. Order is preserved from the source
@@ -1200,11 +1274,15 @@ export declare interface PathTarget {
1200
1274
  * @beta
1201
1275
  */
1202
1276
  export declare interface PatternConstraintNode {
1277
+ /** Discriminator identifying this node as a constraint. */
1203
1278
  readonly kind: "constraint";
1279
+ /** Specific pattern constraint represented by this node. */
1204
1280
  readonly constraintKind: "pattern";
1205
1281
  /** ECMA-262 regular expression, without delimiters. */
1206
1282
  readonly pattern: string;
1283
+ /** Nested path target, when the constraint applies below the field root. */
1207
1284
  readonly path?: PathTarget;
1285
+ /** Source location that produced this constraint. */
1208
1286
  readonly provenance: Provenance;
1209
1287
  }
1210
1288
 
@@ -1214,9 +1292,13 @@ export declare interface PatternConstraintNode {
1214
1292
  * @beta
1215
1293
  */
1216
1294
  export declare interface PlaceholderAnnotationNode {
1295
+ /** Discriminator identifying this node as an annotation. */
1217
1296
  readonly kind: "annotation";
1297
+ /** Specific annotation kind represented by this node. */
1218
1298
  readonly annotationKind: "placeholder";
1299
+ /** Placeholder text intended for UI renderers. */
1219
1300
  readonly value: string;
1301
+ /** Source location that produced this annotation. */
1220
1302
  readonly provenance: Provenance;
1221
1303
  }
1222
1304
 
@@ -1241,7 +1323,9 @@ export declare type Predicate<K extends string = string, V = unknown> = EqualsPr
1241
1323
  * @beta
1242
1324
  */
1243
1325
  export declare interface PrimitiveTypeNode {
1326
+ /** Discriminator identifying this node as a primitive type. */
1244
1327
  readonly kind: "primitive";
1328
+ /** Primitive value family represented by this node. */
1245
1329
  readonly primitiveKind: "string" | "number" | "integer" | "bigint" | "boolean" | "null";
1246
1330
  }
1247
1331
 
@@ -1279,6 +1363,7 @@ export declare interface Provenance {
1279
1363
  * @beta
1280
1364
  */
1281
1365
  export declare interface RecordTypeNode {
1366
+ /** Discriminator identifying this node as a record type. */
1282
1367
  readonly kind: "record";
1283
1368
  /** The type of each value in the dictionary. */
1284
1369
  readonly valueType: TypeNode;
@@ -1290,6 +1375,7 @@ export declare interface RecordTypeNode {
1290
1375
  * @beta
1291
1376
  */
1292
1377
  export declare interface ReferenceTypeNode {
1378
+ /** Discriminator identifying this node as a named reference type. */
1293
1379
  readonly kind: "reference";
1294
1380
  /**
1295
1381
  * The fully-qualified name of the referenced type.
@@ -1315,9 +1401,13 @@ export declare interface ReferenceTypeNode {
1315
1401
  * @beta
1316
1402
  */
1317
1403
  export declare interface RemarksAnnotationNode {
1404
+ /** Discriminator identifying this node as an annotation. */
1318
1405
  readonly kind: "annotation";
1406
+ /** Specific annotation kind represented by this node. */
1319
1407
  readonly annotationKind: "remarks";
1408
+ /** Long-form remarks content carried through canonicalization. */
1320
1409
  readonly value: string;
1410
+ /** Source location that produced this annotation. */
1321
1411
  readonly provenance: Provenance;
1322
1412
  }
1323
1413
 
@@ -1411,7 +1501,9 @@ export declare type TypeNode = PrimitiveTypeNode | EnumTypeNode | ArrayTypeNode
1411
1501
  * @beta
1412
1502
  */
1413
1503
  export declare interface UnionTypeNode {
1504
+ /** Discriminator identifying this node as a union type. */
1414
1505
  readonly kind: "union";
1506
+ /** Member types that participate in the union. */
1415
1507
  readonly members: readonly TypeNode[];
1416
1508
  }
1417
1509