@prismicio/types-internal 2.4.1 → 2.5.0-alpha.1

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 (43) hide show
  1. package/lib/content/Document.d.ts +3982 -7936
  2. package/lib/content/fields/GroupContent.d.ts +17 -1754
  3. package/lib/content/fields/GroupContent.js +59 -21
  4. package/lib/content/fields/WidgetContent.d.ts +3375 -7328
  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 +10 -294
  10. package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +5 -385
  11. package/lib/content/fields/slices/Slice/RepeatableContent.js +4 -1
  12. package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +19 -1337
  13. package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +7 -1182
  14. package/lib/content/fields/slices/Slice/SlicePrimaryContent.d.ts +7 -1182
  15. package/lib/content/fields/slices/Slice/index.d.ts +991 -2943
  16. package/lib/content/fields/slices/SliceItem.d.ts +155 -2107
  17. package/lib/content/fields/slices/SlicesContent.d.ts +1134 -3912
  18. package/lib/content/fields/withDefaultValues.d.ts +4 -3
  19. package/lib/content/fields/withDefaultValues.js +17 -1
  20. package/lib/customtypes/CustomType.d.ts +70 -915
  21. package/lib/customtypes/Section.d.ts +70 -915
  22. package/lib/customtypes/diff/SharedSlice.d.ts +2 -340
  23. package/lib/customtypes/diff/Variation.d.ts +3 -340
  24. package/lib/customtypes/diff/Widgets.d.ts +1 -1
  25. package/lib/customtypes/widgets/Group.d.ts +15 -331
  26. package/lib/customtypes/widgets/Group.js +22 -5
  27. package/lib/customtypes/widgets/Widget.d.ts +7 -1014
  28. package/lib/customtypes/widgets/slices/LegacySlice.d.ts +2 -168
  29. package/lib/customtypes/widgets/slices/SharedSlice.d.ts +2 -336
  30. package/lib/customtypes/widgets/slices/SlicePrimaryWidget.d.ts +3 -338
  31. package/lib/customtypes/widgets/slices/Slices.d.ts +7 -1184
  32. package/package.json +5 -5
  33. package/src/content/fields/GroupContent.ts +101 -31
  34. package/src/content/fields/nestable/RichTextContent/Blocks.ts +3 -1
  35. package/src/content/fields/slices/Slice/RepeatableContent.ts +9 -2
  36. package/src/content/fields/withDefaultValues.ts +27 -3
  37. package/src/customtypes/diff/Variation.ts +4 -2
  38. package/src/customtypes/diff/Widgets.ts +1 -7
  39. package/src/customtypes/widgets/Group.ts +60 -20
  40. package/lib/content/fields/nestable/RichTextContent/TextBlock.d.ts +0 -727
  41. package/lib/content/fields/nestable/RichTextContent/TextBlock.js +0 -80
  42. package/lib/customtypes/widgets/slices/SliceWidget.d.ts +0 -327
  43. package/lib/customtypes/widgets/slices/SliceWidget.js +0 -8
@@ -1,326 +1,12 @@
1
1
  import * as t from "io-ts";
2
2
  import type { LegacyContentCtx } from "../../../LegacyContentCtx";
