@prismicio/types-internal 2.5.0-alpha.0 → 2.5.0-alpha.2

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.
Files changed (50) hide show
  1. package/lib/content/Document.d.ts +3972 -7926
  2. package/lib/content/fields/GroupContent.d.ts +17 -1754
  3. package/lib/content/fields/GroupContent.js +62 -22
  4. package/lib/content/fields/WidgetContent.d.ts +3371 -7324
  5. package/lib/content/fields/nestable/NestableContent.d.ts +3 -145
  6. package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +4 -212
  7. package/lib/content/fields/nestable/RichTextContent/Blocks.js +2 -0
  8. package/lib/content/fields/nestable/RichTextContent/index.d.ts +4 -184
  9. package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +6 -290
  10. package/lib/content/fields/slices/Slice/CompositeSliceContent.js +3 -0
  11. package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +2 -383
  12. package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +15 -1333
  13. package/lib/content/fields/slices/Slice/SharedSliceContent.js +2 -0
  14. package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +7 -1182
  15. package/lib/content/fields/slices/Slice/SimpleSliceContent.js +1 -0
  16. package/lib/content/fields/slices/Slice/SlicePrimaryContent.d.ts +7 -1182
  17. package/lib/content/fields/slices/Slice/index.d.ts +983 -2935
  18. package/lib/content/fields/slices/SliceItem.d.ts +148 -2100
  19. package/lib/content/fields/slices/SlicesContent.d.ts +866 -3644
  20. package/lib/content/fields/withDefaultValues.d.ts +4 -3
  21. package/lib/content/fields/withDefaultValues.js +17 -1
  22. package/lib/customtypes/CustomType.d.ts +70 -915
  23. package/lib/customtypes/Section.d.ts +70 -915
  24. package/lib/customtypes/diff/SharedSlice.d.ts +2 -340
  25. package/lib/customtypes/diff/Variation.d.ts +4 -351
  26. package/lib/customtypes/diff/Variation.js +4 -3
  27. package/lib/customtypes/diff/Widgets.d.ts +11 -0
  28. package/lib/customtypes/diff/Widgets.js +2 -0
  29. package/lib/customtypes/diff/index.d.ts +1 -0
  30. package/lib/customtypes/diff/index.js +1 -0
  31. package/lib/customtypes/widgets/Group.d.ts +15 -331
  32. package/lib/customtypes/widgets/Group.js +25 -5
  33. package/lib/customtypes/widgets/Widget.d.ts +7 -1014
  34. package/lib/customtypes/widgets/slices/LegacySlice.d.ts +2 -168
  35. package/lib/customtypes/widgets/slices/SharedSlice.d.ts +2 -336
  36. package/lib/customtypes/widgets/slices/SlicePrimaryWidget.d.ts +3 -338
  37. package/lib/customtypes/widgets/slices/Slices.d.ts +7 -1184
  38. package/lib/validators/function.js +8 -1
  39. package/package.json +5 -5
  40. package/src/content/fields/GroupContent.ts +107 -32
  41. package/src/content/fields/nestable/RichTextContent/Blocks.ts +3 -1
  42. package/src/content/fields/slices/Slice/CompositeSliceContent.ts +7 -4
  43. package/src/content/fields/slices/Slice/SharedSliceContent.ts +5 -3
  44. package/src/content/fields/slices/Slice/SimpleSliceContent.ts +3 -1
  45. package/src/content/fields/withDefaultValues.ts +27 -3
  46. package/src/customtypes/diff/Variation.ts +9 -20
  47. package/src/customtypes/diff/Widgets.ts +17 -0
  48. package/src/customtypes/diff/index.ts +1 -0
  49. package/src/customtypes/widgets/Group.ts +66 -20
  50. package/src/validators/function.ts +11 -1
@@ -187,45 +187,7 @@ export declare const isCompositeSliceContent: (u: unknown) => u is {
187
187
  alt?: string | null;
188
188
  provider?: string | null | undefined;
189
189
  } & {
190
- linkTo?: ({
191
- __TYPE__: "ImageLink";
192
- } & {
193
- id: string;
194
- url: string;
195
- height: string;
196
- width: string;
197
- size: string;
198
- name: string;
199
- kind: string;
200
- } & {
201
- date?: string | null | undefined;
202
- }) | ({
203
- id: string;
204
- url: string;
205
- name: string;
206
- kind: string;
207
- size: string;
208
- } & {
209
- date?: string | null | undefined;
210
- } & {
211
- __TYPE__: "FileLink";
212
- } & {
213
- size?: string;
214
- }) | ({
215
- __TYPE__: "DocumentLink";
216
- } & {
217
- id: string;
218
- }) | ({
219
- __TYPE__: "ExternalLink";
220
- } & {
221
- url: string;
222
- } & {
223
- kind?: "web";
224
- target?: string | null | undefined;
225
- preview?: {
226
- title?: string;
227
- } | null | undefined;
228
- }) | null | undefined;
190
+ linkTo?: any;
229
191
  };
