@prismicio/types-internal 1.5.1 → 1.5.3

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,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Document = exports.WidgetKey = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
6
+ const widgets_1 = require("../documents/widgets");
7
+ const fields_1 = require("./fields");
8
+ exports.WidgetKey = widgets_1.WidgetKey;
9
+ const WidgetContent = t.union([
10
+ fields_1.SlicesContent,
11
+ fields_1.UIDContent,
12
+ fields_1.NestableContent,
13
+ fields_1.GroupContent,
14
+ ]);
15
+ exports.Document = t.record(exports.WidgetKey, WidgetContent);
@@ -1,2 +1,2 @@
1
- export * from "./CustomType";
1
+ export * from "./Document";
2
2
  export * from "./fields";
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./CustomType"), exports);
4
+ (0, tslib_1.__exportStar)(require("./Document"), exports);
5
5
  (0, tslib_1.__exportStar)(require("./fields"), exports);
@@ -1,8 +1,8 @@
1
1
  import type { SharedSlice } from "../widgets/slices";
2
2
  import { type DiffChange } from "./Changes";
3
3
  import { VariationDiff } from "./Variation";
4
- declare type SliceMetadata = Omit<SharedSlice, "variations">;
5
- declare type SliceDiff = DiffChange<SharedSlice, Partial<SliceMetadata & {
4
+ export declare type SliceMetadata = Omit<SharedSlice, "variations">;
5
+ export declare type SliceDiff = DiffChange<SharedSlice, Partial<SliceMetadata & {
6
6
  variations?: Partial<Record<string, VariationDiff>>;
7
7
  }>>;
8
8
  export declare const SliceComparator: {
@@ -676,4 +676,3 @@ export declare const SliceComparator: {
676
676
  description?: string;
677
677
  }) | undefined): SliceDiff | undefined;
678
678
  };
679
- export {};
@@ -1,7 +1,11 @@
1
+ import type { NestableWidget } from "../widgets/nestable";
1
2
  import type { Variation } from "../widgets/slices";
2
3
  import { type DiffChange } from "./Changes";
3
- declare type VariationMetadata = Omit<Variation, "primary" | "items">;
4
- export declare type VariationDiff = DiffChange<Variation, Partial<VariationMetadata>>;
4
+ export declare type VariationMetadata = Omit<Variation, "primary" | "items">;
5
+ export declare type VariationDiff = DiffChange<Variation, Partial<VariationMetadata> & {
6
+ primary?: Record<string, DiffChange<NestableWidget, NestableWidget>>;
7
+ items?: Record<string, DiffChange<NestableWidget, NestableWidget>>;
8
+ }>;
5
9
  export declare const VariationComparator: {
6
10
  compare(variationA?: ({
7
11
  id: string;
@@ -659,4 +663,3 @@ export declare const VariationComparator: {
659
663
  };
660
664
  }) | undefined): VariationDiff | undefined;
661
665
  };
662
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/types-internal",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "Prismic types for Custom Types and Prismic Data",
5
5
  "keywords": [
6
6
  "typescript",
@@ -17,5 +17,5 @@ const WidgetContent = t.union([
17
17
  NestableContent,
18
18
  GroupContent,
19
19
  ])
20
- export const CustomTypeContent = t.record(WidgetKey, WidgetContent)
21
- export type CustomTypeContent = t.TypeOf<typeof CustomTypeContent>
20
+ export const Document = t.record(WidgetKey, WidgetContent)
21
+ export type Document = t.TypeOf<typeof Document>
@@ -1,2 +1,2 @@
1
- export * from "./CustomType"
1
+ export * from "./Document"
2
2
  export * from "./fields"
@@ -3,8 +3,8 @@ import type { SharedSlice, Variation } from "../widgets/slices"
3
3
  import { type DiffChange, DiffOperation } from "./Changes"
4
4
  import { VariationComparator, VariationDiff } from "./Variation"
5
5
 
6
- type SliceMetadata = Omit<SharedSlice, "variations">
7
- type SliceDiff = DiffChange<
6
+ export type SliceMetadata = Omit<SharedSlice, "variations">
7
+ export type SliceDiff = DiffChange<
8
8
  SharedSlice,
9
9
  Partial<
10
10
  SliceMetadata & {
@@ -3,8 +3,14 @@ import type { NestableWidget } from "../widgets/nestable"
3
3
  import type { Variation } from "../widgets/slices"
4
4
  import { type DiffChange, DiffOperation } from "./Changes"
5
5
 
6
- type VariationMetadata = Omit<Variation, "primary" | "items">
7
- export type VariationDiff = DiffChange<Variation, Partial<VariationMetadata>>
6
+ export type VariationMetadata = Omit<Variation, "primary" | "items">
7
+ export type VariationDiff = DiffChange<
8
+ Variation,
9
+ Partial<VariationMetadata> & {
10
+ primary?: Record<string, DiffChange<NestableWidget, NestableWidget>>
11
+ items?: Record<string, DiffChange<NestableWidget, NestableWidget>>
12
+ }
13
+ >
8
14
 
9
15
  function compareVariationMeta(
10
16
  variationA?: Variation,