@prismicio/types-internal 1.5.2 → 2.0.0-alpha.0
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/common/WidgetKey.d.ts +3 -0
- package/lib/common/WidgetKey.js +8 -0
- package/lib/common/index.d.ts +1 -0
- package/lib/common/index.js +4 -0
- package/lib/content/Document.d.ts +4285 -2573
- package/lib/content/Document.js +87 -10
- package/lib/content/LegacyContentCtx.d.ts +41 -0
- package/lib/content/LegacyContentCtx.js +65 -0
- package/lib/content/fields/EmptyContent.d.ts +16 -0
- package/lib/content/fields/EmptyContent.js +30 -0
- package/lib/content/fields/GroupContent.d.ts +1063 -364
- package/lib/content/fields/GroupContent.js +65 -6
- package/lib/content/fields/UIDContent.d.ts +10 -1
- package/lib/content/fields/UIDContent.js +17 -4
- package/lib/content/fields/WidgetContent.d.ts +6820 -0
- package/lib/content/fields/WidgetContent.js +57 -0
- package/lib/content/fields/index.d.ts +1 -2989
- package/lib/content/fields/index.js +1 -18
- package/lib/content/fields/nestable/BooleanContent.d.ts +10 -1
- package/lib/content/fields/nestable/BooleanContent.js +17 -4
- package/lib/content/fields/nestable/EmbedContent.d.ts +56 -5
- package/lib/content/fields/nestable/EmbedContent.js +57 -6
- package/lib/content/fields/nestable/FieldContent/ColorContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/ColorContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/DateContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/DateContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/NumberContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/NumberContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/RangeContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/RangeContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/SelectContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/SelectContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/TextContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/TextContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/TimestampContent.d.ts +18 -0
- package/lib/content/fields/nestable/FieldContent/TimestampContent.js +34 -0
- package/lib/content/fields/nestable/FieldContent/common.d.ts +1 -0
- package/lib/content/fields/nestable/FieldContent/common.js +4 -0
- package/lib/content/fields/nestable/FieldContent/index.d.ts +49 -0
- package/lib/content/fields/nestable/FieldContent/index.js +38 -0
- package/lib/content/fields/nestable/FieldContent.d.ts +7 -1
- package/lib/content/fields/nestable/FieldContent.js +19 -4
- package/lib/content/fields/nestable/GeoPointContent.d.ts +19 -4
- package/lib/content/fields/nestable/GeoPointContent.js +22 -5
- package/lib/content/fields/nestable/ImageContent.d.ts +109 -11
- package/lib/content/fields/nestable/ImageContent.js +64 -6
- package/lib/content/fields/nestable/IntegrationFieldContent.d.ts +10 -1
- package/lib/content/fields/nestable/IntegrationFieldContent.js +20 -4
- package/lib/content/fields/nestable/LinkContent.d.ts +240 -87
- package/lib/content/fields/nestable/LinkContent.js +133 -36
- package/lib/content/fields/nestable/NestableContent.d.ts +711 -251
- package/lib/content/fields/nestable/NestableContent.js +116 -13
- package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +594 -0
- package/lib/content/fields/nestable/RichTextContent/Blocks.js +151 -0
- package/lib/content/fields/nestable/RichTextContent/index.d.ts +489 -0
- package/lib/content/fields/nestable/RichTextContent/index.js +27 -0
- package/lib/content/fields/nestable/SeparatorContent.d.ts +8 -1
- package/lib/content/fields/nestable/SeparatorContent.js +15 -4
- package/lib/content/fields/slices/CompositeSliceContent.d.ts +296 -362
- package/lib/content/fields/slices/RepeatableContent.d.ts +148 -181
- package/lib/content/fields/slices/SharedSliceContent.d.ts +296 -362
- package/lib/content/fields/slices/SimpleSliceContent.d.ts +296 -362
- package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +1709 -0
- package/lib/content/fields/slices/Slice/CompositeSliceContent.js +81 -0
- package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +582 -0
- package/lib/content/fields/slices/Slice/RepeatableContent.js +18 -0
- package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +1713 -0
- package/lib/content/fields/slices/Slice/SharedSliceContent.js +98 -0
- package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +1429 -0
- package/lib/content/fields/slices/Slice/SimpleSliceContent.js +24 -0
- package/lib/content/fields/slices/Slice/index.d.ts +3216 -0
- package/lib/content/fields/slices/Slice/index.js +41 -0
- package/lib/content/fields/slices/SliceItem.d.ts +3498 -0
- package/lib/content/fields/slices/SliceItem.js +61 -0
- package/lib/content/fields/slices/SlicesContent.d.ts +4243 -3576
- package/lib/content/fields/slices/SlicesContent.js +28 -18
- package/lib/content/fields/slices/index.d.ts +4 -3
- package/lib/content/fields/slices/index.js +4 -3
- package/lib/content/index.d.ts +1 -0
- package/lib/content/index.js +1 -0
- package/lib/content/utils.d.ts +10 -0
- package/lib/content/utils.js +19 -0
- package/lib/customtypes/CustomType.d.ts +366 -366
- package/lib/customtypes/CustomType.js +4 -7
- package/lib/customtypes/Section.d.ts +366 -366
- package/lib/customtypes/Section.js +2 -2
- package/lib/customtypes/diff/SharedSlice.d.ts +6 -7
- package/lib/customtypes/diff/Variation.d.ts +10 -7
- package/lib/customtypes/widgets/Group.d.ts +1 -0
- package/lib/customtypes/widgets/Group.js +6 -5
- package/lib/customtypes/widgets/UID.d.ts +1 -0
- package/lib/customtypes/widgets/UID.js +3 -2
- package/lib/customtypes/widgets/Widget.d.ts +384 -362
- package/lib/customtypes/widgets/Widget.js +29 -8
- package/lib/customtypes/widgets/index.d.ts +6 -7
- package/lib/customtypes/widgets/index.js +6 -11
- package/lib/customtypes/widgets/nestable/BooleanField.d.ts +10 -3
- package/lib/customtypes/widgets/nestable/BooleanField.js +6 -6
- package/lib/customtypes/widgets/nestable/Color.d.ts +8 -3
- package/lib/customtypes/widgets/nestable/Color.js +6 -6
- package/lib/customtypes/widgets/nestable/Date.d.ts +9 -3
- package/lib/customtypes/widgets/nestable/Date.js +6 -6
- package/lib/customtypes/widgets/nestable/Embed.d.ts +9 -3
- package/lib/customtypes/widgets/nestable/Embed.js +6 -6
- package/lib/customtypes/widgets/nestable/GeoPoint.d.ts +7 -3
- package/lib/customtypes/widgets/nestable/GeoPoint.js +6 -6
- package/lib/customtypes/widgets/nestable/Image.d.ts +25 -3
- package/lib/customtypes/widgets/nestable/Image.js +8 -8
- package/lib/customtypes/widgets/nestable/IntegrationField.d.ts +9 -3
- package/lib/customtypes/widgets/nestable/IntegrationField.js +6 -6
- package/lib/customtypes/widgets/nestable/Link.d.ts +14 -2
- package/lib/customtypes/widgets/nestable/Link.js +7 -6
- package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +3 -3
- package/lib/customtypes/widgets/nestable/NestableWidget.js +30 -30
- package/lib/customtypes/widgets/nestable/Number.d.ts +11 -3
- package/lib/customtypes/widgets/nestable/Number.js +6 -6
- package/lib/customtypes/widgets/nestable/Range.d.ts +11 -3
- package/lib/customtypes/widgets/nestable/Range.js +6 -6
- package/lib/customtypes/widgets/nestable/RichText.d.ts +1 -0
- package/lib/customtypes/widgets/nestable/RichText.js +3 -3
- package/lib/customtypes/widgets/nestable/Select.d.ts +10 -3
- package/lib/customtypes/widgets/nestable/Select.js +6 -6
- package/lib/customtypes/widgets/nestable/Separator.d.ts +7 -3
- package/lib/customtypes/widgets/nestable/Separator.js +6 -6
- package/lib/customtypes/widgets/nestable/Text.d.ts +9 -2
- package/lib/customtypes/widgets/nestable/Text.js +7 -6
- package/lib/customtypes/widgets/nestable/Timestamp.d.ts +9 -3
- package/lib/customtypes/widgets/nestable/Timestamp.js +6 -6
- package/lib/customtypes/widgets/nestable/index.d.ts +15 -15
- package/lib/customtypes/widgets/nestable/index.js +15 -31
- package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +1 -0
- package/lib/customtypes/widgets/slices/CompositeSlice.js +7 -6
- package/lib/customtypes/widgets/slices/LegacySlice.js +2 -2
- package/lib/customtypes/widgets/slices/SharedSlice.d.ts +1 -0
- package/lib/customtypes/widgets/slices/SharedSlice.js +7 -7
- package/lib/customtypes/widgets/slices/SharedSliceRef.js +2 -2
- package/lib/customtypes/widgets/slices/Slices.d.ts +364 -362
- package/lib/customtypes/widgets/slices/Slices.js +8 -8
- package/lib/customtypes/widgets/slices/SlicesTypes.d.ts +6 -5
- package/lib/customtypes/widgets/slices/SlicesTypes.js +8 -4
- package/lib/documents/DocumentData.d.ts +3 -14
- package/lib/documents/DocumentData.js +5 -60
- package/lib/documents/widgets/nestable/ImageContent.d.ts +1 -1
- package/lib/documents/widgets/nestable/ImageContent.js +2 -2
- package/lib/utils/Objects.d.ts +1 -0
- package/lib/utils/Objects.js +10 -1
- package/package.json +1 -1
- package/src/common/WidgetKey.ts +13 -0
- package/src/common/index.ts +1 -0
- package/src/content/Document.ts +129 -16
- package/src/content/LegacyContentCtx.ts +57 -0
- package/src/content/fields/EmptyContent.ts +45 -0
- package/src/content/fields/GroupContent.ts +103 -8
- package/src/content/fields/UIDContent.ts +33 -3
- package/src/content/fields/WidgetContent.ts +76 -0
- package/src/content/fields/index.ts +1 -23
- package/src/content/fields/nestable/BooleanContent.ts +32 -3
- package/src/content/fields/nestable/EmbedContent.ts +79 -8
- package/src/content/fields/nestable/FieldContent/ColorContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/DateContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/NumberContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/RangeContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/SelectContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/TextContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/TimestampContent.ts +48 -0
- package/src/content/fields/nestable/FieldContent/common.ts +1 -0
- package/src/content/fields/nestable/FieldContent/index.ts +40 -0
- package/src/content/fields/nestable/GeoPointContent.ts +38 -7
- package/src/content/fields/nestable/ImageContent.ts +91 -11
- package/src/content/fields/nestable/IntegrationFieldContent.ts +42 -3
- package/src/content/fields/nestable/LinkContent.ts +208 -47
- package/src/content/fields/nestable/NestableContent.ts +180 -24
- package/src/content/fields/nestable/RichTextContent/Blocks.ts +205 -0
- package/src/content/fields/nestable/RichTextContent/index.ts +43 -0
- package/src/content/fields/nestable/SeparatorContent.ts +26 -3
- package/src/content/fields/slices/Slice/CompositeSliceContent.ts +118 -0
- package/src/content/fields/slices/{RepeatableContent.ts → Slice/RepeatableContent.ts} +7 -4
- package/src/content/fields/slices/Slice/SharedSliceContent.ts +129 -0
- package/src/content/fields/slices/Slice/SimpleSliceContent.ts +30 -0
- package/src/content/fields/slices/Slice/index.ts +47 -0
- package/src/content/fields/slices/SliceItem.ts +83 -0
- package/src/content/fields/slices/SlicesContent.ts +47 -19
- package/src/content/fields/slices/index.ts +4 -3
- package/src/content/index.ts +1 -0
- package/src/content/utils.ts +20 -0
- package/src/customtypes/CustomType.ts +4 -10
- package/src/customtypes/Section.ts +1 -1
- package/src/customtypes/diff/SharedSlice.ts +2 -2
- package/src/customtypes/diff/Variation.ts +8 -2
- package/src/customtypes/widgets/Group.ts +4 -4
- package/src/customtypes/widgets/UID.ts +3 -2
- package/src/customtypes/widgets/Widget.ts +53 -7
- package/src/customtypes/widgets/index.ts +6 -7
- package/src/customtypes/widgets/nestable/BooleanField.ts +7 -8
- package/src/customtypes/widgets/nestable/Color.ts +6 -8
- package/src/customtypes/widgets/nestable/Date.ts +7 -8
- package/src/customtypes/widgets/nestable/Embed.ts +7 -8
- package/src/customtypes/widgets/nestable/GeoPoint.ts +7 -8
- package/src/customtypes/widgets/nestable/Image.ts +9 -10
- package/src/customtypes/widgets/nestable/IntegrationField.ts +6 -8
- package/src/customtypes/widgets/nestable/Link.ts +7 -6
- package/src/customtypes/widgets/nestable/NestableWidget.ts +17 -18
- package/src/customtypes/widgets/nestable/Number.ts +7 -8
- package/src/customtypes/widgets/nestable/Range.ts +7 -8
- package/src/customtypes/widgets/nestable/RichText.ts +3 -2
- package/src/customtypes/widgets/nestable/Select.ts +7 -8
- package/src/customtypes/widgets/nestable/Separator.ts +7 -8
- package/src/customtypes/widgets/nestable/Text.ts +7 -6
- package/src/customtypes/widgets/nestable/Timestamp.ts +7 -8
- package/src/customtypes/widgets/nestable/index.ts +15 -15
- package/src/customtypes/widgets/slices/CompositeSlice.ts +5 -4
- package/src/customtypes/widgets/slices/LegacySlice.ts +1 -1
- package/src/customtypes/widgets/slices/SharedSlice.ts +5 -4
- package/src/customtypes/widgets/slices/SharedSliceRef.ts +2 -2
- package/src/customtypes/widgets/slices/Slices.ts +7 -6
- package/src/customtypes/widgets/slices/SlicesTypes.ts +10 -5
- package/src/utils/Objects.ts +12 -0
- package/src/content/fields/nestable/FieldContent.ts +0 -25
- package/src/content/fields/nestable/RichTextContent.ts +0 -32
- package/src/content/fields/slices/CompositeSliceContent.ts +0 -14
- package/src/content/fields/slices/SharedSliceContent.ts +0 -14
- package/src/content/fields/slices/SimpleSliceContent.ts +0 -7
- package/src/customtypes/widgets/WidgetTypes.ts +0 -24
- package/src/documents/DocumentData.ts +0 -112
- package/src/documents/index.ts +0 -2
- package/src/documents/widgets/EmptyContent.ts +0 -8
- package/src/documents/widgets/GroupContent.ts +0 -91
- package/src/documents/widgets/SimpleWidgetContent.ts +0 -96
- package/src/documents/widgets/StaticWidgetContent.ts +0 -46
- package/src/documents/widgets/UIDContent.ts +0 -18
- package/src/documents/widgets/index.ts +0 -70
- package/src/documents/widgets/nestable/BooleanContent.ts +0 -21
- package/src/documents/widgets/nestable/EmbedContent.ts +0 -56
- package/src/documents/widgets/nestable/FieldContent.ts +0 -53
- package/src/documents/widgets/nestable/GeoPointContent.ts +0 -18
- package/src/documents/widgets/nestable/ImageContent.ts +0 -51
- package/src/documents/widgets/nestable/IntegrationFieldsContent.ts +0 -26
- package/src/documents/widgets/nestable/Link/DocumentLink.ts +0 -18
- package/src/documents/widgets/nestable/Link/ExternalLink.ts +0 -31
- package/src/documents/widgets/nestable/Link/FileLink.ts +0 -30
- package/src/documents/widgets/nestable/Link/ImageLink.ts +0 -31
- package/src/documents/widgets/nestable/Link/LinkContent.ts +0 -25
- package/src/documents/widgets/nestable/Link/index.ts +0 -35
- package/src/documents/widgets/nestable/SeparatorContent.ts +0 -13
- package/src/documents/widgets/nestable/StructuredTextContent/Block.ts +0 -126
- package/src/documents/widgets/nestable/StructuredTextContent/index.ts +0 -25
- package/src/documents/widgets/nestable/index.ts +0 -35
- package/src/documents/widgets/slices/CompositeSliceContent.ts +0 -77
- package/src/documents/widgets/slices/SharedSliceContent.ts +0 -94
- package/src/documents/widgets/slices/SimpleSliceContent.ts +0 -4
- package/src/documents/widgets/slices/SliceWidgetContent.ts +0 -51
- package/src/documents/widgets/slices/SlicesContent.ts +0 -91
- package/src/documents/widgets/slices/index.ts +0 -5
- package/src/index.ts +0 -3
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
3
|
import { StringOrNull } from "../../../validators"
|
|
4
|
-
import { WidgetTypes } from "../WidgetTypes"
|
|
5
4
|
|
|
6
|
-
const
|
|
5
|
+
export const ColorFieldType = "Color"
|
|
6
|
+
export const ColorConfig = t.exact(
|
|
7
7
|
t.partial({
|
|
8
8
|
label: StringOrNull,
|
|
9
9
|
placeholder: t.string,
|
|
10
10
|
}),
|
|
11
11
|
)
|
|
12
|
-
type ColorConfig = t.TypeOf<typeof ColorConfig>
|
|
12
|
+
export type ColorConfig = t.TypeOf<typeof ColorConfig>
|
|
13
13
|
|
|
14
|
-
const Color = t.exact(
|
|
14
|
+
export const Color = t.exact(
|
|
15
15
|
t.intersection([
|
|
16
16
|
t.type({
|
|
17
|
-
type: t.literal(
|
|
17
|
+
type: t.literal(ColorFieldType),
|
|
18
18
|
}),
|
|
19
19
|
t.partial({
|
|
20
20
|
fieldset: StringOrNull,
|
|
@@ -22,6 +22,4 @@ const Color = t.exact(
|
|
|
22
22
|
}),
|
|
23
23
|
]),
|
|
24
24
|
)
|
|
25
|
-
type Color = t.TypeOf<typeof Color>
|
|
26
|
-
|
|
27
|
-
export default Color
|
|
25
|
+
export type Color = t.TypeOf<typeof Color>
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
3
|
import { StringOrNull } from "../../../validators"
|
|
4
|
-
import { WidgetTypes } from "../WidgetTypes"
|
|
5
4
|
|
|
6
|
-
const
|
|
5
|
+
export const DateFieldType = "Date"
|
|
6
|
+
|
|
7
|
+
export const DateConfig = t.exact(
|
|
7
8
|
t.partial({
|
|
8
9
|
label: StringOrNull,
|
|
9
10
|
placeholder: t.string,
|
|
10
11
|
default: t.string,
|
|
11
12
|
}),
|
|
12
13
|
)
|
|
13
|
-
type DateConfig = t.TypeOf<typeof DateConfig>
|
|
14
|
+
export type DateConfig = t.TypeOf<typeof DateConfig>
|
|
14
15
|
|
|
15
|
-
const Date = t.exact(
|
|
16
|
+
export const Date = t.exact(
|
|
16
17
|
t.intersection([
|
|
17
18
|
t.type({
|
|
18
|
-
type: t.literal(
|
|
19
|
+
type: t.literal(DateFieldType),
|
|
19
20
|
}),
|
|
20
21
|
t.partial({
|
|
21
22
|
fieldset: StringOrNull,
|
|
@@ -23,6 +24,4 @@ const Date = t.exact(
|
|
|
23
24
|
}),
|
|
24
25
|
]),
|
|
25
26
|
)
|
|
26
|
-
type Date = t.TypeOf<typeof Date>
|
|
27
|
-
|
|
28
|
-
export default Date
|
|
27
|
+
export type Date = t.TypeOf<typeof Date>
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
3
|
import { StringOrNull } from "../../../validators"
|
|
4
|
-
import { WidgetTypes } from "../WidgetTypes"
|
|
5
4
|
|
|
6
|
-
const
|
|
5
|
+
export const EmbedFieldType = "Embed"
|
|
6
|
+
|
|
7
|
+
export const EmbedConfig = t.exact(
|
|
7
8
|
t.partial({
|
|
8
9
|
label: StringOrNull,
|
|
9
10
|
placeholder: t.string,
|
|
10
11
|
useAsTitle: t.boolean,
|
|
11
12
|
}),
|
|
12
13
|
)
|
|
13
|
-
type EmbedConfig = t.TypeOf<typeof EmbedConfig>
|
|
14
|
+
export type EmbedConfig = t.TypeOf<typeof EmbedConfig>
|
|
14
15
|
|
|
15
|
-
const Embed = t.exact(
|
|
16
|
+
export const Embed = t.exact(
|
|
16
17
|
t.intersection([
|
|
17
18
|
t.type({
|
|
18
|
-
type: t.literal(
|
|
19
|
+
type: t.literal(EmbedFieldType),
|
|
19
20
|
}),
|
|
20
21
|
t.partial({
|
|
21
22
|
fieldset: StringOrNull,
|
|
@@ -23,6 +24,4 @@ const Embed = t.exact(
|
|
|
23
24
|
}),
|
|
24
25
|
]),
|
|
25
26
|
)
|
|
26
|
-
type Embed = t.TypeOf<typeof Embed>
|
|
27
|
-
|
|
28
|
-
export default Embed
|
|
27
|
+
export type Embed = t.TypeOf<typeof Embed>
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
3
|
import { StringOrNull } from "../../../validators"
|
|
4
|
-
import { WidgetTypes } from "../WidgetTypes"
|
|
5
4
|
|
|
6
|
-
const
|
|
5
|
+
export const GeoPointFieldType = "GeoPoint"
|
|
6
|
+
|
|
7
|
+
export const GeoPointConfig = t.exact(
|
|
7
8
|
t.partial({
|
|
8
9
|
label: StringOrNull,
|
|
9
10
|
}),
|
|
10
11
|
)
|
|
11
|
-
type GeoPointConfig = t.TypeOf<typeof GeoPointConfig>
|
|
12
|
+
export type GeoPointConfig = t.TypeOf<typeof GeoPointConfig>
|
|
12
13
|
|
|
13
|
-
const GeoPoint = t.exact(
|
|
14
|
+
export const GeoPoint = t.exact(
|
|
14
15
|
t.intersection([
|
|
15
16
|
t.type({
|
|
16
|
-
type: t.literal(
|
|
17
|
+
type: t.literal(GeoPointFieldType),
|
|
17
18
|
}),
|
|
18
19
|
t.partial({
|
|
19
20
|
fieldset: StringOrNull,
|
|
@@ -21,6 +22,4 @@ const GeoPoint = t.exact(
|
|
|
21
22
|
}),
|
|
22
23
|
]),
|
|
23
24
|
)
|
|
24
|
-
type GeoPoint = t.TypeOf<typeof GeoPoint>
|
|
25
|
-
|
|
26
|
-
export default GeoPoint
|
|
25
|
+
export type GeoPoint = t.TypeOf<typeof GeoPoint>
|
|
@@ -2,9 +2,10 @@ import * as t from "io-ts"
|
|
|
2
2
|
|
|
3
3
|
import { StringOrNull } from "../../../validators"
|
|
4
4
|
import ImageConstraint from "../shared/ImageConstraint"
|
|
5
|
-
import { WidgetTypes } from "../WidgetTypes"
|
|
6
5
|
|
|
7
|
-
const
|
|
6
|
+
export const ImageFieldType = "Image"
|
|
7
|
+
|
|
8
|
+
export const Thumbnail = t.exact(
|
|
8
9
|
t.intersection([
|
|
9
10
|
t.type({
|
|
10
11
|
name: t.string,
|
|
@@ -12,9 +13,9 @@ const Thumbnail = t.exact(
|
|
|
12
13
|
ImageConstraint,
|
|
13
14
|
]),
|
|
14
15
|
)
|
|
15
|
-
type Thumbnail = t.TypeOf<typeof Thumbnail>
|
|
16
|
+
export type Thumbnail = t.TypeOf<typeof Thumbnail>
|
|
16
17
|
|
|
17
|
-
const ImageConfig = t.exact(
|
|
18
|
+
export const ImageConfig = t.exact(
|
|
18
19
|
t.partial({
|
|
19
20
|
label: StringOrNull,
|
|
20
21
|
placeholder: t.string,
|
|
@@ -22,12 +23,12 @@ const ImageConfig = t.exact(
|
|
|
22
23
|
thumbnails: t.readonlyArray(Thumbnail),
|
|
23
24
|
}),
|
|
24
25
|
)
|
|
25
|
-
type ImageConfig = t.TypeOf<typeof ImageConfig>
|
|
26
|
+
export type ImageConfig = t.TypeOf<typeof ImageConfig>
|
|
26
27
|
|
|
27
|
-
const Image = t.exact(
|
|
28
|
+
export const Image = t.exact(
|
|
28
29
|
t.intersection([
|
|
29
30
|
t.type({
|
|
30
|
-
type: t.literal(
|
|
31
|
+
type: t.literal(ImageFieldType),
|
|
31
32
|
}),
|
|
32
33
|
t.partial({
|
|
33
34
|
fieldset: StringOrNull,
|
|
@@ -35,6 +36,4 @@ const Image = t.exact(
|
|
|
35
36
|
}),
|
|
36
37
|
]),
|
|
37
38
|
)
|
|
38
|
-
type Image = t.TypeOf<typeof Image>
|
|
39
|
-
|
|
40
|
-
export default Image
|
|
39
|
+
export type Image = t.TypeOf<typeof Image>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
3
|
import { StringOrNull } from "../../../validators"
|
|
4
|
-
import { WidgetTypes } from "../WidgetTypes"
|
|
5
4
|
|
|
6
|
-
const
|
|
5
|
+
export const IntegrationFieldType = "IntegrationFields"
|
|
6
|
+
export const IntegrationFieldConfig = t.exact(
|
|
7
7
|
t.partial({
|
|
8
8
|
label: StringOrNull,
|
|
9
9
|
placeholder: t.string,
|
|
10
10
|
catalog: t.string,
|
|
11
11
|
}),
|
|
12
12
|
)
|
|
13
|
-
type IntegrationFieldConfig = t.TypeOf<typeof IntegrationFieldConfig>
|
|
13
|
+
export type IntegrationFieldConfig = t.TypeOf<typeof IntegrationFieldConfig>
|
|
14
14
|
|
|
15
|
-
const IntegrationField = t.exact(
|
|
15
|
+
export const IntegrationField = t.exact(
|
|
16
16
|
t.intersection([
|
|
17
17
|
t.type({
|
|
18
|
-
type: t.literal(
|
|
18
|
+
type: t.literal(IntegrationFieldType),
|
|
19
19
|
}),
|
|
20
20
|
t.partial({
|
|
21
21
|
fieldset: StringOrNull,
|
|
@@ -23,6 +23,4 @@ const IntegrationField = t.exact(
|
|
|
23
23
|
}),
|
|
24
24
|
]),
|
|
25
25
|
)
|
|
26
|
-
type IntegrationField = t.TypeOf<typeof IntegrationField>
|
|
27
|
-
|
|
28
|
-
export default IntegrationField
|
|
26
|
+
export type IntegrationField = t.TypeOf<typeof IntegrationField>
|
|
@@ -3,7 +3,6 @@ import * as t from "io-ts"
|
|
|
3
3
|
import { withFallback } from "io-ts-types/lib/withFallback"
|
|
4
4
|
|
|
5
5
|
import { StringOrNull } from "../../../validators"
|
|
6
|
-
import { WidgetTypes } from "../WidgetTypes"
|
|
7
6
|
|
|
8
7
|
const arrayString = (
|
|
9
8
|
entries:
|
|
@@ -59,7 +58,9 @@ const MasksArrayString = new t.Type<ReadonlyArray<string>, object, unknown>(
|
|
|
59
58
|
(res) => res,
|
|
60
59
|
)
|
|
61
60
|
|
|
62
|
-
const
|
|
61
|
+
export const LinkFieldType = "Link"
|
|
62
|
+
|
|
63
|
+
export const LinkConfig = t.exact(
|
|
63
64
|
t.partial({
|
|
64
65
|
label: StringOrNull,
|
|
65
66
|
useAsTitle: t.boolean,
|
|
@@ -79,12 +80,12 @@ const LinkConfig = t.exact(
|
|
|
79
80
|
allowTargetBlank: t.boolean,
|
|
80
81
|
}),
|
|
81
82
|
)
|
|
82
|
-
type LinkConfig = t.TypeOf<typeof LinkConfig>
|
|
83
|
+
export type LinkConfig = t.TypeOf<typeof LinkConfig>
|
|
83
84
|
|
|
84
|
-
const Link = t.exact(
|
|
85
|
+
export const Link = t.exact(
|
|
85
86
|
t.intersection([
|
|
86
87
|
t.type({
|
|
87
|
-
type: t.literal(
|
|
88
|
+
type: t.literal(LinkFieldType),
|
|
88
89
|
}),
|
|
89
90
|
t.partial({
|
|
90
91
|
fieldset: StringOrNull,
|
|
@@ -92,6 +93,6 @@ const Link = t.exact(
|
|
|
92
93
|
}),
|
|
93
94
|
]),
|
|
94
95
|
)
|
|
95
|
-
type Link = t.TypeOf<typeof Link>
|
|
96
|
+
export type Link = t.TypeOf<typeof Link>
|
|
96
97
|
|
|
97
98
|
export default Link
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
|
-
import BooleanField from "./BooleanField"
|
|
4
|
-
import Color from "./Color"
|
|
5
|
-
import Date from "./Date"
|
|
6
|
-
import Embed from "./Embed"
|
|
7
|
-
import GeoPoint from "./GeoPoint"
|
|
8
|
-
import Image from "./Image"
|
|
9
|
-
import IntegrationField from "./IntegrationField"
|
|
10
|
-
import Link from "./Link"
|
|
11
|
-
import Number from "./Number"
|
|
12
|
-
import Range from "./Range"
|
|
3
|
+
import { BooleanField } from "./BooleanField"
|
|
4
|
+
import { Color } from "./Color"
|
|
5
|
+
import { Date } from "./Date"
|
|
6
|
+
import { Embed } from "./Embed"
|
|
7
|
+
import { GeoPoint } from "./GeoPoint"
|
|
8
|
+
import { Image } from "./Image"
|
|
9
|
+
import { IntegrationField } from "./IntegrationField"
|
|
10
|
+
import { Link } from "./Link"
|
|
11
|
+
import { Number } from "./Number"
|
|
12
|
+
import { Range } from "./Range"
|
|
13
13
|
import { RichText } from "./RichText"
|
|
14
|
-
import Select from "./Select"
|
|
15
|
-
import Separator from "./Separator"
|
|
16
|
-
import Text from "./Text"
|
|
17
|
-
import Timestamp from "./Timestamp"
|
|
14
|
+
import { Select } from "./Select"
|
|
15
|
+
import { Separator } from "./Separator"
|
|
16
|
+
import { Text } from "./Text"
|
|
17
|
+
import { Timestamp } from "./Timestamp"
|
|
18
18
|
|
|
19
|
-
const NestableWidget = t.union([
|
|
19
|
+
export const NestableWidget = t.union([
|
|
20
20
|
Color,
|
|
21
21
|
BooleanField,
|
|
22
22
|
Embed,
|
|
@@ -34,6 +34,5 @@ const NestableWidget = t.union([
|
|
|
34
34
|
IntegrationField,
|
|
35
35
|
])
|
|
36
36
|
|
|
37
|
-
type NestableWidget = t.TypeOf<typeof NestableWidget>
|
|
38
|
-
|
|
39
|
-
export default NestableWidget
|
|
37
|
+
export type NestableWidget = t.TypeOf<typeof NestableWidget>
|
|
38
|
+
export type NestableFieldTypes = NestableWidget["type"]
|
|
@@ -2,9 +2,10 @@ import * as t from "io-ts"
|
|
|
2
2
|
import { NumberFromString } from "io-ts-types/lib/NumberFromString"
|
|
3
3
|
|
|
4
4
|
import { StringOrNull } from "../../../validators"
|
|
5
|
-
import { WidgetTypes } from "../WidgetTypes"
|
|
6
5
|
|
|
7
|
-
const
|
|
6
|
+
export const NumberFieldType = "Number"
|
|
7
|
+
|
|
8
|
+
export const NumberConfig = t.exact(
|
|
8
9
|
t.partial({
|
|
9
10
|
label: StringOrNull,
|
|
10
11
|
placeholder: t.string,
|
|
@@ -13,12 +14,12 @@ const NumberConfig = t.exact(
|
|
|
13
14
|
step: t.union([t.number, NumberFromString]),
|
|
14
15
|
}),
|
|
15
16
|
)
|
|
16
|
-
type NumberConfig = t.TypeOf<typeof NumberConfig>
|
|
17
|
+
export type NumberConfig = t.TypeOf<typeof NumberConfig>
|
|
17
18
|
|
|
18
|
-
const Number = t.exact(
|
|
19
|
+
export const Number = t.exact(
|
|
19
20
|
t.intersection([
|
|
20
21
|
t.type({
|
|
21
|
-
type: t.literal(
|
|
22
|
+
type: t.literal(NumberFieldType),
|
|
22
23
|
}),
|
|
23
24
|
t.partial({
|
|
24
25
|
fieldset: StringOrNull,
|
|
@@ -26,6 +27,4 @@ const Number = t.exact(
|
|
|
26
27
|
}),
|
|
27
28
|
]),
|
|
28
29
|
)
|
|
29
|
-
type Number = t.TypeOf<typeof Number>
|
|
30
|
-
|
|
31
|
-
export default Number
|
|
30
|
+
export type Number = t.TypeOf<typeof Number>
|
|
@@ -2,9 +2,10 @@ import * as t from "io-ts"
|
|
|
2
2
|
import { NumberFromString } from "io-ts-types/lib/NumberFromString"
|
|
3
3
|
|
|
4
4
|
import { StringOrNull } from "../../../validators"
|
|
5
|
-
import { WidgetTypes } from "../WidgetTypes"
|
|
6
5
|
|
|
7
|
-
const
|
|
6
|
+
export const RangeFieldType = "Range"
|
|
7
|
+
|
|
8
|
+
export const RangeConfig = t.exact(
|
|
8
9
|
t.partial({
|
|
9
10
|
label: StringOrNull,
|
|
10
11
|
placeholder: t.string,
|
|
@@ -13,12 +14,12 @@ const RangeConfig = t.exact(
|
|
|
13
14
|
step: t.union([t.number, NumberFromString]),
|
|
14
15
|
}),
|
|
15
16
|
)
|
|
16
|
-
type RangeConfig = t.TypeOf<typeof RangeConfig>
|
|
17
|
+
export type RangeConfig = t.TypeOf<typeof RangeConfig>
|
|
17
18
|
|
|
18
|
-
const Range = t.exact(
|
|
19
|
+
export const Range = t.exact(
|
|
19
20
|
t.intersection([
|
|
20
21
|
t.type({
|
|
21
|
-
type: t.literal(
|
|
22
|
+
type: t.literal(RangeFieldType),
|
|
22
23
|
}),
|
|
23
24
|
t.partial({
|
|
24
25
|
fieldset: StringOrNull,
|
|
@@ -26,6 +27,4 @@ const Range = t.exact(
|
|
|
26
27
|
}),
|
|
27
28
|
]),
|
|
28
29
|
)
|
|
29
|
-
type Range = t.TypeOf<typeof Range>
|
|
30
|
-
|
|
31
|
-
export default Range
|
|
30
|
+
export type Range = t.TypeOf<typeof Range>
|
|
@@ -3,7 +3,8 @@ import * as t from "io-ts"
|
|
|
3
3
|
|
|
4
4
|
import { StringOrNull } from "../../../validators"
|
|
5
5
|
import ImageConstraint from "../shared/ImageConstraint"
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
export const RichTextFieldType = "StructuredText"
|
|
7
8
|
|
|
8
9
|
export const DEFAULT_OPTION = "paragraph"
|
|
9
10
|
|
|
@@ -203,7 +204,7 @@ export type RichTextConfig = t.TypeOf<typeof RichTextConfig>
|
|
|
203
204
|
export const RichText = t.exact(
|
|
204
205
|
t.intersection([
|
|
205
206
|
t.type({
|
|
206
|
-
type: t.literal(
|
|
207
|
+
type: t.literal(RichTextFieldType),
|
|
207
208
|
}),
|
|
208
209
|
t.partial({
|
|
209
210
|
fieldset: StringOrNull,
|
|
@@ -5,9 +5,10 @@ import {
|
|
|
5
5
|
StringFromNumber,
|
|
6
6
|
StringOrNull,
|
|
7
7
|
} from "../../../validators"
|
|
8
|
-
import { WidgetTypes } from "../WidgetTypes"
|
|
9
8
|
|
|
10
|
-
const
|
|
9
|
+
export const SelectFieldType = "Select"
|
|
10
|
+
|
|
11
|
+
export const SelectConfig = t.exact(
|
|
11
12
|
t.partial({
|
|
12
13
|
label: StringOrNull,
|
|
13
14
|
placeholder: t.string,
|
|
@@ -17,12 +18,12 @@ const SelectConfig = t.exact(
|
|
|
17
18
|
),
|
|
18
19
|
}),
|
|
19
20
|
)
|
|
20
|
-
type SelectConfig = t.TypeOf<typeof SelectConfig>
|
|
21
|
+
export type SelectConfig = t.TypeOf<typeof SelectConfig>
|
|
21
22
|
|
|
22
|
-
const Select = t.exact(
|
|
23
|
+
export const Select = t.exact(
|
|
23
24
|
t.intersection([
|
|
24
25
|
t.type({
|
|
25
|
-
type: t.literal(
|
|
26
|
+
type: t.literal(SelectFieldType),
|
|
26
27
|
}),
|
|
27
28
|
t.partial({
|
|
28
29
|
fieldset: StringOrNull,
|
|
@@ -30,6 +31,4 @@ const Select = t.exact(
|
|
|
30
31
|
}),
|
|
31
32
|
]),
|
|
32
33
|
)
|
|
33
|
-
type Select = t.TypeOf<typeof Select>
|
|
34
|
-
|
|
35
|
-
export default Select
|
|
34
|
+
export type Select = t.TypeOf<typeof Select>
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
3
|
import { StringOrNull } from "../../../validators"
|
|
4
|
-
import { WidgetTypes } from "../WidgetTypes"
|
|
5
4
|
|
|
6
|
-
const
|
|
5
|
+
export const SeparatorFieldType = "Separator"
|
|
6
|
+
|
|
7
|
+
export const SeparatorConfig = t.exact(
|
|
7
8
|
t.partial({
|
|
8
9
|
label: StringOrNull,
|
|
9
10
|
}),
|
|
10
11
|
)
|
|
11
|
-
type SeparatorConfig = t.TypeOf<typeof SeparatorConfig>
|
|
12
|
+
export type SeparatorConfig = t.TypeOf<typeof SeparatorConfig>
|
|
12
13
|
|
|
13
|
-
const Separator = t.exact(
|
|
14
|
+
export const Separator = t.exact(
|
|
14
15
|
t.intersection([
|
|
15
16
|
t.type({
|
|
16
|
-
type: t.literal(
|
|
17
|
+
type: t.literal(SeparatorFieldType),
|
|
17
18
|
}),
|
|
18
19
|
t.partial({
|
|
19
20
|
config: SeparatorConfig,
|
|
20
21
|
}),
|
|
21
22
|
]),
|
|
22
23
|
)
|
|
23
|
-
type Separator = t.TypeOf<typeof Separator>
|
|
24
|
-
|
|
25
|
-
export default Separator
|
|
24
|
+
export type Separator = t.TypeOf<typeof Separator>
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
3
|
import { StringOrNull } from "../../../validators"
|
|
4
|
-
import { WidgetTypes } from "../WidgetTypes"
|
|
5
4
|
|
|
6
|
-
const
|
|
5
|
+
export const TextFieldType = "Text"
|
|
6
|
+
|
|
7
|
+
export const TextConfig = t.exact(
|
|
7
8
|
t.partial({
|
|
8
9
|
label: StringOrNull,
|
|
9
10
|
useAsTitle: t.boolean,
|
|
10
11
|
placeholder: t.string,
|
|
11
12
|
}),
|
|
12
13
|
)
|
|
13
|
-
type TextConfig = t.TypeOf<typeof TextConfig>
|
|
14
|
+
export type TextConfig = t.TypeOf<typeof TextConfig>
|
|
14
15
|
|
|
15
|
-
const Text = t.exact(
|
|
16
|
+
export const Text = t.exact(
|
|
16
17
|
t.intersection([
|
|
17
18
|
t.type({
|
|
18
|
-
type: t.literal(
|
|
19
|
+
type: t.literal(TextFieldType),
|
|
19
20
|
}),
|
|
20
21
|
t.partial({
|
|
21
22
|
fieldset: StringOrNull,
|
|
@@ -23,6 +24,6 @@ const Text = t.exact(
|
|
|
23
24
|
}),
|
|
24
25
|
]),
|
|
25
26
|
)
|
|
26
|
-
type Text = t.TypeOf<typeof Text>
|
|
27
|
+
export type Text = t.TypeOf<typeof Text>
|
|
27
28
|
|
|
28
29
|
export default Text
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
3
|
import { StringOrNull } from "../../../validators"
|
|
4
|
-
import { WidgetTypes } from "../WidgetTypes"
|
|
5
4
|
|
|
6
|
-
const
|
|
5
|
+
export const TimestampFieldType = "Timestamp"
|
|
6
|
+
|
|
7
|
+
export const TimestampConfig = t.exact(
|
|
7
8
|
t.partial({
|
|
8
9
|
label: StringOrNull,
|
|
9
10
|
placeholder: t.string,
|
|
10
11
|
default: t.string,
|
|
11
12
|
}),
|
|
12
13
|
)
|
|
13
|
-
type TimestampConfig = t.TypeOf<typeof TimestampConfig>
|
|
14
|
+
export type TimestampConfig = t.TypeOf<typeof TimestampConfig>
|
|
14
15
|
|
|
15
|
-
const Timestamp = t.exact(
|
|
16
|
+
export const Timestamp = t.exact(
|
|
16
17
|
t.intersection([
|
|
17
18
|
t.type({
|
|
18
|
-
type: t.literal(
|
|
19
|
+
type: t.literal(TimestampFieldType),
|
|
19
20
|
}),
|
|
20
21
|
t.partial({
|
|
21
22
|
fieldset: StringOrNull,
|
|
@@ -23,6 +24,4 @@ const Timestamp = t.exact(
|
|
|
23
24
|
}),
|
|
24
25
|
]),
|
|
25
26
|
)
|
|
26
|
-
type Timestamp = t.TypeOf<typeof Timestamp>
|
|
27
|
-
|
|
28
|
-
export default Timestamp
|
|
27
|
+
export type Timestamp = t.TypeOf<typeof Timestamp>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
1
|
+
export * from "./BooleanField"
|
|
2
|
+
export * from "./Color"
|
|
3
|
+
export * from "./Date"
|
|
4
|
+
export * from "./Embed"
|
|
5
|
+
export * from "./GeoPoint"
|
|
6
|
+
export * from "./Image"
|
|
7
|
+
export * from "./IntegrationField"
|
|
8
|
+
export * from "./Link"
|
|
9
|
+
export * from "./NestableWidget"
|
|
10
|
+
export * from "./Number"
|
|
11
|
+
export * from "./Range"
|
|
12
12
|
export * from "./RichText"
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
13
|
+
export * from "./Select"
|
|
14
|
+
export * from "./Separator"
|
|
15
|
+
export * from "./Text"
|
|
16
|
+
export * from "./Timestamp"
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
|
-
import { WidgetKey } from "../../../
|
|
3
|
+
import { WidgetKey } from "../../../common"
|
|
4
4
|
import { StringOrNull } from "../../../validators"
|
|
5
|
-
import NestableWidget from "../nestable/NestableWidget"
|
|
6
|
-
|
|
5
|
+
import { NestableWidget } from "../nestable/NestableWidget"
|
|
6
|
+
|
|
7
|
+
export const CompositeSliceType = "Slice"
|
|
7
8
|
|
|
8
9
|
const CompositeSliceConfig = t.exact(
|
|
9
10
|
t.partial({
|
|
@@ -15,7 +16,7 @@ type CompositeSliceConfig = t.TypeOf<typeof CompositeSliceConfig>
|
|
|
15
16
|
const CompositeSlice = t.exact(
|
|
16
17
|
t.intersection([
|
|
17
18
|
t.type({
|
|
18
|
-
type: t.literal(
|
|
19
|
+
type: t.literal(CompositeSliceType),
|
|
19
20
|
}),
|
|
20
21
|
t.partial({
|
|
21
22
|
fieldset: StringOrNull,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
import { withFallback } from "io-ts-types/lib/withFallback"
|
|
3
3
|
|
|
4
|
-
import { WidgetKey } from "../../../
|
|
5
|
-
import NestableWidget from "../nestable/NestableWidget"
|
|
6
|
-
import { SlicesTypes } from "./SlicesTypes"
|
|
4
|
+
import { WidgetKey } from "../../../common"
|
|
5
|
+
import { NestableWidget } from "../nestable/NestableWidget"
|
|
7
6
|
|
|
8
7
|
const IMAGE_PLACEHOLDER_URL =
|
|
9
8
|
"https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"
|
|
@@ -28,11 +27,13 @@ export const Variation = t.exact(
|
|
|
28
27
|
|
|
29
28
|
export type Variation = t.TypeOf<typeof Variation>
|
|
30
29
|
|
|
30
|
+
export const SharedSliceType = "SharedSlice"
|
|
31
|
+
|
|
31
32
|
export const SharedSlice = t.exact(
|
|
32
33
|
t.intersection([
|
|
33
34
|
t.type({
|
|
34
35
|
id: t.string,
|
|
35
|
-
type: t.literal(
|
|
36
|
+
type: t.literal(SharedSliceType),
|
|
36
37
|
name: t.string,
|
|
37
38
|
variations: t.readonlyArray(Variation),
|
|
38
39
|
}),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as t from "io-ts"
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { SharedSliceType } from "./SharedSlice"
|
|
4
4
|
|
|
5
5
|
const SharedSliceRef = t.exact(
|
|
6
6
|
t.type({
|
|
7
|
-
type: t.literal(
|
|
7
|
+
type: t.literal(SharedSliceType),
|
|
8
8
|
}),
|
|
9
9
|
)
|
|
10
10
|
type SharedSliceRef = t.TypeOf<typeof SharedSliceRef>
|