@prismicio/types-internal 3.8.0 → 3.9.0-alpha.0

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.
@@ -140,7 +140,29 @@ export declare function widgetReader<T extends StaticSlices | DynamicSlices>(cod
140
140
  useAsTitle: t.BooleanC;
141
141
  placeholder: t.StringC;
142
142
  select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
143
- customtypes: t.ReadonlyArrayC<t.StringC>;
143
+ customtypes: t.Type<readonly (string | ({
144
+ id: string;
145
+ } & {
146
+ fields?: readonly (string | {
147
+ id: string;
148
+ customtypes: readonly (string | ({
149
+ id: string;
150
+ } & {
151
+ fields?: readonly string[];
152
+ }))[];
153
+ })[];
154
+ }))[], readonly (string | ({
155
+ id: string;
156
+ } & {
157
+ fields?: readonly (string | {
158
+ id: string;
159
+ customtypes: readonly (string | ({
160
+ id: string;
161
+ } & {
162
+ fields?: readonly string[];
163
+ }))[];
164
+ })[];
165
+ }))[], unknown>;
144
166
  masks: t.Type<readonly string[], object, unknown>;
145
167
  tags: t.Type<readonly string[], object, unknown>;
146
168
  allowTargetBlank: t.BooleanC;
@@ -314,7 +336,29 @@ export declare function widgetReader<T extends StaticSlices | DynamicSlices>(cod
314
336
  useAsTitle: t.BooleanC;
315
337
  placeholder: t.StringC;
316
338
  select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
317
- customtypes: t.ReadonlyArrayC<t.StringC>;
339
+ customtypes: t.Type<readonly (string | ({
340
+ id: string;
341
+ } & {
342
+ fields?: readonly (string | {
343
+ id: string;
344
+ customtypes: readonly (string | ({
345
+ id: string;
346
+ } & {
347
+ fields?: readonly string[];
348
+ }))[];
349
+ })[];
350
+ }))[], readonly (string | ({
351
+ id: string;
352
+ } & {
353
+ fields?: readonly (string | {
354
+ id: string;
355
+ customtypes: readonly (string | ({
356
+ id: string;
357
+ } & {
358
+ fields?: readonly string[];
359
+ }))[];
360
+ })[];
361
+ }))[], unknown>;
318
362
  masks: t.Type<readonly string[], object, unknown>;
319
363
  tags: t.Type<readonly string[], object, unknown>;
320
364
  allowTargetBlank: t.BooleanC;
@@ -488,7 +532,29 @@ export declare function widgetReader<T extends StaticSlices | DynamicSlices>(cod
488
532
  useAsTitle: t.BooleanC;
489
533
  placeholder: t.StringC;
490
534
  select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
491
- customtypes: t.ReadonlyArrayC<t.StringC>;
535
+ customtypes: t.Type<readonly (string | ({
536
+ id: string;
537
+ } & {
538
+ fields?: readonly (string | {
539
+ id: string;
540
+ customtypes: readonly (string | ({
541
+ id: string;
542
+ } & {
543
+ fields?: readonly string[];
544
+ }))[];
545
+ })[];
546
+ }))[], readonly (string | ({
547
+ id: string;
548
+ } & {
549
+ fields?: readonly (string | {
550
+ id: string;
551
+ customtypes: readonly (string | ({
552
+ id: string;
553
+ } & {
554
+ fields?: readonly string[];
555
+ }))[];
556
+ })[];
557
+ }))[], unknown>;
492
558
  masks: t.Type<readonly string[], object, unknown>;
493
559
  tags: t.Type<readonly string[], object, unknown>;
494
560
  allowTargetBlank: t.BooleanC;
@@ -667,7 +733,29 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
667
733
  useAsTitle: t.BooleanC;
668
734
  placeholder: t.StringC;
669
735
  select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
670
- customtypes: t.ReadonlyArrayC<t.StringC>;
736
+ customtypes: t.Type<readonly (string | ({
737
+ id: string;
738
+ } & {
739
+ fields?: readonly (string | {
740
+ id: string;
741
+ customtypes: readonly (string | ({
742
+ id: string;
743
+ } & {
744
+ fields?: readonly string[];
745
+ }))[];
746
+ })[];
747
+ }))[], readonly (string | ({
748
+ id: string;
749
+ } & {
750
+ fields?: readonly (string | {
751
+ id: string;
752
+ customtypes: readonly (string | ({
753
+ id: string;
754
+ } & {
755
+ fields?: readonly string[];
756
+ }))[];
757
+ })[];
758
+ }))[], unknown>;
671
759
  masks: t.Type<readonly string[], object, unknown>;
672
760
  tags: t.Type<readonly string[], object, unknown>;
673
761
  allowTargetBlank: t.BooleanC;
@@ -841,7 +929,29 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
841
929
  useAsTitle: t.BooleanC;
842
930
  placeholder: t.StringC;
843
931
  select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
844
- customtypes: t.ReadonlyArrayC<t.StringC>;
932
+ customtypes: t.Type<readonly (string | ({
933
+ id: string;
934
+ } & {
935
+ fields?: readonly (string | {
936
+ id: string;
937
+ customtypes: readonly (string | ({
938
+ id: string;
939
+ } & {
940
+ fields?: readonly string[];
941
+ }))[];
942
+ })[];
943
+ }))[], readonly (string | ({
944
+ id: string;
945
+ } & {
946
+ fields?: readonly (string | {
947
+ id: string;
948
+ customtypes: readonly (string | ({
949
+ id: string;
950
+ } & {
951
+ fields?: readonly string[];
952
+ }))[];
953
+ })[];
954
+ }))[], unknown>;
845
955
  masks: t.Type<readonly string[], object, unknown>;
846
956
  tags: t.Type<readonly string[], object, unknown>;
847
957
  allowTargetBlank: t.BooleanC;
@@ -1015,7 +1125,29 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
1015
1125
  useAsTitle: t.BooleanC;
1016
1126
  placeholder: t.StringC;
1017
1127
  select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
1018
- customtypes: t.ReadonlyArrayC<t.StringC>;
1128
+ customtypes: t.Type<readonly (string | ({
1129
+ id: string;
1130
+ } & {
1131
+ fields?: readonly (string | {
1132
+ id: string;
1133
+ customtypes: readonly (string | ({
1134
+ id: string;
1135
+ } & {
1136
+ fields?: readonly string[];
1137
+ }))[];
1138
+ })[];
1139
+ }))[], readonly (string | ({
1140
+ id: string;
1141
+ } & {
1142
+ fields?: readonly (string | {
1143
+ id: string;
1144
+ customtypes: readonly (string | ({
1145
+ id: string;
1146
+ } & {
1147
+ fields?: readonly string[];
1148
+ }))[];
1149
+ })[];
1150
+ }))[], unknown>;
1019
1151
  masks: t.Type<readonly string[], object, unknown>;
1020
1152
  tags: t.Type<readonly string[], object, unknown>;
1021
1153
  allowTargetBlank: t.BooleanC;
@@ -1146,7 +1278,18 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
1146
1278
  useAsTitle?: boolean;
1147
1279
  placeholder?: string;
1148
1280
  select?: "media" | "document" | "web" | null;
1149
- customtypes?: readonly string[];
1281
+ customtypes?: readonly (string | ({
1282
+ id: string;
1283
+ } & {
1284
+ fields?: readonly (string | {
1285
+ id: string;
1286
+ customtypes: readonly (string | ({
1287
+ id: string;
1288
+ } & {
1289
+ fields?: readonly string[];
1290
+ }))[];
1291
+ })[];
1292
+ }))[];
1150
1293
  masks?: readonly string[];
1151
1294
  tags?: readonly string[];
1152
1295
  allowTargetBlank?: boolean;
@@ -1321,7 +1464,18 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
1321
1464
  useAsTitle?: boolean;
1322
1465
  placeholder?: string;
1323
1466
  select?: "media" | "document" | "web" | null;
1324
- customtypes?: readonly string[];
1467
+ customtypes?: readonly (string | ({
1468
+ id: string;
1469
+ } & {
1470
+ fields?: readonly (string | {
1471
+ id: string;
1472
+ customtypes: readonly (string | ({
1473
+ id: string;
1474
+ } & {
1475
+ fields?: readonly string[];
1476
+ }))[];
1477
+ })[];
1478
+ }))[];
1325
1479
  masks?: readonly string[];
1326
1480
  tags?: readonly string[];
1327
1481
  allowTargetBlank?: boolean;
@@ -1497,7 +1651,18 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
1497
1651
  useAsTitle?: boolean;
1498
1652
  placeholder?: string;
1499
1653
  select?: "media" | "document" | "web" | null;
1500
- customtypes?: readonly string[];
1654
+ customtypes?: readonly (string | ({
1655
+ id: string;
1656
+ } & {
1657
+ fields?: readonly (string | {
1658
+ id: string;
1659
+ customtypes: readonly (string | ({
1660
+ id: string;
1661
+ } & {
1662
+ fields?: readonly string[];
1663
+ }))[];
1664
+ })[];
1665
+ }))[];
1501
1666
  masks?: readonly string[];
1502
1667
  tags?: readonly string[];
1503
1668
  allowTargetBlank?: boolean;
@@ -1665,7 +1830,18 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
1665
1830
  useAsTitle?: boolean;
1666
1831
  placeholder?: string;
1667
1832
  select?: "media" | "document" | "web" | null;
1668
- customtypes?: readonly string[];
1833
+ customtypes?: readonly (string | ({
1834
+ id: string;
1835
+ } & {
1836
+ fields?: readonly (string | {
1837
+ id: string;
1838
+ customtypes: readonly (string | ({
1839
+ id: string;
1840
+ } & {
1841
+ fields?: readonly string[];
1842
+ }))[];
1843
+ })[];
1844
+ }))[];
1669
1845
  masks?: readonly string[];
1670
1846
  tags?: readonly string[];
1671
1847
  allowTargetBlank?: boolean;
@@ -1849,7 +2025,18 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
1849
2025
  useAsTitle?: boolean;
1850
2026
  placeholder?: string;
1851
2027
  select?: "media" | "document" | "web" | null;
1852
- customtypes?: readonly string[];
2028
+ customtypes?: readonly (string | ({
2029
+ id: string;
2030
+ } & {
2031
+ fields?: readonly (string | {
2032
+ id: string;
2033
+ customtypes: readonly (string | ({
2034
+ id: string;
2035
+ } & {
2036
+ fields?: readonly string[];
2037
+ }))[];
2038
+ })[];
2039
+ }))[];
1853
2040
  masks?: readonly string[];
1854
2041
  tags?: readonly string[];
1855
2042
  allowTargetBlank?: boolean;
@@ -2024,7 +2211,18 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
2024
2211
  useAsTitle?: boolean;
2025
2212
  placeholder?: string;
2026
2213
  select?: "media" | "document" | "web" | null;
2027
- customtypes?: readonly string[];
2214
+ customtypes?: readonly (string | ({
2215
+ id: string;
2216
+ } & {
2217
+ fields?: readonly (string | {
2218
+ id: string;
2219
+ customtypes: readonly (string | ({
2220
+ id: string;
2221
+ } & {
2222
+ fields?: readonly string[];
2223
+ }))[];
2224
+ })[];
2225
+ }))[];
2028
2226
  masks?: readonly string[];
2029
2227
  tags?: readonly string[];
2030
2228
  allowTargetBlank?: boolean;
@@ -2199,7 +2397,18 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
2199
2397
  useAsTitle?: boolean;
2200
2398
  placeholder?: string;
2201
2399
  select?: "media" | "document" | "web" | null;
2202
- customtypes?: readonly string[];
2400
+ customtypes?: readonly (string | ({
2401
+ id: string;
2402
+ } & {
2403
+ fields?: readonly (string | {
2404
+ id: string;
2405
+ customtypes: readonly (string | ({
2406
+ id: string;
2407
+ } & {
2408
+ fields?: readonly string[];
2409
+ }))[];
2410
+ })[];
2411
+ }))[];
2203
2412
  masks?: readonly string[];
2204
2413
  tags?: readonly string[];
2205
2414
  allowTargetBlank?: boolean;
@@ -2373,7 +2582,18 @@ export declare const StaticWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
2373
2582
  useAsTitle?: boolean;
2374
2583
  placeholder?: string;
2375
2584
  select?: "media" | "document" | "web" | null;
2376
- customtypes?: readonly string[];
2585
+ customtypes?: readonly (string | ({
2586
+ id: string;
2587
+ } & {
2588
+ fields?: readonly (string | {
2589
+ id: string;
2590
+ customtypes: readonly (string | ({
2591
+ id: string;
2592
+ } & {
2593
+ fields?: readonly string[];
2594
+ }))[];
2595
+ })[];
2596
+ }))[];
2377
2597
  masks?: readonly string[];
2378
2598
  tags?: readonly string[];
2379
2599
  allowTargetBlank?: boolean;
@@ -2612,7 +2832,29 @@ export declare const DynamicWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<
2612
2832
  useAsTitle: t.BooleanC;
2613
2833
  placeholder: t.StringC;
2614
2834
  select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
2615
- customtypes: t.ReadonlyArrayC<t.StringC>;
2835
+ customtypes: t.Type<readonly (string | ({
2836
+ id: string;
2837
+ } & {
2838
+ fields?: readonly (string | {
2839
+ id: string;
2840
+ customtypes: readonly (string | ({
2841
+ id: string;
2842
+ } & {
2843
+ fields?: readonly string[];
2844
+ }))[];
2845
+ })[];
2846
+ }))[], readonly (string | ({
2847
+ id: string;
2848
+ } & {
2849
+ fields?: readonly (string | {
2850
+ id: string;
2851
+ customtypes: readonly (string | ({
2852
+ id: string;
2853
+ } & {
2854
+ fields?: readonly string[];
2855
+ }))[];
2856
+ })[];
2857
+ }))[], unknown>;
2616
2858
  masks: t.Type<readonly string[], object, unknown>;
2617
2859
  tags: t.Type<readonly string[], object, unknown>;
2618
2860
  allowTargetBlank: t.BooleanC;
@@ -2786,7 +3028,29 @@ export declare const DynamicWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<
2786
3028
  useAsTitle: t.BooleanC;
2787
3029
  placeholder: t.StringC;
2788
3030
  select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
2789
- customtypes: t.ReadonlyArrayC<t.StringC>;
3031
+ customtypes: t.Type<readonly (string | ({
3032
+ id: string;
3033
+ } & {
3034
+ fields?: readonly (string | {
3035
+ id: string;
3036
+ customtypes: readonly (string | ({
3037
+ id: string;
3038
+ } & {
3039
+ fields?: readonly string[];
3040
+ }))[];
3041
+ })[];
3042
+ }))[], readonly (string | ({
3043
+ id: string;
3044
+ } & {
3045
+ fields?: readonly (string | {
3046
+ id: string;
3047
+ customtypes: readonly (string | ({
3048
+ id: string;
3049
+ } & {
3050
+ fields?: readonly string[];
3051
+ }))[];
3052
+ })[];
3053
+ }))[], unknown>;
2790
3054
  masks: t.Type<readonly string[], object, unknown>;
2791
3055
  tags: t.Type<readonly string[], object, unknown>;
2792
3056
  allowTargetBlank: t.BooleanC;
@@ -2960,7 +3224,29 @@ export declare const DynamicWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<
2960
3224
  useAsTitle: t.BooleanC;
2961
3225
  placeholder: t.StringC;
2962
3226
  select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
2963
- customtypes: t.ReadonlyArrayC<t.StringC>;
3227
+ customtypes: t.Type<readonly (string | ({
3228
+ id: string;
3229
+ } & {
3230
+ fields?: readonly (string | {
3231
+ id: string;
3232
+ customtypes: readonly (string | ({
3233
+ id: string;
3234
+ } & {
3235
+ fields?: readonly string[];
3236
+ }))[];
3237
+ })[];
3238
+ }))[], readonly (string | ({
3239
+ id: string;
3240
+ } & {
3241
+ fields?: readonly (string | {
3242
+ id: string;
3243
+ customtypes: readonly (string | ({
3244
+ id: string;
3245
+ } & {
3246
+ fields?: readonly string[];
3247
+ }))[];
3248
+ })[];
3249
+ }))[], unknown>;
2964
3250
  masks: t.Type<readonly string[], object, unknown>;
2965
3251
  tags: t.Type<readonly string[], object, unknown>;
2966
3252
  allowTargetBlank: t.BooleanC;
@@ -3091,7 +3377,18 @@ export declare const DynamicWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<
3091
3377
  useAsTitle?: boolean;
3092
3378
  placeholder?: string;
3093
3379
  select?: "media" | "document" | "web" | null;
3094
- customtypes?: readonly string[];
3380
+ customtypes?: readonly (string | ({
3381
+ id: string;
3382
+ } & {
3383
+ fields?: readonly (string | {
3384
+ id: string;
3385
+ customtypes: readonly (string | ({
3386
+ id: string;
3387
+ } & {
3388
+ fields?: readonly string[];
3389
+ }))[];
3390
+ })[];
3391
+ }))[];
3095
3392
  masks?: readonly string[];
3096
3393
  tags?: readonly string[];
3097
3394
  allowTargetBlank?: boolean;
@@ -3266,7 +3563,18 @@ export declare const DynamicWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<
3266
3563
  useAsTitle?: boolean;
3267
3564
  placeholder?: string;
3268
3565
  select?: "media" | "document" | "web" | null;
3269
- customtypes?: readonly string[];
3566
+ customtypes?: readonly (string | ({
3567
+ id: string;
3568
+ } & {
3569
+ fields?: readonly (string | {
3570
+ id: string;
3571
+ customtypes: readonly (string | ({
3572
+ id: string;
3573
+ } & {
3574
+ fields?: readonly string[];
3575
+ }))[];
3576
+ })[];
3577
+ }))[];
3270
3578
  masks?: readonly string[];
3271
3579
  tags?: readonly string[];
3272
3580
  allowTargetBlank?: boolean;
@@ -3442,7 +3750,18 @@ export declare const DynamicWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<
3442
3750
  useAsTitle?: boolean;
3443
3751
  placeholder?: string;
3444
3752
  select?: "media" | "document" | "web" | null;
3445
- customtypes?: readonly string[];
3753
+ customtypes?: readonly (string | ({
3754
+ id: string;
3755
+ } & {
3756
+ fields?: readonly (string | {
3757
+ id: string;
3758
+ customtypes: readonly (string | ({
3759
+ id: string;
3760
+ } & {
3761
+ fields?: readonly string[];
3762
+ }))[];
3763
+ })[];
3764
+ }))[];
3446
3765
  masks?: readonly string[];
3447
3766
  tags?: readonly string[];
3448
3767
  allowTargetBlank?: boolean;
@@ -3610,7 +3929,18 @@ export declare const DynamicWidget: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<
3610
3929
  useAsTitle?: boolean;
3611
3930
  placeholder?: string;
3612
3931
  select?: "media" | "document" | "web" | null;
3613
- customtypes?: readonly string[];
3932
+ customtypes?: readonly (string | ({
3933
+ id: string;
3934
+ } & {
3935
+ fields?: readonly (string | {
3936
+ id: string;
3937
+ customtypes: readonly (string | ({
3938
+ id: string;
3939
+ } & {
3940
+ fields?: readonly string[];
3941
+ }))[];
3942
+ })[];
3943
+ }))[];
3614
3944
  masks?: readonly string[];
3615
3945
  tags?: readonly string[];
3616
3946
  allowTargetBlank?: boolean;
@@ -5,7 +5,29 @@ export declare const LinkConfig: t.ExactC<t.PartialC<{
5
5
  useAsTitle: t.BooleanC;
6
6
  placeholder: t.StringC;
7
7
  select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
8
- customtypes: t.ReadonlyArrayC<t.StringC>;
8
+ customtypes: t.Type<readonly (string | ({
9
+ id: string;
10
+ } & {
11
+ fields?: readonly (string | {
12
+ id: string;
13
+ customtypes: readonly (string | ({
14
+ id: string;
15
+ } & {
16
+ fields?: readonly string[];
17
+ }))[];
18
+ })[];
19
+ }))[], readonly (string | ({
20
+ id: string;
21
+ } & {
22
+ fields?: readonly (string | {
23
+ id: string;
24
+ customtypes: readonly (string | ({
25
+ id: string;
26
+ } & {
27
+ fields?: readonly string[];
28
+ }))[];
29
+ })[];
30
+ }))[], unknown>;
9
31
  masks: t.Type<readonly string[], object, unknown>;
10
32
  tags: t.Type<readonly string[], object, unknown>;
11
33
  allowTargetBlank: t.BooleanC;
@@ -31,7 +53,29 @@ export declare const Link: t.ExactC<t.IntersectionC<[t.TypeC<{
31
53
  useAsTitle: t.BooleanC;
32
54
  placeholder: t.StringC;
33
55
  select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
34
- customtypes: t.ReadonlyArrayC<t.StringC>;
56
+ customtypes: t.Type<readonly (string | ({
57
+ id: string;
58
+ } & {
59
+ fields?: readonly (string | {
60
+ id: string;
61
+ customtypes: readonly (string | ({
62
+ id: string;
63
+ } & {
64
+ fields?: readonly string[];
65
+ }))[];
66
+ })[];
67
+ }))[], readonly (string | ({
68
+ id: string;
69
+ } & {
70
+ fields?: readonly (string | {
71
+ id: string;
72
+ customtypes: readonly (string | ({
73
+ id: string;
74
+ } & {
75
+ fields?: readonly string[];
76
+ }))[];
77
+ })[];
78
+ }))[], unknown>;
35
79
  masks: t.Type<readonly string[], object, unknown>;
36
80
  tags: t.Type<readonly string[], object, unknown>;
37
81
  allowTargetBlank: t.BooleanC;
@@ -27,6 +27,78 @@ const MasksArrayString = new t.Type("MasksArrayString", (u) => {
27
27
  return arrayString(masks) || plainString(masks) || t.failure(u, context);
28
28
  });
29
29
  }, (res) => res);
30
+ const CustomTypeLevel2Fields = new t.Type("CustomTypeLevel2Fields", (u) => Array.isArray(u) && u.every((item) => typeof item === "string"), (u, context) => Either_1.either.chain(t.array(t.string).validate(u, context), (fields) => {
31
+ // duplicates not allowed
32
+ const filtered = new Set(fields);
33
+ return filtered.size === fields.length
34
+ ? t.success(fields)
35
+ : t.failure(u, context, "Fields have duplicates.");
36
+ }), (a) => a);
37
+ const CustomTypeLevel2 = t.union([
38
+ t.string,
39
+ t.exact(t.intersection([
40
+ t.type({
41
+ id: t.string,
42
+ }),
43
+ t.partial({
44
+ fields: CustomTypeLevel2Fields,
45
+ }),
46
+ ])),
47
+ ]);
48
+ const CustomTypesLevel2 = new t.Type("CustomTypesLevel2", (u) => Array.isArray(u) && u.every((item) => CustomTypeLevel2.is(item)), (u, context) => Either_1.either.chain(t.array(CustomTypeLevel2).validate(u, context), (cts) => {
49
+ // duplicates not allowed
50
+ const filtered = new Set(cts.map((ct) => (typeof ct === "string" ? ct : ct.id)));
51
+ return filtered.size === cts.length
52
+ ? t.success(cts)
53
+ : t.failure(u, context, "Custom types have duplicates.");
54
+ }), (a) => a);
55
+ const CustomTypeLevel1Field = t.union([
56
+ t.string,
57
+ t.strict({
58
+ id: t.string,
59
+ customtypes: CustomTypesLevel2,
60
+ }),
61
+ ]);
62
+ const CustomTypeLevel1Fields = new t.Type("CustomTypeLevel1Fields", (u) => Array.isArray(u) && u.every((item) => CustomTypeLevel1Field.is(item)), (u, context) => Either_1.either.chain(t.array(CustomTypeLevel1Field).validate(u, context), (fields) => {
63
+ // duplicates not allowed
64
+ const filtered = new Set(fields.map((field) => (typeof field === "string" ? field : field.id)));
65
+ return filtered.size === fields.length
66
+ ? t.success(fields)
67
+ : t.failure(u, context, "Fields have duplicates.");
68
+ }), (a) => a);
69
+ const CustomTypeLevel1 = t.union([
70
+ t.string,
71
+ t.exact(t.intersection([
72
+ t.type({
73
+ id: t.string,
74
+ }),
75
+ t.partial({
76
+ fields: CustomTypeLevel1Fields,
77
+ }),
78
+ ])),
79
+ ]);
80
+ const CustomTypes = new t.Type("CustomTypes", (u) => Array.isArray(u) && u.every((item) => CustomTypeLevel1.is(item)), (u, context) => Either_1.either.chain(t.array(CustomTypeLevel1).validate(u, context), (cts) => {
81
+ // if a ct appears more than once as a string, we allow it (legacy)
82
+ // if a ct appears once as a string and then again via object (or vice versa), we don't allow it
83
+ // if a ct appears more than once as an object, we don't allow it
84
+ const strings = new Set();
85
+ const objects = new Set();
86
+ for (const ct of cts) {
87
+ let failed = false;
88
+ if (typeof ct === "string") {
89
+ failed = objects.has(ct);
90
+ strings.add(ct);
91
+ }
92
+ else {
93
+ const { id } = ct;
94
+ failed = strings.has(id) || objects.has(id);
95
+ objects.add(id);
96
+ }
97
+ if (failed)
98
+ return t.failure(u, context, "Custom types have duplicates.");
99
+ }
100
+ return t.success(cts);
101
+ }), (a) => a);
30
102
  exports.LinkFieldType = "Link";
31
103
  exports.LinkConfig = t.exact(t.partial({
32
104
  label: validators_1.StringOrNull,
@@ -38,7 +110,7 @@ exports.LinkConfig = t.exact(t.partial({
38
110
  t.literal("web"),
39
111
  t.null,
40
112
  ]), null),
41
- customtypes: t.readonlyArray(t.string),
113
+ customtypes: CustomTypes,
42
114
  masks: MasksArrayString,
43
115
  tags: MasksArrayString,
44
116
  allowTargetBlank: t.boolean,