230
192
  } & {
231
193
  label?: string | null | undefined;
@@ -503,45 +465,7 @@ export declare const isCompositeSliceContent: (u: unknown) => u is {
503
465
  alt?: string | null;
504
466
  provider?: string | null | undefined;
505
467
  } & {
506
- linkTo?: ({
507
- __TYPE__: "ImageLink";
508
- } & {
509
- id: string;
510
- url: string;
511
- height: string;
512
- width: string;
513
- size: string;
514
- name: string;
515
- kind: string;
516
- } & {
517
- date?: string | null | undefined;
518
- }) | ({
519
- id: string;
520
- url: string;
521
- name: string;
522
- kind: string;
523
- size: string;
524
- } & {
525
- date?: string | null | undefined;
526
- } & {
527
- __TYPE__: "FileLink";
528
- } & {
529
- size?: string;
530
- }) | ({
531
- __TYPE__: "DocumentLink";
532
- } & {
533
- id: string;
534
- }) | ({
535
- __TYPE__: "ExternalLink";
536
- } & {
537
- url: string;
538
- } & {
539
- kind?: "web";
540
- target?: string | null | undefined;
541
- preview?: {
542
- title?: string;
543
- } | null | undefined;
544
- }) | null | undefined;
468
+ linkTo?: any;
545
469
  };
546
470
  } & {
547
471
  label?: string | null | undefined;
@@ -821,45 +745,7 @@ export declare const CompositeSliceLegacy: (ctx: LegacyContentCtx) => t.Type<{
821
745
  alt?: string | null;
822
746
  provider?: string | null | undefined;
823
747
  } & {
824
- linkTo?: ({
825
- __TYPE__: "ImageLink";
826
- } & {
827
- id: string;
828
- url: string;
829
- height: string;
830
- width: string;
831
- size: string;
832
- name: string;
833
- kind: string;
834
- } & {
835
- date?: string | null | undefined;
836
- }) | ({
837
- id: string;
838
- url: string;
839
- name: string;
840
- kind: string;
841
- size: string;
842
- } & {
843
- date?: string | null | undefined;
844
- } & {
845
- __TYPE__: "FileLink";
846
- } & {
847
- size?: string;
848
- }) | ({
849
- __TYPE__: "DocumentLink";
850
- } & {
851
- id: string;
852
- }) | ({
853
- __TYPE__: "ExternalLink";
854
- } & {
855
- url: string;
856
- } & {
857
- kind?: "web";
858
- target?: string | null | undefined;
859
- preview?: {
860
- title?: string;
861
- } | null | undefined;
862
- }) | null | undefined;
748
+ linkTo?: any;
863
749
  };
864
750
  } & {
865
751
  label?: string | null | undefined;
@@ -1137,45 +1023,7 @@ export declare const CompositeSliceLegacy: (ctx: LegacyContentCtx) => t.Type<{
1137
1023
  alt?: string | null;
1138
1024
  provider?: string | null | undefined;
1139
1025
  } & {
1140
- linkTo?: ({
1141
- __TYPE__: "ImageLink";
1142
- } & {
1143
- id: string;
1144
- url: string;
1145
- height: string;
1146
- width: string;
1147
- size: string;
1148
- name: string;
1149
- kind: string;
1150
- } & {
1151
- date?: string | null | undefined;
1152
- }) | ({
1153
- id: string;
1154
- url: string;
1155
- name: string;
1156
- kind: string;
1157
- size: string;
1158
- } & {
1159
- date?: string | null | undefined;
1160
- } & {
1161
- __TYPE__: "FileLink";
1162
- } & {
1163
- size?: string;
1164
- }) | ({
1165
- __TYPE__: "DocumentLink";
1166
- } & {
1167
- id: string;
1168
- }) | ({
1169
- __TYPE__: "ExternalLink";
1170
- } & {
1171
- url: string;
1172
- } & {
1173
- kind?: "web";
1174
- target?: string | null | undefined;
1175
- preview?: {
1176
- title?: string;
1177
- } | null | undefined;
1178
- }) | null | undefined;
1026
+ linkTo?: any;
1179
1027
  };
1180
1028
  } & {
1181
1029
  label?: string | null | undefined;
@@ -1459,73 +1307,7 @@ export declare const CompositeSliceContent: t.ExactC<t.TypeC<{
1459
1307
  alt: t.Type<string | null, string | null, unknown>;
1460
1308
  provider: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
1461
1309
  }>]>>, t.PartialC<{
1462
- linkTo: t.UnionC<[t.Type<({
1463
- __TYPE__: "ImageLink";
1464
- } & {
1465
- id: string;
1466
- url: string;
1467
- height: string;
1468
- width: string;
1469
- size: string;
1470
- name: string;
1471
- kind: string;
1472
- } & {
1473
- date?: string | null | undefined;
1474
- }) | ({
1475
- id: string;
1476
- url: string;
1477
- name: string;
1478
- kind: string;
1479
- size: string;
1480
- } & {
1481
- date?: string | null | undefined;
1482
- } & {
1483
- __TYPE__: "FileLink";
1484
- } & {
1485
- size?: string;
1486
- }) | ({
1487
- __TYPE__: "DocumentLink";
1488
- } & {
1489
- id: string;
1490
- }) | ({
1491
- __TYPE__: "ExternalLink";
1492
- } & {
1493
- url: string;
1494
- } & {
1495
- kind?: "web";
1496
- target?: string | null | undefined;
1497
- preview?: {
1498
- title?: string;
1499
- } | null | undefined;
1500
- }), ({
1501
- id: string;
1502
- url: string;
1503
- height: string;
1504
- width: string;
1505
- size: string;
1506
- name: string;
1507
- kind: string;
1508
- } & {
1509
- date?: string | null | undefined;
1510
- }) | ({
1511
- id: string;
1512
- url: string;
1513
- name: string;
1514
- kind: string;
1515
- size: string;
1516
- } & {
1517
- date?: string | null | undefined;
1518
- }) | {
1519
- id: string;
1520
- } | ({
1521
- url: string;
1522
- } & {
1523
- kind?: "web";
1524
- target?: string | null | undefined;
1525
- preview?: {
1526
- title?: string;
1527
- } | null | undefined;
1528
- }), unknown>, t.NullC, t.UndefinedC]>;
1310
+ linkTo: t.UnionC<[t.Type<any, any, unknown>, t.NullC, t.UndefinedC]>;
1529
1311
  }>]>;
