@prismicio/types-internal 2.7.0 → 2.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.
Files changed (44) hide show
  1. package/lib/_internal/utils.d.ts +3 -2
  2. package/lib/content/Document.d.ts +1457 -149
  3. package/lib/content/LegacyContentCtx.d.ts +15 -0
  4. package/lib/content/fields/RepeatableContent.d.ts +236 -0
  5. package/lib/content/fields/RepeatableContent.js +97 -0
  6. package/lib/content/fields/WidgetContent.d.ts +1465 -157
  7. package/lib/content/fields/nestable/LinkContent.d.ts +55 -32
  8. package/lib/content/fields/nestable/LinkContent.js +25 -10
  9. package/lib/content/fields/nestable/NestableContent.d.ts +242 -24
  10. package/lib/content/fields/nestable/NestableContent.js +21 -2
  11. package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +106 -106
  12. package/lib/content/fields/nestable/RichTextContent/index.d.ts +20 -20
  13. package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +482 -46
  14. package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +84 -10
  15. package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +484 -48
  16. package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +242 -24
  17. package/lib/content/fields/slices/Slice/SlicePrimaryContent.d.ts +243 -25
  18. package/lib/content/fields/slices/Slice/index.d.ts +815 -85
  19. package/lib/content/fields/slices/SliceItem.d.ts +814 -84
  20. package/lib/content/fields/slices/SlicesContent.d.ts +1222 -132
  21. package/lib/customtypes/CustomType.d.ts +18 -0
  22. package/lib/customtypes/Section.d.ts +18 -0
  23. package/lib/customtypes/diff/SharedSlice.d.ts +8 -0
  24. package/lib/customtypes/diff/Variation.d.ts +8 -0
  25. package/lib/customtypes/widgets/Group.d.ts +6 -0
  26. package/lib/customtypes/widgets/Widget.d.ts +36 -0
  27. package/lib/customtypes/widgets/Widget.js +15 -0
  28. package/lib/customtypes/widgets/nestable/Link.d.ts +2 -0
  29. package/lib/customtypes/widgets/nestable/Link.js +5 -1
  30. package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +3 -1
  31. package/lib/customtypes/widgets/nestable/NestableWidget.js +18 -1
  32. package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +2 -0
  33. package/lib/customtypes/widgets/slices/LegacySlice.d.ts +2 -0
  34. package/lib/customtypes/widgets/slices/SharedSlice.d.ts +8 -0
  35. package/lib/customtypes/widgets/slices/SlicePrimaryWidget.d.ts +6 -0
  36. package/lib/customtypes/widgets/slices/Slices.d.ts +28 -0
  37. package/package.json +1 -1
  38. package/src/_internal/utils.ts +3 -1
  39. package/src/content/fields/RepeatableContent.ts +156 -0
  40. package/src/content/fields/nestable/LinkContent.ts +26 -26
  41. package/src/content/fields/nestable/NestableContent.ts +28 -3
  42. package/src/customtypes/widgets/Widget.ts +15 -0
  43. package/src/customtypes/widgets/nestable/Link.ts +5 -1
  44. package/src/customtypes/widgets/nestable/NestableWidget.ts +34 -16
