@prismicio/types-internal 1.4.0 → 1.4.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.
@@ -0,0 +1,17 @@
1
+ export declare enum DiffOperation {
2
+ Added = "added",
3
+ Removed = "removed",
4
+ Updated = "updated"
5
+ }
6
+ export declare type AddChange<A> = {
7
+ op: DiffOperation.Added;
8
+ value: A;
9
+ };
10
+ export declare type RemovedChange = {
11
+ op: DiffOperation.Removed;
12
+ };
13
+ export declare type UpdatedChange<A> = {
14
+ op: DiffOperation.Updated;
15
+ value: A;
16
+ };
17
+ export declare type DiffChange<A, U> = AddChange<A> | UpdatedChange<U> | RemovedChange;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiffOperation = void 0;
4
+ var DiffOperation;
5
+ (function (DiffOperation) {
6
+ DiffOperation["Added"] = "added";
7
+ DiffOperation["Removed"] = "removed";
8
+ DiffOperation["Updated"] = "updated";
9
+ })(DiffOperation = exports.DiffOperation || (exports.DiffOperation = {}));
@@ -0,0 +1,679 @@
1
+ import type { SharedSlice } from "../widgets/slices";
2
+ import { type DiffChange } from "./Changes";
3
+ import { VariationDiff } from "./Variation";
4
+ declare type SliceMetadata = Omit<SharedSlice, "variations">;
5
+ declare type SliceDiff = DiffChange<SharedSlice, Partial<SliceMetadata & {
6
+ variations?: Partial<Record<string, VariationDiff>>;
7
+ }>>;
8
+ export declare const SliceComparator: {
9
+ compare(sliceA?: ({
10
+ id: string;
11
+ type: "SharedSlice";
12
+ name: string;
13
+ variations: readonly ({
14
+ id: string;
15
+ name: string;
16
+ description: string;
17
+ imageUrl: string;
18
+ docURL: string;
19
+ version: string;
20
+ } & {
21
+ display?: string;
22
+ primary?: {
23
+ [x: string]: ({
24
+ type: "Boolean";
25
+ } & {
26
+ config?: {
27
+ label?: string | null | undefined;
28
+ default_value?: boolean;
29
+ placeholder_true?: string;
30
+ placeholder_false?: string;
31
+ };
32
+ }) | ({
33
+ type: "Color";
34
+ } & {
35
+ fieldset?: string | null | undefined;
36
+ config?: {
37
+ label?: string | null | undefined;
38
+ placeholder?: string;
39
+ };
40
+ }) | ({
41
+ type: "Date";
42
+ } & {
43
+ fieldset?: string | null | undefined;
44
+ config?: {
45
+ label?: string | null | undefined;
46
+ placeholder?: string;
47
+ default?: string;
48
+ };
49
+ }) | ({
50
+ type: "Embed";
51
+ } & {
52
+ fieldset?: string | null | undefined;
53
+ config?: {
54
+ label?: string | null | undefined;
55
+ placeholder?: string;
56
+ useAsTitle?: boolean;
57
+ };
58
+ }) | ({
59
+ type: "GeoPoint";
60
+ } & {
61
+ fieldset?: string | null | undefined;
62
+ config?: {
63
+ label?: string | null | undefined;
64
+ };
65
+ }) | ({
66
+ type: "Image";
67
+ } & {
68
+ fieldset?: string | null | undefined;
69
+ config?: {
70
+ label?: string | null | undefined;
71
+ placeholder?: string;
72
+ constraint?: {
73
+ width?: number | null;
74
+ height?: number | null;
75
+ };
76
+ thumbnails?: readonly ({
77
+ name: string;
78
+ } & {
79
+ width?: number | null;
80
+ height?: number | null;
81
+ })[];
82
+ };
83
+ }) | ({
84
+ type: "IntegrationFields";
85
+ } & {
86
+ fieldset?: string | null | undefined;
87
+ config?: {
88
+ label?: string | null | undefined;
89
+ placeholder?: string;
90
+ catalog?: string;
91
+ };
92
+ }) | ({
93
+ type: "Link";
94
+ } & {
95
+ fieldset?: string | null | undefined;
96
+ config?: {
97
+ label?: string | null | undefined;
98
+ useAsTitle?: boolean;
99
+ placeholder?: string;
100
+ select?: "web" | "media" | "document" | null;
101
+ customtypes?: readonly string[];
102
+ masks?: readonly string[];
103
+ tags?: readonly string[];
104
+ allowTargetBlank?: boolean;
105
+ };
106
+ }) | ({
107
+ type: "Number";
108
+ } & {
109
+ fieldset?: string | null | undefined;
110
+ config?: {
111
+ label?: string | null | undefined;
112
+ placeholder?: string;
113
+ min?: number;
114
+ max?: number;
115
+ step?: number;
116
+ };
117
+ }) | ({
118
+ type: "Range";
119
+ } & {
120
+ fieldset?: string | null | undefined;
121
+ config?: {
122
+ label?: string | null | undefined;
123
+ placeholder?: string;
124
+ min?: number;
125
+ max?: number;
126
+ step?: number;
127
+ };
128
+ }) | ({
129
+ type: "StructuredText";
130
+ } & {
131
+ fieldset?: string | null | undefined;
132
+ config?: {
133
+ label?: string | null | undefined;
134
+ placeholder?: string;
135
+ useAsTitle?: boolean;
136
+ single?: string;
137
+ multi?: string;
138
+ imageConstraint?: {
139
+ width?: number | null;
140
+ height?: number | null;
141
+ };
142
+ labels?: readonly string[];
143
+ allowTargetBlank?: boolean;
144
+ };
145
+ }) | ({
146
+ type: "Select";
147
+ } & {
148
+ fieldset?: string | null | undefined;
149
+ config?: {
150
+ label?: string | null | undefined;
151
+ placeholder?: string;
152
+ default_value?: string;
153
+ options?: readonly string[];
154
+ };
155
+ }) | ({
156
+ type: "Separator";
157
+ } & {
158
+ config?: {
159
+ label?: string | null | undefined;
160
+ };
161
+ }) | ({
162
+ type: "Text";
163
+ } & {
164
+ fieldset?: string | null | undefined;
165
+ config?: {
166
+ label?: string | null | undefined;
167
+ useAsTitle?: boolean;
168
+ placeholder?: string;
169
+ };
170
+ }) | ({
171
+ type: "Timestamp";
172
+ } & {
173
+ fieldset?: string | null | undefined;
174
+ config?: {
175
+ label?: string | null | undefined;
176
+ placeholder?: string;
177
+ default?: string;
178
+ };
179
+ });
180
+ };
181
+ items?: {
182
+ [x: string]: ({
183
+ type: "Boolean";
184
+ } & {
185
+ config?: {
186
+ label?: string | null | undefined;
187
+ default_value?: boolean;
188
+ placeholder_true?: string;
189
+ placeholder_false?: string;
190
+ };
191
+ }) | ({
192
+ type: "Color";
193
+ } & {
194
+ fieldset?: string | null | undefined;
195
+ config?: {
196
+ label?: string | null | undefined;
197
+ placeholder?: string;
198
+ };
199
+ }) | ({
200
+ type: "Date";
201
+ } & {
202
+ fieldset?: string | null | undefined;
203
+ config?: {
204
+ label?: string | null | undefined;
205
+ placeholder?: string;
206
+ default?: string;
207
+ };
208
+ }) | ({
209
+ type: "Embed";
210
+ } & {
211
+ fieldset?: string | null | undefined;
212
+ config?: {
213
+ label?: string | null | undefined;
214
+ placeholder?: string;
215
+ useAsTitle?: boolean;
216
+ };
217
+ }) | ({
218
+ type: "GeoPoint";
219
+ } & {
220
+ fieldset?: string | null | undefined;
221
+ config?: {
222
+ label?: string | null | undefined;
223
+ };
224
+ }) | ({
225
+ type: "Image";
226
+ } & {
227
+ fieldset?: string | null | undefined;
228
+ config?: {
229
+ label?: string | null | undefined;
230
+ placeholder?: string;
231
+ constraint?: {
232
+ width?: number | null;
233
+ height?: number | null;
234
+ };
235
+ thumbnails?: readonly ({
236
+ name: string;
237
+ } & {
238
+ width?: number | null;
239
+ height?: number | null;
240
+ })[];
241
+ };
242
+ }) | ({
243
+ type: "IntegrationFields";
244
+ } & {
245
+ fieldset?: string | null | undefined;
246
+ config?: {
247
+ label?: string | null | undefined;
248
+ placeholder?: string;
249
+ catalog?: string;
250
+ };
251
+ }) | ({
252
+ type: "Link";
253
+ } & {
254
+ fieldset?: string | null | undefined;
255
+ config?: {
256
+ label?: string | null | undefined;
257
+ useAsTitle?: boolean;
258
+ placeholder?: string;
259
+ select?: "web" | "media" | "document" | null;
260
+ customtypes?: readonly string[];
261
+ masks?: readonly string[];
262
+ tags?: readonly string[];
263
+ allowTargetBlank?: boolean;
264
+ };
265
+ }) | ({
266
+ type: "Number";
267
+ } & {
268
+ fieldset?: string | null | undefined;
269
+ config?: {
270
+ label?: string | null | undefined;
271
+ placeholder?: string;
272
+ min?: number;
273
+ max?: number;
274
+ step?: number;
275
+ };
276
+ }) | ({
277
+ type: "Range";
278
+ } & {
279
+ fieldset?: string | null | undefined;
280
+ config?: {
281
+ label?: string | null | undefined;
282
+ placeholder?: string;
283
+ min?: number;
284
+ max?: number;
285
+ step?: number;
286
+ };
287
+ }) | ({
288
+ type: "StructuredText";
289
+ } & {
290
+ fieldset?: string | null | undefined;
291
+ config?: {
292
+ label?: string | null | undefined;
293
+ placeholder?: string;
294
+ useAsTitle?: boolean;
295
+ single?: string;
296
+ multi?: string;
297
+ imageConstraint?: {
298
+ width?: number | null;
299
+ height?: number | null;
300
+ };
301
+ labels?: readonly string[];
302
+ allowTargetBlank?: boolean;
303
+ };
304
+ }) | ({
305
+ type: "Select";
306
+ } & {
307
+ fieldset?: string | null | undefined;
308
+ config?: {
309
+ label?: string | null | undefined;
310
+ placeholder?: string;
311
+ default_value?: string;
312
+ options?: readonly string[];
313
+ };
314
+ }) | ({
315
+ type: "Separator";
316
+ } & {
317
+ config?: {
318
+ label?: string | null | undefined;
319
+ };
320
+ }) | ({
321
+ type: "Text";
322
+ } & {
323
+ fieldset?: string | null | undefined;
324
+ config?: {
325
+ label?: string | null | undefined;
326
+ useAsTitle?: boolean;
327
+ placeholder?: string;
328
+ };
329
+ }) | ({
330
+ type: "Timestamp";
331
+ } & {
332
+ fieldset?: string | null | undefined;
333
+ config?: {
334
+ label?: string | null | undefined;
335
+ placeholder?: string;
336
+ default?: string;
337
+ };
338
+ });
339
+ };
340
+ })[];
341
+ } & {
342
+ description?: string;
343
+ }) | undefined, sliceB?: ({
344
+ id: string;
345
+ type: "SharedSlice";
346
+ name: string;
347
+ variations: readonly ({
348
+ id: string;
349
+ name: string;
350
+ description: string;
351
+ imageUrl: string;
352
+ docURL: string;
353
+ version: string;
354
+ } & {
355
+ display?: string;
356
+ primary?: {
357
+ [x: string]: ({
358
+ type: "Boolean";
359
+ } & {
360
+ config?: {
361
+ label?: string | null | undefined;
362
+ default_value?: boolean;
363
+ placeholder_true?: string;
364
+ placeholder_false?: string;
365
+ };
366
+ }) | ({
367
+ type: "Color";
368
+ } & {
369
+ fieldset?: string | null | undefined;
370
+ config?: {
371
+ label?: string | null | undefined;
372
+ placeholder?: string;
373
+ };
374
+ }) | ({
375
+ type: "Date";
376
+ } & {
377
+ fieldset?: string | null | undefined;
378
+ config?: {
379
+ label?: string | null | undefined;
380
+ placeholder?: string;
381
+ default?: string;
382
+ };
383
+ }) | ({
384
+ type: "Embed";
385
+ } & {
386
+ fieldset?: string | null | undefined;
387
+ config?: {
388
+ label?: string | null | undefined;
389
+ placeholder?: string;
390
+ useAsTitle?: boolean;
391
+ };
392
+ }) | ({
393
+ type: "GeoPoint";
394
+ } & {
395
+ fieldset?: string | null | undefined;
396
+ config?: {
397
+ label?: string | null | undefined;
398
+ };
399
+ }) | ({
400
+ type: "Image";
401
+ } & {
402
+ fieldset?: string | null | undefined;
403
+ config?: {
404
+ label?: string | null | undefined;
405
+ placeholder?: string;
406
+ constraint?: {
407
+ width?: number | null;
408
+ height?: number | null;
409
+ };
410
+ thumbnails?: readonly ({
411
+ name: string;
412
+ } & {
413
+ width?: number | null;
414
+ height?: number | null;
415
+ })[];
416
+ };
417
+ }) | ({
418
+ type: "IntegrationFields";
419
+ } & {
420
+ fieldset?: string | null | undefined;
421
+ config?: {
422
+ label?: string | null | undefined;
423
+ placeholder?: string;
424
+ catalog?: string;
425
+ };
426
+ }) | ({
427
+ type: "Link";
428
+ } & {
429
+ fieldset?: string | null | undefined;
430
+ config?: {
431
+ label?: string | null | undefined;
432
+ useAsTitle?: boolean;
433
+ placeholder?: string;
434
+ select?: "web" | "media" | "document" | null;
435
+ customtypes?: readonly string[];
436
+ masks?: readonly string[];
437
+ tags?: readonly string[];
438
+ allowTargetBlank?: boolean;
439
+ };
440
+ }) | ({
441
+ type: "Number";
442
+ } & {
443
+ fieldset?: string | null | undefined;
444
+ config?: {
445
+ label?: string | null | undefined;
446
+ placeholder?: string;
447
+ min?: number;
448
+ max?: number;
449
+ step?: number;
450
+ };
451
+ }) | ({
452
+ type: "Range";
453
+ } & {
454
+ fieldset?: string | null | undefined;
455
+ config?: {
456
+ label?: string | null | undefined;
457
+ placeholder?: string;
458
+ min?: number;
459
+ max?: number;
460
+ step?: number;
461
+ };
462
+ }) | ({
463
+ type: "StructuredText";
464
+ } & {
465
+ fieldset?: string | null | undefined;
466
+ config?: {
467
+ label?: string | null | undefined;
468
+ placeholder?: string;
469
+ useAsTitle?: boolean;
470
+ single?: string;
471
+ multi?: string;
472
+ imageConstraint?: {
473
+ width?: number | null;
474
+ height?: number | null;
475
+ };
476
+ labels?: readonly string[];
477
+ allowTargetBlank?: boolean;
478
+ };
479
+ }) | ({
480
+ type: "Select";
481
+ } & {
482
+ fieldset?: string | null | undefined;
483
+ config?: {
484
+ label?: string | null | undefined;
485
+ placeholder?: string;
486
+ default_value?: string;
487
+ options?: readonly string[];
488
+ };
489
+ }) | ({
490
+ type: "Separator";
491
+ } & {
492
+ config?: {
493
+ label?: string | null | undefined;
494
+ };
495
+ }) | ({
496
+ type: "Text";
497
+ } & {
498
+ fieldset?: string | null | undefined;
499
+ config?: {
500
+ label?: string | null | undefined;
501
+ useAsTitle?: boolean;
502
+ placeholder?: string;
503
+ };
504
+ }) | ({
505
+ type: "Timestamp";
506
+ } & {
507
+ fieldset?: string | null | undefined;
508
+ config?: {
509
+ label?: string | null | undefined;
510
+ placeholder?: string;
511
+ default?: string;
512
+ };
513
+ });
514
+ };
515
+ items?: {
516
+ [x: string]: ({
517
+ type: "Boolean";
518
+ } & {
519
+ config?: {
520
+ label?: string | null | undefined;
521
+ default_value?: boolean;
522
+ placeholder_true?: string;
523
+ placeholder_false?: string;
524
+ };
525
+ }) | ({
526
+ type: "Color";
527
+ } & {
528
+ fieldset?: string | null | undefined;
529
+ config?: {
530
+ label?: string | null | undefined;
531
+ placeholder?: string;
532
+ };
533
+ }) | ({
534
+ type: "Date";
535
+ } & {
536
+ fieldset?: string | null | undefined;
537
+ config?: {
538
+ label?: string | null | undefined;
539
+ placeholder?: string;
540
+ default?: string;
541
+ };
542
+ }) | ({
543
+ type: "Embed";
544
+ } & {
545
+ fieldset?: string | null | undefined;
546
+ config?: {
547
+ label?: string | null | undefined;
548
+ placeholder?: string;
549
+ useAsTitle?: boolean;
550
+ };
551
+ }) | ({
552
+ type: "GeoPoint";
553
+ } & {
554
+ fieldset?: string | null | undefined;
555
+ config?: {
556
+ label?: string | null | undefined;
557
+ };
558
+ }) | ({
559
+ type: "Image";
560
+ } & {
561
+ fieldset?: string | null | undefined;
562
+ config?: {
563
+ label?: string | null | undefined;
564
+ placeholder?: string;
565
+ constraint?: {
566
+ width?: number | null;
567
+ height?: number | null;
568
+ };
569
+ thumbnails?: readonly ({
570
+ name: string;
571
+ } & {
572
+ width?: number | null;
573
+ height?: number | null;
574
+ })[];
575
+ };
576
+ }) | ({
577
+ type: "IntegrationFields";
578
+ } & {
579
+ fieldset?: string | null | undefined;
580
+ config?: {
581
+ label?: string | null | undefined;
582
+ placeholder?: string;
583
+ catalog?: string;
584
+ };
585
+ }) | ({
586
+ type: "Link";
587
+ } & {
588
+ fieldset?: string | null | undefined;
589
+ config?: {
590
+ label?: string | null | undefined;
591
+ useAsTitle?: boolean;
592
+ placeholder?: string;
593
+ select?: "web" | "media" | "document" | null;
594
+ customtypes?: readonly string[];
595
+ masks?: readonly string[];
596
+ tags?: readonly string[];
597
+ allowTargetBlank?: boolean;
598
+ };
599
+ }) | ({
600
+ type: "Number";
601
+ } & {
602
+ fieldset?: string | null | undefined;
603
+ config?: {
604
+ label?: string | null | undefined;
605
+ placeholder?: string;
606
+ min?: number;
607
+ max?: number;
608
+ step?: number;
609
+ };
610
+ }) | ({
611
+ type: "Range";
612
+ } & {
613
+ fieldset?: string | null | undefined;
614
+ config?: {
615
+ label?: string | null | undefined;
616
+ placeholder?: string;
617
+ min?: number;
618
+ max?: number;
619
+ step?: number;
620
+ };
621
+ }) | ({
622
+ type: "StructuredText";
623
+ } & {
624
+ fieldset?: string | null | undefined;
625
+ config?: {
626
+ label?: string | null | undefined;
627
+ placeholder?: string;
628
+ useAsTitle?: boolean;
629
+ single?: string;
630
+ multi?: string;
631
+ imageConstraint?: {
632
+ width?: number | null;
633
+ height?: number | null;
634
+ };
635
+ labels?: readonly string[];
636
+ allowTargetBlank?: boolean;
637
+ };
638
+ }) | ({
639
+ type: "Select";
640
+ } & {
641
+ fieldset?: string | null | undefined;
642
+ config?: {
643
+ label?: string | null | undefined;
644
+ placeholder?: string;
645
+ default_value?: string;
646
+ options?: readonly string[];
647
+ };
648
+ }) | ({
649
+ type: "Separator";
650
+ } & {
651
+ config?: {
652
+ label?: string | null | undefined;
653
+ };
654
+ }) | ({
655
+ type: "Text";
656
+ } & {
657
+ fieldset?: string | null | undefined;
658
+ config?: {
659
+ label?: string | null | undefined;
660
+ useAsTitle?: boolean;
661
+ placeholder?: string;
662
+ };
663
+ }) | ({
664
+ type: "Timestamp";
665
+ } & {
666
+ fieldset?: string | null | undefined;
667
+ config?: {
668
+ label?: string | null | undefined;
669
+ placeholder?: string;
670
+ default?: string;
671
+ };
672
+ });
673
+ };
674
+ })[];
675
+ } & {
676
+ description?: string;
677
+ }) | undefined): SliceDiff | undefined;
678
+ };
679
+ export {};