3
- export declare const RepeatableWidgetsLegacy: (ctx: LegacyContentCtx) => t.ArrayC<t.Type<{
4
- __TYPE__: "GroupItemContent";
5
- value: [string, {
6
- type: string;
7
- __TYPE__: "EmptyContent";
8
- } | {
9
- __TYPE__: "BooleanContent";
10
- value: boolean;
11
- } | ({
12
- embed_url: string;
13
- type: string;
14
- } & {
15
- version?: string | number | null;
16
- title?: string | null | undefined;
17
- author_name?: string | null | undefined;
18
- author_url?: string | null | undefined;
19
- provider_name?: string | null | undefined;
20
- provider_url?: string | null | undefined;
21
- cache_age?: string | number | null;
22
- thumbnail_url?: string | null | undefined;
23
- thumbnail_width?: number | null | undefined;
24
- thumbnail_height?: number | null | undefined;
25
- html?: string | null | undefined;
26
- } & {
27
- __TYPE__: "EmbedContent";
28
- all: unknown;
29
- }) | {
30
- type: "Color";
31
- value: string;
32
- __TYPE__: "FieldContent";
33
- } | {
34
- type: "Date";
35
- value: string;
36
- __TYPE__: "FieldContent";
37
- } | {
38
- type: "Number";
39
- value: string;
40
- __TYPE__: "FieldContent";
41
- } | {
42
- type: "Range";
43
- value: string;
44
- __TYPE__: "FieldContent";
45
- } | {
46
- type: "Select";
47
- value: string;
48
- __TYPE__: "FieldContent";
49
- } | {
50
- type: "Text";
51
- value: string;
52
- __TYPE__: "FieldContent";
53
- } | {
54
- type: "Timestamp";
55
- value: string;
56
- __TYPE__: "FieldContent";
57
- } | ({
58
- position: {
59
- lat: number;
60
- lng: number;
61
- };
62
- } & {
63
- __TYPE__: "GeoPointContent";
64
- }) | ({
65
- origin: {
66
- id: string;
67
- url: string;
68
- width: number;
69
- height: number;
70
- };
71
- width: number;
72
- height: number;
73
- edit: {
74
- zoom: number;
75
- crop: {
76
- x: number;
77
- y: number;
78
- };
79
- background: string;
80
- };
81
- } & {
82
- url?: string;
83
- credits?: string | null;
84
- alt?: string | null;
85
- provider?: string | null | undefined;
86
- } & {
87
- thumbnails?: {
88
- [x: string]: {
89
- origin: {
90
- id: string;
91
- url: string;
92
- width: number;
93
- height: number;
94
- };
95
- width: number;
96
- height: number;
97
- edit: {
98
- zoom: number;
99
- crop: {
100
- x: number;
101
- y: number;
102
- };
103
- background: string;
104
- };
105
- } & {
106
- url?: string;
107
- credits?: string | null;
108
- alt?: string | null;
109
- provider?: string | null | undefined;
110
- };
111
- };
112
- } & {
113
- __TYPE__: "ImageContent";
114
- }) | {
115
- __TYPE__: "IntegrationFieldsContent";
116
- value: string;
117
- } | {
118
- __TYPE__: "LinkContent";
119
- value: ({
120
- __TYPE__: "ImageLink";
121
- } & {
122
- id: string;
123
- url: string;
124
- height: string;
125
- width: string;
126
- size: string;
127
- name: string;
128
- kind: string;
129
- } & {
130
- date?: string | null | undefined;
131
- }) | ({
132
- id: string;
133
- url: string;
134
- name: string;
135
- kind: string;
136
- size: string;
137
- } & {
138
- date?: string | null | undefined;
139
- } & {
140
- __TYPE__: "FileLink";
141
- } & {
142
- size?: string;
143
- }) | ({
144
- __TYPE__: "DocumentLink";
145
- } & {
146
- id: string;
147
- }) | ({
148
- __TYPE__: "ExternalLink";
149
- } & {
150
- url: string;
151
- } & {
152
- kind?: "web";
153
- target?: string | null | undefined;
154
- preview?: {
155
- title?: string;
156
- } | null | undefined;
157
- });
158
- } | {
159
- __TYPE__: "StructuredTextContent";
160
- value: (({
161
- type: "image";
162
- data: {
163
- origin: {
164
- id: string;
165
- url: string;
166
- width: number;
167
- height: number;
168
- };
169
- width: number;
170
- height: number;
171
- edit: {
172
- zoom: number;
173
- crop: {
174
- x: number;
175
- y: number;
176
- };
177
- background: string;
178
- };
179
- } & {
180
- url?: string;
181
- credits?: string | null;
182
- alt?: string | null;
183
- provider?: string | null | undefined;
184
- } & {
185
- linkTo?: ({
186
- __TYPE__: "ImageLink";
187
- } & {
188
- id: string;
189
- url: string;
190
- height: string;
191
- width: string;
192
- size: string;
193
- name: string;
194
- kind: string;
195
- } & {
196
- date?: string | null | undefined;
197
- }) | ({
198
- id: string;
199
- url: string;
200
- name: string;
201
- kind: string;
202
- size: string;
203
- } & {
204
- date?: string | null | undefined;
205
- } & {
206
- __TYPE__: "FileLink";
207
- } & {
208
- size?: string;
209
- }) | ({
210
- __TYPE__: "DocumentLink";
211
- } & {
212
- id: string;
213
- }) | ({
214
- __TYPE__: "ExternalLink";
215
- } & {
216
- url: string;
217
- } & {
218
- kind?: "web";
219
- target?: string | null | undefined;
220
- preview?: {
221
- title?: string;
222
- } | null | undefined;
223
- }) | null | undefined;
224
- };
225
- } & {
226
- label?: string | null | undefined;
227
- direction?: string | null | undefined;
228
- }) | ({
229
- type: "embed";
230
- data: {
231
- embed_url: string;
232
- type: string;
233
- } & {
234
- version?: string | number | null;
235
- title?: string | null | undefined;
236
- author_name?: string | null | undefined;
237
- author_url?: string | null | undefined;
238
- provider_name?: string | null | undefined;
239
- provider_url?: string | null | undefined;
240
- cache_age?: string | number | null;
241
- thumbnail_url?: string | null | undefined;
242
- thumbnail_width?: number | null | undefined;
243
- thumbnail_height?: number | null | undefined;
244
- html?: string | null | undefined;
245
- } & {
246
- __TYPE__: "EmbedContent";
247
- all: unknown;
248
- };
249
- } & {
250
- label?: string | null | undefined;
251
- direction?: string | null | undefined;
252
- }) | ({
253
- type: "image" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "embed" | "list-item" | "o-list-item" | "rtl";
254
- content: {
255
- text: string;
256
- } & {
257
- spans?: ({
258
- data: ({
259
- __TYPE__: "ImageLink";
260
- } & {
261
- id: string;
262
- url: string;
263
- height: string;
264
- width: string;
265
- size: string;
266
- name: string;
267
- kind: string;
268
- } & {
269
- date?: string | null | undefined;
270
- }) | ({
271
- id: string;
272
- url: string;
273
- name: string;
274
- kind: string;
275
- size: string;
276
- } & {
277
- date?: string | null | undefined;
278
- } & {
279
- __TYPE__: "FileLink";
280
- } & {
281
- size?: string;
282
- }) | ({
283
- __TYPE__: "DocumentLink";
284
- } & {
285
- id: string;
286
- }) | ({
287
- __TYPE__: "ExternalLink";
288
- } & {
289
- url: string;
290
- } & {
291
- kind?: "web";
292
- target?: string | null | undefined;
293
- preview?: {
294
- title?: string;
295
- } | null | undefined;
296
- });
297
- start: number;
298
- end: number;
299
- type: "hyperlink";
300
- } | {
301
- data: string;
302
- start: number;
303
- end: number;
304
- type: "label";
305
- } | {
306
- start: number;
307
- end: number;
308
- type: "strong" | "em" | "list-item";
309
- })[];
310
- };
311
- } & {
312
- label?: string;
313
- direction?: string;
314
- }))[];
315
- } | {
316
- __TYPE__: "SeparatorContent";
317
- }][];
318
- }, import("../../../LegacyContentCtx").WithTypes<{
3
+ import { GroupContent } from "../../GroupContent";
4
+ export declare const RepeatableWidgetsLegacy: (ctx: LegacyContentCtx) => t.ArrayC<t.Type<import("../../GroupContent").GroupItemContent, import("../../../LegacyContentCtx").WithTypes<{
319
5
  [x: string]: unknown;
320
6
  }>, unknown>>;
321
7
  export declare const RepeatableWidgets: t.ArrayC<t.ExactC<t.TypeC<{
322
8
  __TYPE__: t.LiteralC<"GroupItemContent">;
323
- value: t.ArrayC<t.TupleC<[t.StringC, t.UnionC<[t.ExactC<t.TypeC<{
9
+ value: t.ArrayC<t.TupleC<[t.StringC, t.UnionC<[t.Type<GroupContent, GroupContent, unknown>, t.UnionC<[t.ExactC<t.TypeC<{
324
10
  type: t.StringC;
325
11
  __TYPE__: t.LiteralC<"EmptyContent">;
326
12
  }>>, t.ExactC<t.TypeC<{
@@ -500,73 +186,7 @@ export declare const RepeatableWidgets: t.ArrayC<t.ExactC<t.TypeC<{
500
186
  alt: t.Type<string | null, string | null, unknown>;
501
187
  provider: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
502
188
  }>]>>, t.PartialC<{
503
- linkTo: t.UnionC<[t.Type<({
504
- __TYPE__: "ImageLink";
505
- } & {
506
- id: string;
507
- url: string;
508
- height: string;
509
- width: string;
510
- size: string;
511
- name: string;
512
- kind: string;
513
- } & {
514
- date?: string | null | undefined;
515
- }) | ({
516
- id: string;
517
- url: string;
518
- name: string;
519
- kind: string;
520
- size: string;
521
- } & {
522
- date?: string | null | undefined;
523
- } & {
524
- __TYPE__: "FileLink";
525
- } & {
526
- size?: string;
527
- }) | ({
528
- __TYPE__: "DocumentLink";
529
- } & {
530
- id: string;
531
- }) | ({
532
- __TYPE__: "ExternalLink";
533
- } & {
534
- url: string;
535
- } & {
536
- kind?: "web";
537
- target?: string | null | undefined;
538
- preview?: {
539
- title?: string;
540
- } | null | undefined;
541
- }), ({
542
- id: string;
543
- url: string;
544
- height: string;
545
- width: string;
546
- size: string;
547
- name: string;
548
- kind: string;
549
- } & {
550
- date?: string | null | undefined;
551
- }) | ({
552
- id: string;
553
- url: string;
554
- name: string;
555
- kind: string;
556
- size: string;
557
- } & {
558
- date?: string | null | undefined;
559
- }) | {
560
- id: string;
561
- } | ({
562
- url: string;
563
- } & {
564
- kind?: "web";
565
- target?: string | null | undefined;
566
- preview?: {
567
- title?: string;
568
- } | null | undefined;
569
- }), unknown>, t.NullC, t.UndefinedC]>;
189
+ linkTo: t.UnionC<[t.Type<any, any, unknown>, t.NullC, t.UndefinedC]>;
570
190
  }>]>;
571
191
  }>, t.PartialC<{
572
192
  label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
@@ -712,5 +332,5 @@ export declare const RepeatableWidgets: t.ArrayC<t.ExactC<t.TypeC<{
712
332
  }>]>>]>>;
713
333
  }>>, t.ExactC<t.TypeC<{
714
334
  __TYPE__: t.LiteralC<"SeparatorContent">;
715
- }>>]>]>>;
335
+ }>>]>]>]>>;
716
336
  }>>>;
@@ -9,7 +9,10 @@ const RepeatableWidgetsLegacy = (ctx) => {
9
9
  return t.array((0, GroupContent_1.GroupItemLegacy)(ctx));
10
10
  };
11
11
  exports.RepeatableWidgetsLegacy = RepeatableWidgetsLegacy;
12
- const RepeatableWidget = t.tuple([t.string, nestable_1.NestableContent]);
12
+ const RepeatableWidget = t.tuple([
13
+ t.string,
14
+ t.union([GroupContent_1.GroupContent, nestable_1.NestableContent]),
15
+ ]);
13
16
  const RepeatableWidgetsBlock = t.strict({
14
17
  __TYPE__: t.literal(GroupContent_1.GroupItemContentType),
15
18
  value: t.array(RepeatableWidget),