@prismicio/types-internal 3.9.0 → 3.10.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 (31) hide show
  1. package/lib/_internal/utils.d.ts +6 -1
  2. package/lib/content/Document.d.ts +1 -1
  3. package/lib/customtypes/CustomType.d.ts +402 -162
  4. package/lib/customtypes/CustomType.js +16 -1
  5. package/lib/customtypes/Section.d.ts +403 -162
  6. package/lib/customtypes/Section.js +40 -1
  7. package/lib/customtypes/diff/SharedSlice.d.ts +168 -64
  8. package/lib/customtypes/diff/Variation.d.ts +168 -64
  9. package/lib/customtypes/widgets/Group.d.ts +258 -90
  10. package/lib/customtypes/widgets/Group.js +62 -1
  11. package/lib/customtypes/widgets/Widget.d.ts +621 -231
  12. package/lib/customtypes/widgets/nestable/Link.d.ts +82 -30
  13. package/lib/customtypes/widgets/nestable/Link.js +43 -19
  14. package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +41 -15
  15. package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +89 -30
  16. package/lib/customtypes/widgets/slices/CompositeSlice.js +26 -1
  17. package/lib/customtypes/widgets/slices/LegacySlice.d.ts +82 -30
  18. package/lib/customtypes/widgets/slices/SharedSlice.d.ts +341 -120
  19. package/lib/customtypes/widgets/slices/SharedSlice.js +59 -1
  20. package/lib/customtypes/widgets/slices/SlicePrimaryWidget.d.ts +186 -69
  21. package/lib/customtypes/widgets/slices/Slices.d.ts +836 -308
  22. package/lib/customtypes/widgets/slices/Slices.js +61 -1
  23. package/package.json +1 -1
  24. package/src/_internal/utils.ts +4 -0
  25. package/src/customtypes/CustomType.ts +30 -1
  26. package/src/customtypes/Section.ts +53 -0
  27. package/src/customtypes/widgets/Group.ts +75 -0
  28. package/src/customtypes/widgets/nestable/Link.ts +85 -24
  29. package/src/customtypes/widgets/slices/CompositeSlice.ts +38 -0
  30. package/src/customtypes/widgets/slices/SharedSlice.ts +71 -0
  31. package/src/customtypes/widgets/slices/Slices.ts +69 -2
@@ -1,5 +1,5 @@
1
1
  import type { RepeatableContent, SharedSliceItemContent, SliceItemContent, WidgetContent } from "../content";
2
- import type { CompositeSlice, Group, NestableWidget, StaticSlices, UID, VariationFields } from "../customtypes";
2
+ import type { CompositeSlice, Group, NestableWidget, NestedGroup, StaticSlices, UID, VariationFields } from "../customtypes";
3
3
  export declare type TraverseSliceContentFn = <S extends SliceItemContent | SharedSliceItemContent, D extends VariationFields | CompositeSlice | Group | NestableWidget>({ path, key, apiId, model, content, }: {
4
4
  path: ContentPath;
5
5
  key: string;
@@ -29,3 +29,8 @@ export declare const ContentPath: {
29
29
  }>): ContentPath;
30
30
  };
31
31
  export declare type SliceModel = VariationFields | NestableWidget | CompositeSlice | Group;
32
+ export declare type OnFieldFn<T extends UID | NestableWidget | Group | NestedGroup> = (args: {
33
+ path: ReadonlyArray<string>;
34
+ key: string;
35
+ field: T;
36
+ }) => T;
@@ -4626,7 +4626,7 @@ declare function parseLegacyDocument(legacyDoc: unknown, customType: StaticCusto
4626
4626
  }): Document | undefined;
4627
4627
  declare function encodeToLegacyDocument(document: Document): DocumentLegacy;
4628
4628
  export declare const DocumentLegacy: {
4629
- _codec: (allTypes?: Map<string, "Boolean" | "Color" | "Date" | "Embed" | "GeoPoint" | "Image" | "IntegrationFields" | "Link" | "Number" | "Range" | "StructuredText" | "Select" | "Separator" | "Table" | "Text" | "Timestamp" | "Group" | "Slice" | "SharedSlice" | "Choice" | "Slices" | "UID" | "Repeatable.Link"> | undefined) => t.Type<{
4629
+ _codec: (allTypes?: Map<string, "Boolean" | "Color" | "Date" | "Embed" | "GeoPoint" | "Image" | "IntegrationFields" | "Link" | "Number" | "Range" | "StructuredText" | "Select" | "Separator" | "Table" | "Text" | "Timestamp" | "Group" | "UID" | "Slice" | "SharedSlice" | "Choice" | "Slices" | "Repeatable.Link"> | undefined) => t.Type<{
4630
4630
  [x: string]: {
4631
4631
  type: string;
4632
4632
  __TYPE__: "EmptyContent";