@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.
- package/lib/_internal/utils.d.ts +6 -1
- package/lib/content/Document.d.ts +1 -1
- package/lib/customtypes/CustomType.d.ts +402 -162
- package/lib/customtypes/CustomType.js +16 -1
- package/lib/customtypes/Section.d.ts +403 -162
- package/lib/customtypes/Section.js +40 -1
- package/lib/customtypes/diff/SharedSlice.d.ts +168 -64
- package/lib/customtypes/diff/Variation.d.ts +168 -64
- package/lib/customtypes/widgets/Group.d.ts +258 -90
- package/lib/customtypes/widgets/Group.js +62 -1
- package/lib/customtypes/widgets/Widget.d.ts +621 -231
- package/lib/customtypes/widgets/nestable/Link.d.ts +82 -30
- package/lib/customtypes/widgets/nestable/Link.js +43 -19
- package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +41 -15
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +89 -30
- package/lib/customtypes/widgets/slices/CompositeSlice.js +26 -1
- package/lib/customtypes/widgets/slices/LegacySlice.d.ts +82 -30
- package/lib/customtypes/widgets/slices/SharedSlice.d.ts +341 -120
- package/lib/customtypes/widgets/slices/SharedSlice.js +59 -1
- package/lib/customtypes/widgets/slices/SlicePrimaryWidget.d.ts +186 -69
- package/lib/customtypes/widgets/slices/Slices.d.ts +836 -308
- package/lib/customtypes/widgets/slices/Slices.js +61 -1
- package/package.json +1 -1
- package/src/_internal/utils.ts +4 -0
- package/src/customtypes/CustomType.ts +30 -1
- package/src/customtypes/Section.ts +53 -0
- package/src/customtypes/widgets/Group.ts +75 -0
- package/src/customtypes/widgets/nestable/Link.ts +85 -24
- package/src/customtypes/widgets/slices/CompositeSlice.ts +38 -0
- package/src/customtypes/widgets/slices/SharedSlice.ts +71 -0
- package/src/customtypes/widgets/slices/Slices.ts +69 -2
package/lib/_internal/utils.d.ts
CHANGED
|
@@ -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" | "
|
|
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";
|