@@ -116,7 +116,7 @@ export declare const SlicePrimaryContent: t.UnionC<[t.UnionC<[t.ExactC<t.TypeC<{
116
116
  value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
117
117
  __TYPE__: t.LiteralC<"ImageLink">;
118
118
  }>>, t.UnionC<[t.IntersectionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
119
- kind: t.Type<"image", "image", unknown>;
119
+ kind: t.StringC;
120
120
  id: t.StringC;
121
121
  url: t.StringC;
122
122
  height: t.StringC;
@@ -133,7 +133,7 @@ export declare const SlicePrimaryContent: t.UnionC<[t.UnionC<[t.ExactC<t.TypeC<{
133
133
  }>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
134
134
  __TYPE__: t.LiteralC<"FileLink">;
135
135
  }>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
136
- kind: t.Type<"file", "file", unknown>;
136
+ kind: t.StringC;
137
137
  id: t.StringC;
138
138
  url: t.StringC;
139
139
  name: t.StringC;
@@ -211,7 +211,7 @@ export declare const SlicePrimaryContent: t.UnionC<[t.UnionC<[t.ExactC<t.TypeC<{
211
211
  linkTo: t.UnionC<[t.Type<({
212
212
  __TYPE__: "ImageLink";
213
213
  } & {
214
- kind: "image";
214
+ kind: string;
215
215
  id: string;
216
216
  url: string;
217
217
  height: string;
@@ -223,7 +223,7 @@ export declare const SlicePrimaryContent: t.UnionC<[t.UnionC<[t.ExactC<t.TypeC<{
223
223
  }) | ({
224
224
  __TYPE__: "FileLink";
225
225
  } & {
226
- kind: "file";
226
+ kind: string;
227
227
  id: string;
228
228
  url: string;
229
229
  name: string;
@@ -247,7 +247,7 @@ export declare const SlicePrimaryContent: t.UnionC<[t.UnionC<[t.ExactC<t.TypeC<{
247
247
  }), ({
248
248
  __TYPE__: "ImageLink";
249
249
  } & {
250
- kind: "image";
250
+ kind: string;
251
251
  id: string;
252
252
  url: string;
253
253
  height: string;
@@ -259,7 +259,7 @@ export declare const SlicePrimaryContent: t.UnionC<[t.UnionC<[t.ExactC<t.TypeC<{
259
259
  }) | ({
260
260
  __TYPE__: "FileLink";
261
261
  } & {
262
- kind: "file";
262
+ kind: string;
263
263
  id: string;
264
264
  url: string;
265
265
  name: string;
@@ -318,7 +318,7 @@ export declare const SlicePrimaryContent: t.UnionC<[t.UnionC<[t.ExactC<t.TypeC<{
318
318
  data: ({
319
319
  __TYPE__: "ImageLink";
320
320
  } & {
321
- kind: "image";
321
+ kind: string;
322
322
  id: string;
323
323
  url: string;
324
324
  height: string;
@@ -330,7 +330,7 @@ export declare const SlicePrimaryContent: t.UnionC<[t.UnionC<[t.ExactC<t.TypeC<{
330
330
  }) | ({
331
331
  __TYPE__: "FileLink";
332
332
  } & {
333
- kind: "file";
333
+ kind: string;
334
334
  id: string;
335
335
  url: string;
336
336
  name: string;
@@ -368,7 +368,7 @@ export declare const SlicePrimaryContent: t.UnionC<[t.UnionC<[t.ExactC<t.TypeC<{
368
368
  data: ({
369
369
  __TYPE__: "ImageLink";
370
370
  } & {
371
- kind: "image";
371
+ kind: string;
372
372
  id: string;
373
373
  url: string;
374
374
  height: string;
@@ -380,7 +380,7 @@ export declare const SlicePrimaryContent: t.UnionC<[t.UnionC<[t.ExactC<t.TypeC<{
380
380
  }) | ({
381
381
  __TYPE__: "FileLink";
382
382
  } & {
383
- kind: "file";
383
+ kind: string;
384
384
  id: string;
385
385
  url: string;
386
386
  name: string;
@@ -422,11 +422,85 @@ export declare const SlicePrimaryContent: t.UnionC<[t.UnionC<[t.ExactC<t.TypeC<{
422
422
  }>]>>]>>;
423
423
  }>>, t.ExactC<t.TypeC<{
424
424
  __TYPE__: t.LiteralC<"SeparatorContent">;
425
+ }>>, t.ExactC<t.TypeC<{
426
+ __TYPE__: t.LiteralC<"RepeatableContent">;
427
+ type: t.UnionC<[t.LiteralC<"Color">, t.LiteralC<"Boolean">, t.LiteralC<"Embed">, t.LiteralC<"GeoPoint">, t.LiteralC<"Date">, t.LiteralC<"Number">, t.LiteralC<"Range">, t.LiteralC<"StructuredText">, t.LiteralC<"Select">, t.LiteralC<"Separator">, t.LiteralC<"Text">, t.LiteralC<"Timestamp">, t.LiteralC<"Link">, t.LiteralC<"Image">, t.LiteralC<"IntegrationFields">]>;
428
+ value: t.ArrayC<t.ExactC<t.TypeC<{
429
+ __TYPE__: t.LiteralC<"LinkContent">;
430
+ value: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
431
+ __TYPE__: t.LiteralC<"ImageLink">;
432
+ }>>, t.UnionC<[t.IntersectionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
433
+ kind: t.StringC;
434
+ id: t.StringC;
435
+ url: t.StringC;
436
+ height: t.StringC;
437
+ width: t.StringC;
438
+ size: t.StringC;
439
+ name: t.StringC;
440
+ }>>, t.ExactC<t.PartialC<{
441
+ date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
442
+ }>>]>, t.ExactC<t.PartialC<{
443
+ text: t.StringC;
444
+ }>>]>, t.ExactC<t.TypeC<{
445
+ kind: t.LiteralC<"image">;
446
+ text: t.StringC;
447
+ }>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
448
+ __TYPE__: t.LiteralC<"FileLink">;
449
+ }>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
450
+ kind: t.StringC;
451
+ id: t.StringC;
452
+ url: t.StringC;
453
+ name: t.StringC;
454
+ size: t.StringC;
455
+ }>, t.PartialC<{
456
+ date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
457
+ }>]>>, t.ExactC<t.PartialC<{
458
+ text: t.StringC;
459
+ }>>]>, t.ExactC<t.TypeC<{
460
+ kind: t.LiteralC<"file">;
461
+ text: t.StringC;
462
+ }>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
463
+ __TYPE__: t.LiteralC<"DocumentLink">;
464
+ }>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
465
+ id: t.Type<string, string, unknown>;
466
+ }>>, t.ExactC<t.PartialC<{
467
+ text: t.StringC;
468
+ }>>]>, t.ExactC<t.TypeC<{
469
+ kind: t.LiteralC<"document">;
470
+ text: t.StringC;
471
+ }>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
472
+ __TYPE__: t.LiteralC<"ExternalLink">;
473
+ }>>, t.UnionC<[t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
474
+ url: t.StringC;
475
+ }>, t.PartialC<{
476
+ kind: t.LiteralC<"web">;
477
+ target: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
478
+ preview: t.UnionC<[t.Type<{
479
+ title?: string;
480
+ }, {
481
+ title?: string;
482
+ }, unknown>, t.NullC, t.UndefinedC]>;
483
+ }>]>>, t.ExactC<t.PartialC<{
484
+ text: t.StringC;
485
+ }>>]>, t.ExactC<t.TypeC<{
486
+ kind: t.LiteralC<"web">;
487
+ text: t.StringC;
488
+ }>>]>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
489
+ __TYPE__: t.LiteralC<"MediaLink">;
490
+ }>>, t.ExactC<t.TypeC<{
491
+ kind: t.LiteralC<"media">;
492
+ text: t.StringC;
493
+ }>>]>, t.IntersectionC<[t.ExactC<t.TypeC<{
494
+ __TYPE__: t.LiteralC<"AnyLink">;
495
+ }>>, t.ExactC<t.TypeC<{
496
+ text: t.StringC;
497
+ }>>]>]>;
498
+ }>>>;
425
499
  }>>]>, t.Type<GroupContent, GroupContent, unknown>]>;
426
500
  export declare type SlicePrimaryContent = t.TypeOf<typeof SlicePrimaryContent>;
427
501
  export declare type SlicePrimaryContentType = SlicePrimaryContent["__TYPE__"];
428
502
  export declare const SlicePrimaryLegacy: (ctx: LegacyContentCtx) => {
429
- decode(value: unknown): import("fp-ts/lib/Either").Right<{
503
+ decode(value: unknown): import("fp-ts/lib/Either").Left<t.Errors> | import("fp-ts/lib/Either").Right<{
430
504
  type: string;
431
505
  __TYPE__: "EmptyContent";
432
506
  }> | import("fp-ts/lib/Either").Right<{
@@ -543,7 +617,7 @@ export declare const SlicePrimaryLegacy: (ctx: LegacyContentCtx) => {
543
617
  value: ({
544
618
  __TYPE__: "ImageLink";
545
619
  } & (({
546
- kind: "image";
620
+ kind: string;
547
621
  id: string;
548
622
  url: string;
549
623
  height: string;
@@ -560,7 +634,7 @@ export declare const SlicePrimaryLegacy: (ctx: LegacyContentCtx) => {
560
634
  })) | ({
561
635
  __TYPE__: "FileLink";
562
636
  } & (({
563
- kind: "file";
637
+ kind: string;
564
638
  id: string;
565
639
  url: string;
566
640
  name: string;
@@ -606,6 +680,78 @@ export declare const SlicePrimaryLegacy: (ctx: LegacyContentCtx) => {
606
680
  } & {
607
681
  text: string;
608
682
  });
683
+ }> | import("fp-ts/lib/Either").Right<{
684
+ __TYPE__: "RepeatableContent";
685
+ type: "Boolean" | "Color" | "Date" | "Embed" | "GeoPoint" | "Image" | "IntegrationFields" | "Link" | "Number" | "Range" | "StructuredText" | "Select" | "Separator" | "Text" | "Timestamp";
686
+ value: {
687
+ __TYPE__: "LinkContent";
688
+ value: ({
689
+ __TYPE__: "ImageLink";
690
+ } & (({
691
+ kind: string;
692
+ id: string;
693
+ url: string;
694
+ height: string;
695
+ width: string;
696
+ size: string;
697
+ name: string;
698
+ } & {
699
+ date?: string | null | undefined;
700
+ } & {
701
+ text?: string;
702
+ }) | {
703
+ kind: "image";
704
+ text: string;
705
+ })) | ({
706
+ __TYPE__: "FileLink";
707
+ } & (({
708
+ kind: string;
709
+ id: string;
710
+ url: string;
711
+ name: string;
712
+ size: string;
713
+ } & {
714
+ date?: string | null | undefined;
715
+ } & {
716
+ text?: string;
717
+ }) | {
718
+ kind: "file";
719
+ text: string;
720
+ })) | ({
721
+ __TYPE__: "MediaLink";
722
+ } & {
723
+ kind: "media";
724
+ text: string;
725
+ }) | ({
726
+ __TYPE__: "DocumentLink";
727
+ } & (({
728
+ id: string;
729
+ } & {
730
+ text?: string;
731
+ }) | {
732
+ kind: "document";
733
+ text: string;
734
+ })) | ({
735
+ __TYPE__: "ExternalLink";
736
+ } & (({
737
+ url: string;
738
+ } & {
739
+ kind?: "web";
740
+ target?: string | null | undefined;
741
+ preview?: {
742
+ title?: string;
743
+ } | null | undefined;
744
+ } & {
745
+ text?: string;
746
+ }) | {
747
+ kind: "web";
748
+ text: string;
749
+ })) | ({
750
+ __TYPE__: "AnyLink";
751
+ } & {
752
+ text: string;
753
+ });
754
+ }[];
609
755
  }> | import("fp-ts/lib/Either").Right<{
610
756
  __TYPE__: "StructuredTextContent";
611
757
  value: (({
@@ -636,7 +782,7 @@ export declare const SlicePrimaryLegacy: (ctx: LegacyContentCtx) => {
636
782
  linkTo?: ({
637
783
  __TYPE__: "ImageLink";
638
784
  } & {
639
- kind: "image";
785
+ kind: string;
640
786
  id: string;
641
787
  url: string;
642
788
  height: string;
@@ -648,7 +794,7 @@ export declare const SlicePrimaryLegacy: (ctx: LegacyContentCtx) => {
648
794
  }) | ({
649
795
  __TYPE__: "FileLink";
650
796
  } & {
651
- kind: "file";
797
+ kind: string;
652
798
  id: string;
653
799
  url: string;
654
800
  name: string;
@@ -707,7 +853,7 @@ export declare const SlicePrimaryLegacy: (ctx: LegacyContentCtx) => {
707
853
  data: ({
708
854
  __TYPE__: "ImageLink";
709
855
  } & {
710
- kind: "image";
856
+ kind: string;
711
857
  id: string;
712
858
  url: string;
713
859
  height: string;
@@ -719,7 +865,7 @@ export declare const SlicePrimaryLegacy: (ctx: LegacyContentCtx) => {
719
865
  }) | ({
720
866
  __TYPE__: "FileLink";
721
867
  } & {
722
- kind: "file";
868
+ kind: string;
723
869
  id: string;
724
870
  url: string;
725
871
  name: string;
@@ -761,7 +907,7 @@ export declare const SlicePrimaryLegacy: (ctx: LegacyContentCtx) => {
761
907
  }))[];
762
908
  }> | import("fp-ts/lib/Either").Right<{
763
909
  __TYPE__: "SeparatorContent";
764
- }> | t.Validation<GroupContent> | undefined;
910
+ }> | import("fp-ts/lib/Either").Right<GroupContent> | undefined;
765
911
  encode(value: SlicePrimaryContent): import("../../../LegacyContentCtx").WithTypes<unknown> | undefined;
766
912
  };
767
913
  export declare const isSlicePrimaryContent: (u: unknown) => u is {
@@ -881,7 +1027,7 @@ export declare const isSlicePrimaryContent: (u: unknown) => u is {
881
1027
  value: ({
882
1028
  __TYPE__: "ImageLink";
883
1029
  } & (({
884
- kind: "image";
1030
+ kind: string;
885
1031
  id: string;
886
1032
  url: string;
887
1033
  height: string;
@@ -898,7 +1044,7 @@ export declare const isSlicePrimaryContent: (u: unknown) => u is {
898
1044
  })) | ({
899
1045
  __TYPE__: "FileLink";
900
1046
  } & (({
901
- kind: "file";
1047
+ kind: string;
902
1048
  id: string;
903
1049
  url: string;
904
1050
  name: string;
@@ -945,6 +1091,78 @@ export declare const isSlicePrimaryContent: (u: unknown) => u is {
945
1091
  text: string;
946
1092
  });
947
1093
  } | {
1094
+ __TYPE__: "RepeatableContent";
1095
+ type: "Boolean" | "Color" | "Date" | "Embed" | "GeoPoint" | "Image" | "IntegrationFields" | "Link" | "Number" | "Range" | "StructuredText" | "Select" | "Separator" | "Text" | "Timestamp";
1096
+ value: {
1097
+ __TYPE__: "LinkContent";
1098
+ value: ({
1099
+ __TYPE__: "ImageLink";
1100
+ } & (({
1101
+ kind: string;
1102
+ id: string;
1103
+ url: string;
1104
+ height: string;
1105
+ width: string;
1106
+ size: string;
1107
+ name: string;
1108
+ } & {
1109
+ date?: string | null | undefined;
1110
+ } & {
1111
+ text?: string;
1112
+ }) | {
1113
+ kind: "image";
1114
+ text: string;
1115
+ })) | ({
1116
+ __TYPE__: "FileLink";
1117
+ } & (({
1118
+ kind: string;
1119
+ id: string;
1120
+ url: string;
1121
+ name: string;
1122
+ size: string;
1123
+ } & {
1124
+ date?: string | null | undefined;
1125
+ } & {
1126
+ text?: string;
1127
+ }) | {
1128
+ kind: "file";
1129
+ text: string;
1130
+ })) | ({
1131
+ __TYPE__: "MediaLink";
1132
+ } & {
1133
+ kind: "media";
1134
+ text: string;
1135
+ }) | ({
1136
+ __TYPE__: "DocumentLink";
1137
+ } & (({
1138
+ id: string;
1139
+ } & {
1140
+ text?: string;
1141
+ }) | {
1142
+ kind: "document";
1143
+ text: string;
1144
+ })) | ({
1145
+ __TYPE__: "ExternalLink";
1146
+ } & (({
1147
+ url: string;
1148
+ } & {
1149
+ kind?: "web";
1150
+ target?: string | null | undefined;
1151
+ preview?: {
1152
+ title?: string;
1153
+ } | null | undefined;
1154
+ } & {
1155
+ text?: string;
1156
+ }) | {
1157
+ kind: "web";
1158
+ text: string;
1159
+ })) | ({
1160
+ __TYPE__: "AnyLink";
1161
+ } & {
1162
+ text: string;
1163
+ });
1164
+ }[];
1165
+ } | GroupContent | {
948
1166
  __TYPE__: "StructuredTextContent";
949
1167
  value: (({
950
1168
  type: "image";
@@ -974,7 +1192,7 @@ export declare const isSlicePrimaryContent: (u: unknown) => u is {
974
1192
  linkTo?: ({
975
1193
  __TYPE__: "ImageLink";
976
1194
  } & {
977
- kind: "image";
1195
+ kind: string;
978
1196
  id: string;
979
1197
  url: string;
980
1198
  height: string;
@@ -986,7 +1204,7 @@ export declare const isSlicePrimaryContent: (u: unknown) => u is {
986
1204
  }) | ({
987
1205
  __TYPE__: "FileLink";
988
1206
  } & {
989
- kind: "file";
1207
+ kind: string;
990
1208
  id: string;
991
1209
  url: string;
992
1210
  name: string;
@@ -1045,7 +1263,7 @@ export declare const isSlicePrimaryContent: (u: unknown) => u is {
1045
1263
  data: ({
1046
1264
  __TYPE__: "ImageLink";
1047
1265
  } & {
1048
- kind: "image";
1266
+ kind: string;
1049
1267
  id: string;
1050
1268
  url: string;
1051
1269
  height: string;
@@ -1057,7 +1275,7 @@ export declare const isSlicePrimaryContent: (u: unknown) => u is {
1057
1275
  }) | ({
1058
1276
  __TYPE__: "FileLink";
1059
1277
  } & {
1060
- kind: "file";
1278
+ kind: string;
1061
1279
  id: string;
1062
1280
  url: string;
1063
1281
  name: string;
@@ -1099,4 +1317,4 @@ export declare const isSlicePrimaryContent: (u: unknown) => u is {
1099
1317
  }))[];
1100
1318
  } | {
1101
1319
  __TYPE__: "SeparatorContent";
1102
- } | GroupContent;
1320
+ };