1530
1312
  }>, t.PartialC<{
1531
1313
  label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
@@ -1854,73 +1636,7 @@ export declare const CompositeSliceContent: t.ExactC<t.TypeC<{
1854
1636
  alt: t.Type<string | null, string | null, unknown>;
1855
1637
  provider: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
1856
1638
  }>]>>, t.PartialC<{
1857
- linkTo: t.UnionC<[t.Type<({
1858
- __TYPE__: "ImageLink";
1859
- } & {
1860
- id: string;
1861
- url: string;
1862
- height: string;
1863
- width: string;
1864
- size: string;
1865
- name: string;
1866
- kind: string;
1867
- } & {
1868
- date?: string | null | undefined;
1869
- }) | ({
1870
- id: string;
1871
- url: string;
1872
- name: string;
1873
- kind: string;
1874
- size: string;
1875
- } & {
1876
- date?: string | null | undefined;
1877
- } & {
1878
- __TYPE__: "FileLink";
1879
- } & {
1880
- size?: string;
1881
- }) | ({
1882
- __TYPE__: "DocumentLink";
1883
- } & {
1884
- id: string;
1885
- }) | ({
1886
- __TYPE__: "ExternalLink";
1887
- } & {
1888
- url: string;
1889
- } & {
1890
- kind?: "web";
1891
- target?: string | null | undefined;
1892
- preview?: {
1893
- title?: string;
1894
- } | null | undefined;
1895
- }), ({
1896
- id: string;
1897
- url: string;
1898
- height: string;
1899
- width: string;
1900
- size: string;
1901
- name: string;
1902
- kind: string;
1903
- } & {
1904
- date?: string | null | undefined;
1905
- }) | ({
1906
- id: string;
1907
- url: string;
1908
- name: string;
1909
- kind: string;
1910
- size: string;
1911
- } & {
1912
- date?: string | null | undefined;
1913
- }) | {
1914
- id: string;
1915
- } | ({
1916
- url: string;
1917
- } & {
1918
- kind?: "web";
1919
- target?: string | null | undefined;
1920
- preview?: {
1921
- title?: string;
1922
- } | null | undefined;
1923
- }), unknown>, t.NullC, t.UndefinedC]>;
1639
+ linkTo: t.UnionC<[t.Type<any, any, unknown>, t.NullC, t.UndefinedC]>;
1924
1640
  }>]>;
1925
1641
  }>, t.PartialC<{
1926
1642
  label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
@@ -28,6 +28,7 @@ const CompositeSliceLegacy = (ctx) => {
28
28
  if (!result || (0, Either_1.isLeft)(result))
29
29
  return;
30
30
  return result.right;
31
+ // We don't support nested groups on composite slice items
31
32
  })() || [];
32
33
  const nonRepeat = Object.entries(parsedSlice["non-repeat"] || {}).reduce((acc, [key, value]) => {
33
34
  const fieldCtx = (0, LegacyContentCtx_1.getFieldCtx)(key, ctx, ["non-repeat"]);
@@ -127,6 +128,7 @@ function traverseCompositeSliceContent({ path, sliceKey, sliceName, model, conte
127
128
  path: path.concat([{ key: "repeat", type: "items" }]),
128
129
  model: (model === null || model === void 0 ? void 0 : model.type) === "SharedSlice" ? model === null || model === void 0 ? void 0 : model.fields.items : model === null || model === void 0 ? void 0 : model.repeat,
129
130
  content: content.widget.repeat,
131
+ // We don't support nested groups on composite slice items
130
132
  })(transformWidget);
131
133
  return transformSlice({
132
134
  key: sliceKey,
@@ -174,6 +176,7 @@ function migrateCompositeSlice(model, content) {
174
176
  return acc.concat([[fieldKey, fieldContent]]);
175
177
  }, []),
176
178
  };
179
+ // We don't support nested groups on composite slice items
177
180
  }, []),
178
181
  },
179
182
  };