@prismicio/types-internal 1.0.0-alpha.0 → 1.0.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 (73) hide show
  1. package/lib/customtypes/CustomType.d.ts +666 -666
  2. package/lib/customtypes/CustomType.js +6 -6
  3. package/lib/customtypes/Section.d.ts +667 -667
  4. package/lib/customtypes/Section.js +1 -1
  5. package/lib/customtypes/widgets/Group.js +2 -2
  6. package/lib/customtypes/widgets/UID.js +2 -2
  7. package/lib/customtypes/widgets/Widget.d.ts +666 -666
  8. package/lib/customtypes/widgets/Widget.js +3 -3
  9. package/lib/customtypes/widgets/WidgetTypes.d.ts +2 -2
  10. package/lib/customtypes/widgets/WidgetTypes.js +2 -2
  11. package/lib/customtypes/widgets/index.d.ts +1 -1
  12. package/lib/customtypes/widgets/index.js +1 -1
  13. package/lib/customtypes/widgets/nestable/BooleanField.js +2 -2
  14. package/lib/customtypes/widgets/nestable/Color.js +2 -2
  15. package/lib/customtypes/widgets/nestable/Date.js +2 -2
  16. package/lib/customtypes/widgets/nestable/Embed.js +2 -2
  17. package/lib/customtypes/widgets/nestable/GeoPoint.js +2 -2
  18. package/lib/customtypes/widgets/nestable/Image.js +2 -2
  19. package/lib/customtypes/widgets/nestable/IntegrationField.js +2 -2
  20. package/lib/customtypes/widgets/nestable/Link.js +2 -2
  21. package/lib/customtypes/widgets/nestable/Number.js +2 -2
  22. package/lib/customtypes/widgets/nestable/Range.js +2 -2
  23. package/lib/customtypes/widgets/nestable/RichText.d.ts +1 -0
  24. package/lib/customtypes/widgets/nestable/RichText.js +2 -2
  25. package/lib/customtypes/widgets/nestable/Select.js +2 -2
  26. package/lib/customtypes/widgets/nestable/Separator.js +2 -2
  27. package/lib/customtypes/widgets/nestable/Text.js +2 -2
  28. package/lib/customtypes/widgets/nestable/Timestamp.js +2 -2
  29. package/lib/customtypes/widgets/slices/CompositeSlice.js +2 -2
  30. package/lib/customtypes/widgets/slices/SharedSlice.js +2 -2
  31. package/lib/customtypes/widgets/slices/SharedSliceRef.js +2 -2
  32. package/lib/customtypes/widgets/slices/Slices.d.ts +696 -696
  33. package/lib/customtypes/widgets/slices/Slices.js +5 -5
  34. package/lib/customtypes/widgets/slices/SlicesTypes.d.ts +2 -2
  35. package/lib/customtypes/widgets/slices/SlicesTypes.js +2 -2
  36. package/lib/customtypes/widgets/slices/index.d.ts +1 -1
  37. package/lib/customtypes/widgets/slices/index.js +1 -1
  38. package/lib/documents/widgets/index.d.ts +2 -1
  39. package/lib/documents/widgets/index.js +3 -3
  40. package/lib/documents/widgets/nestable/Link/index.d.ts +1 -0
  41. package/lib/documents/widgets/nestable/StructuredTextContent/Block.js +1 -1
  42. package/package.json +1 -1
  43. package/src/customtypes/CustomType.ts +3 -3
  44. package/src/customtypes/Section.ts +2 -2
  45. package/src/customtypes/widgets/Group.ts +1 -1
  46. package/src/customtypes/widgets/UID.ts +1 -1
  47. package/src/customtypes/widgets/Widget.ts +1 -1
  48. package/src/customtypes/widgets/WidgetTypes.ts +2 -2
  49. package/src/customtypes/widgets/index.ts +1 -1
  50. package/src/customtypes/widgets/nestable/BooleanField.ts +1 -1
  51. package/src/customtypes/widgets/nestable/Color.ts +1 -1
  52. package/src/customtypes/widgets/nestable/Date.ts +1 -1
  53. package/src/customtypes/widgets/nestable/Embed.ts +1 -1
  54. package/src/customtypes/widgets/nestable/GeoPoint.ts +1 -1
  55. package/src/customtypes/widgets/nestable/Image.ts +1 -1
  56. package/src/customtypes/widgets/nestable/IntegrationField.ts +1 -1
  57. package/src/customtypes/widgets/nestable/Link.ts +1 -1
  58. package/src/customtypes/widgets/nestable/Number.ts +1 -1
  59. package/src/customtypes/widgets/nestable/Range.ts +1 -1
  60. package/src/customtypes/widgets/nestable/RichText.ts +3 -1
  61. package/src/customtypes/widgets/nestable/Select.ts +1 -1
  62. package/src/customtypes/widgets/nestable/Separator.ts +1 -1
  63. package/src/customtypes/widgets/nestable/Text.ts +1 -1
  64. package/src/customtypes/widgets/nestable/Timestamp.ts +1 -1
  65. package/src/customtypes/widgets/slices/CompositeSlice.ts +1 -1
  66. package/src/customtypes/widgets/slices/SharedSlice.ts +1 -1
  67. package/src/customtypes/widgets/slices/SharedSliceRef.ts +1 -1
  68. package/src/customtypes/widgets/slices/Slices.ts +2 -2
  69. package/src/customtypes/widgets/slices/SlicesTypes.ts +2 -2
  70. package/src/customtypes/widgets/slices/index.ts +1 -1
  71. package/src/documents/widgets/index.ts +4 -1
  72. package/src/documents/widgets/nestable/Link/index.ts +2 -0
  73. package/src/documents/widgets/nestable/StructuredTextContent/Block.ts +1 -1
@@ -4,12 +4,12 @@ exports.Slices = exports.DynamicSlices = exports.StaticSlices = exports.slicesRe
4
4
  const tslib_1 = require("tslib");
5
5
  const t = (0, tslib_1.__importStar)(require("io-ts"));
6
6
  const validators_1 = require("../../../validators");
7
- const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("../WidgetTypes"));
7
+ const WidgetTypes_1 = require("../WidgetTypes");
8
8
  const CompositeSlice_1 = (0, tslib_1.__importDefault)(require("./CompositeSlice"));
9
9
  const LegacySlice_1 = (0, tslib_1.__importDefault)(require("./LegacySlice"));
10
10
  const SharedSlice_1 = require("./SharedSlice");
11
11
  const SharedSliceRef_1 = (0, tslib_1.__importDefault)(require("./SharedSliceRef"));
12
- const SlicesTypes_1 = (0, tslib_1.__importDefault)(require("./SlicesTypes"));
12
+ const SlicesTypes_1 = require("./SlicesTypes");
13
13
  exports.SlicesLabels = t.union([
14
14
  t.record(t.string, t.readonlyArray(t.exact(t.intersection([
15
15
  t.type({
@@ -34,7 +34,7 @@ exports.DynamicSlicesConfig = slicesConfigReader(SharedSliceRef_1.default);
34
34
  const SlicesConfig = {
35
35
  toStatic(config, sharedSlices) {
36
36
  const choices = Object.entries(config.choices || {}).reduce((acc, [ref, slice]) => {
37
- if (slice.type === SlicesTypes_1.default.SharedSlice) {
37
+ if (slice.type === SlicesTypes_1.SlicesTypes.SharedSlice) {
38
38
  const sharedSlice = sharedSlices.get(ref);
39
39
  if (sharedSlice)
40
40
  return { ...acc, [ref]: sharedSlice };
@@ -52,8 +52,8 @@ function slicesReader(codec) {
52
52
  return t.exact(t.intersection([
53
53
  t.type({
54
54
  type: t.union([
55
- t.literal(WidgetTypes_1.default.Slices),
56
- t.literal(WidgetTypes_1.default.LegacySlices),
55
+ t.literal(WidgetTypes_1.WidgetTypes.Slices),
56
+ t.literal(WidgetTypes_1.WidgetTypes.LegacySlices),
57
57
  ]),
58
58
  }),
59
59
  t.partial({
@@ -1,5 +1,5 @@
1
- declare const SlicesTypes: {
1
+ export declare const SlicesTypes: {
2
2
  readonly Slice: "Slice";
3
3
  readonly SharedSlice: "SharedSlice";
4
4
  };
5
- export default SlicesTypes;
5
+ export declare type SlicesTypes = typeof SlicesTypes[keyof typeof SlicesTypes];
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const SlicesTypes = {
3
+ exports.SlicesTypes = void 0;
4
+ exports.SlicesTypes = {
4
5
  Slice: "Slice",
5
6
  SharedSlice: "SharedSlice",
6
7
  };
7
- exports.default = SlicesTypes;
@@ -4,4 +4,4 @@ export * from "./SharedSlice";
4
4
  export { default as SharedSliceRef } from "./SharedSliceRef";
5
5
  export * as Slice from "./Slice";
6
6
  export * as SliceZone from "./Slices";
7
- export { default as SlicesTypes } from "./SlicesTypes";
7
+ export { SlicesTypes } from "./SlicesTypes";
@@ -12,4 +12,4 @@ Object.defineProperty(exports, "SharedSliceRef", { enumerable: true, get: functi
12
12
  exports.Slice = (0, tslib_1.__importStar)(require("./Slice"));
13
13
  exports.SliceZone = (0, tslib_1.__importStar)(require("./Slices"));
14
14
  var SlicesTypes_1 = require("./SlicesTypes");
15
- Object.defineProperty(exports, "SlicesTypes", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(SlicesTypes_1).default; } });
15
+ Object.defineProperty(exports, "SlicesTypes", { enumerable: true, get: function () { return SlicesTypes_1.SlicesTypes; } });
@@ -1,4 +1,4 @@
1
- import { SlicesContent } from "./slices/SlicesContent";
1
+ import { SlicesContent } from "./slices";
2
2
  import StaticWidgetContent from "./StaticWidgetContent";
3
3
  export * from "./EmptyContent";
4
4
  export * from "./GroupContent";
@@ -28,6 +28,7 @@ export declare const WidgetTypes: {
28
28
  readonly IntegrationFields: "IntegrationFieldsContent";
29
29
  readonly Separator: "SeparatorContent";
30
30
  };
31
+ export declare type WidgetTypes = typeof WidgetTypes[keyof typeof WidgetTypes];
31
32
  export declare type WidgetKey = string;
32
33
  export declare type WidgetContent = SlicesContent | StaticWidgetContent;
33
34
  export declare const Widget: {
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const EmptyContent_1 = require("./EmptyContent");
6
6
  const GroupContent_1 = require("./GroupContent");
7
7
  const nestable_1 = require("./nestable");
8
- const SlicesContent_1 = require("./slices/SlicesContent");
8
+ const slices_1 = require("./slices");
9
9
  const StaticWidgetContent_1 = (0, tslib_1.__importDefault)(require("./StaticWidgetContent"));
10
10
  const UIDContent_1 = require("./UIDContent");
11
11
  (0, tslib_1.__exportStar)(require("./EmptyContent"), exports);
@@ -21,13 +21,13 @@ exports.WidgetTypes = {
21
21
  Empty: EmptyContent_1.EmptyContentType,
22
22
  UID: UIDContent_1.UIDContentType,
23
23
  Group: GroupContent_1.GroupContentType,
24
- slices: SlicesContent_1.SlicesContentType,
24
+ slices: slices_1.SlicesContentType,
25
25
  };
26
26
  exports.Widget = {
27
27
  fromJson(widgetKey, widgetValue, widgetTypes, widgetPositions) {
28
28
  const fieldType = widgetTypes.get(widgetKey);
29
29
  if (fieldType === "Slices") {
30
- return SlicesContent_1.SlicesContent.fromJson(widgetKey, widgetValue, widgetTypes, widgetPositions);
30
+ return slices_1.SlicesContent.fromJson(widgetKey, widgetValue, widgetTypes, widgetPositions);
31
31
  }
32
32
  else {
33
33
  return StaticWidgetContent_1.default.fromJson([], widgetKey, widgetValue, widgetTypes, widgetPositions);
@@ -87,3 +87,4 @@ export declare const LinksTypes: {
87
87
  readonly ImageLink: "ImageLink";
88
88
  readonly LinkContent: "LinkContent";
89
89
  };
90
+ export declare type LinksTypes = typeof LinksTypes[keyof typeof LinksTypes];
@@ -17,7 +17,7 @@ exports.Meta = t.exact(t.intersection([
17
17
  t.type({
18
18
  start: t.number,
19
19
  end: t.number,
20
- type: t.union([nestable_1.RichTextNodeTypeCodec, t.literal('label')]),
20
+ type: t.union([nestable_1.RichTextNodeTypeCodec, t.literal("label")]),
21
21
  }),
22
22
  ]));
23
23
  // export alias for code clarity
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/types-internal",
3
- "version": "1.0.0-alpha.0",
3
+ "version": "1.0.1",
4
4
  "description": "Prismic types for Custom Types and Prismic Data",
5
5
  "keywords": [
6
6
  "typescript",
@@ -7,9 +7,9 @@ import { DynamicSection, Sections, StaticSection } from "./Section"
7
7
  import type { SharedSlice } from "./widgets/slices/SharedSlice"
8
8
  import type { DynamicSlice } from "./widgets/slices/Slice"
9
9
  import type { DynamicSlices } from "./widgets/slices/Slices"
10
- import SlicesTypes from "./widgets/slices/SlicesTypes"
10
+ import { SlicesTypes } from "./widgets/slices/SlicesTypes"
11
11
  import type { DynamicWidget } from "./widgets/Widget"
12
- import WidgetTypes from "./widgets/WidgetTypes"
12
+ import { WidgetTypes } from "./widgets/WidgetTypes"
13
13
 
14
14
  class CustomTypeSlicesError extends Error {
15
15
  slices: Array<string>
@@ -38,7 +38,7 @@ function customTypeReader<T extends StaticSection | DynamicSection>(
38
38
  id: t.string,
39
39
  label: StringOrNull,
40
40
  repeatable: withFallback(t.boolean, true),
41
- json: t.record(t.string, codec),
41
+ json: t.record(t.string, codec), //tab name => tab data
42
42
  status: withFallback(t.boolean, true),
43
43
  }),
44
44
  t.partial({
@@ -1,12 +1,12 @@
1
1
  import * as t from "io-ts"
2
2
 
3
- import type { SharedSlice } from "./widgets/slices/SharedSlice"
3
+ import type { SharedSlice } from "./widgets/slices"
4
4
  import { DynamicWidget, StaticWidget, Widgets } from "./widgets/Widget"
5
5
 
6
6
  export function sectionReader<T extends StaticWidget | DynamicWidget>(
7
7
  codec: t.Type<T, unknown>,
8
8
  ) {
9
- return t.record(t.string, codec)
9
+ return t.record(t.string, codec) // WidgetId -> Widget Data
10
10
  }
11
11
 
12
12
  export const StaticSection = sectionReader(StaticWidget)
@@ -2,7 +2,7 @@ import * as t from "io-ts"
2
2
 
3
3
  import { StringOrNull } from "../../validators"
4
4
  import NestableWidget from "./nestable/NestableWidget"
5
- import WidgetTypes from "./WidgetTypes"
5
+ import { WidgetTypes } from "./WidgetTypes"
6
6
 
7
7
  const GroupConfig = t.exact(
8
8
  t.partial({
@@ -1,7 +1,7 @@
1
1
  import * as t from "io-ts"
2
2
 
3
3
  import { StringOrNull } from "../../validators"
4
- import WidgetTypes from "./WidgetTypes"
4
+ import { WidgetTypes } from "./WidgetTypes"
5
5
 
6
6
  const UIDConfig = t.exact(
7
7
  t.partial({
@@ -5,7 +5,7 @@ import NestableWidget from "./nestable/NestableWidget"
5
5
  import type { SharedSlice } from "./slices/SharedSlice"
6
6
  import { DynamicSlices, Slices, StaticSlices } from "./slices/Slices"
7
7
  import UID from "./UID"
8
- import WidgetTypes from "./WidgetTypes"
8
+ import { WidgetTypes } from "./WidgetTypes"
9
9
 
10
10
  export function widgetReader<T extends StaticSlices | DynamicSlices>(
11
11
  codec: t.Type<T, unknown>,
@@ -1,4 +1,4 @@
1
- const WidgetTypes = {
1
+ export const WidgetTypes = {
2
2
  Text: "Text",
3
3
  RichText: "StructuredText",
4
4
  Color: "Color",
@@ -21,4 +21,4 @@ const WidgetTypes = {
21
21
  LegacySlices: "Choice",
22
22
  } as const
23
23
 
24
- export default WidgetTypes
24
+ export type WidgetTypes = typeof WidgetTypes[keyof typeof WidgetTypes]
@@ -4,4 +4,4 @@ export * as Shared from "./shared"
4
4
  export * as Slices from "./slices"
5
5
  export { default as UID } from "./UID"
6
6
  export * as Widget from "./Widget"
7
- export { default as WidgetTypes } from "./WidgetTypes"
7
+ export { WidgetTypes } from "./WidgetTypes"
@@ -1,7 +1,7 @@
1
1
  import * as t from "io-ts"
2
2
 
3
3
  import { StringOrNull } from "../../../validators"
4
- import WidgetTypes from "../WidgetTypes"
4
+ import { WidgetTypes } from "../WidgetTypes"
5
5
 
6
6
  const BooleanConfig = t.exact(
7
7
  t.partial({
@@ -1,7 +1,7 @@
1
1
  import * as t from "io-ts"
2
2
 
3
3
  import { StringOrNull } from "../../../validators"
4
- import WidgetTypes from "../WidgetTypes"
4
+ import { WidgetTypes } from "../WidgetTypes"
5
5
 
6
6
  const ColorConfig = t.exact(
7
7
  t.partial({
@@ -1,7 +1,7 @@
1
1
  import * as t from "io-ts"
2
2
 
3
3
  import { StringOrNull } from "../../../validators"
4
- import WidgetTypes from "../WidgetTypes"
4
+ import { WidgetTypes } from "../WidgetTypes"
5
5
 
6
6
  const DateConfig = t.exact(
7
7
  t.partial({
@@ -1,7 +1,7 @@
1
1
  import * as t from "io-ts"
2
2
 
3
3
  import { StringOrNull } from "../../../validators"
4
- import WidgetTypes from "../WidgetTypes"
4
+ import { WidgetTypes } from "../WidgetTypes"
5
5
 
6
6
  const EmbedConfig = t.exact(
7
7
  t.partial({
@@ -1,7 +1,7 @@
1
1
  import * as t from "io-ts"
2
2
 
3
3
  import { StringOrNull } from "../../../validators"
4
- import WidgetTypes from "../WidgetTypes"
4
+ import { WidgetTypes } from "../WidgetTypes"
5
5
 
6
6
  const GeoPointConfig = t.exact(
7
7
  t.partial({
@@ -2,7 +2,7 @@ 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"
5
+ import { WidgetTypes } from "../WidgetTypes"
6
6
 
7
7
  const Thumbnail = t.exact(
8
8
  t.intersection([
@@ -1,7 +1,7 @@
1
1
  import * as t from "io-ts"
2
2
 
3
3
  import { StringOrNull } from "../../../validators"
4
- import WidgetTypes from "../WidgetTypes"
4
+ import { WidgetTypes } from "../WidgetTypes"
5
5
 
6
6
  const IntegrationFieldConfig = t.exact(
7
7
  t.partial({
@@ -3,7 +3,7 @@ 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"
6
+ import { WidgetTypes } from "../WidgetTypes"
7
7
 
8
8
  const arrayString = (
9
9
  entries:
@@ -2,7 +2,7 @@ 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"
5
+ import { WidgetTypes } from "../WidgetTypes"
6
6
 
7
7
  const NumberConfig = t.exact(
8
8
  t.partial({
@@ -2,7 +2,7 @@ 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"
5
+ import { WidgetTypes } from "../WidgetTypes"
6
6
 
7
7
  const RangeConfig = t.exact(
8
8
  t.partial({
@@ -3,10 +3,12 @@ import * as t from "io-ts"
3
3
 
4
4
  import { StringOrNull } from "../../../validators"
5
5
  import ImageConstraint from "../shared/ImageConstraint"
6
- import WidgetTypes from "../WidgetTypes"
6
+ import { WidgetTypes } from "../WidgetTypes"
7
7
 
8
8
  export const DEFAULT_OPTION = "paragraph"
9
9
 
10
+ export type RichTextNodeType =
11
+ typeof RichTextNodeType[keyof typeof RichTextNodeType]
10
12
  export const RichTextNodeType = {
11
13
  heading1: "heading1",
12
14
  heading2: "heading2",
@@ -5,7 +5,7 @@ import {
5
5
  StringFromNumber,
6
6
  StringOrNull,
7
7
  } from "../../../validators"
8
- import WidgetTypes from "../WidgetTypes"
8
+ import { WidgetTypes } from "../WidgetTypes"
9
9
 
10
10
  const SelectConfig = t.exact(
11
11
  t.partial({
@@ -1,7 +1,7 @@
1
1
  import * as t from "io-ts"
2
2
 
3
3
  import { StringOrNull } from "../../../validators"
4
- import WidgetTypes from "../WidgetTypes"
4
+ import { WidgetTypes } from "../WidgetTypes"
5
5
 
6
6
  const SeparatorConfig = t.exact(
7
7
  t.partial({
@@ -1,7 +1,7 @@
1
1
  import * as t from "io-ts"
2
2
 
3
3
  import { StringOrNull } from "../../../validators"
4
- import WidgetTypes from "../WidgetTypes"
4
+ import { WidgetTypes } from "../WidgetTypes"
5
5
 
6
6
  const TextConfig = t.exact(
7
7
  t.partial({
@@ -1,7 +1,7 @@
1
1
  import * as t from "io-ts"
2
2
 
3
3
  import { StringOrNull } from "../../../validators"
4
- import WidgetTypes from "../WidgetTypes"
4
+ import { WidgetTypes } from "../WidgetTypes"
5
5
 
6
6
  const TimestampConfig = t.exact(
7
7
  t.partial({
@@ -2,7 +2,7 @@ import * as t from "io-ts"
2
2
 
3
3
  import { StringOrNull } from "../../../validators"
4
4
  import NestableWidget from "../nestable/NestableWidget"
5
- import SlicesTypes from "./SlicesTypes"
5
+ import { SlicesTypes } from "./SlicesTypes"
6
6
 
7
7
  const CompositeSliceConfig = t.exact(
8
8
  t.partial({
@@ -2,7 +2,7 @@ import * as t from "io-ts"
2
2
  import { withFallback } from "io-ts-types/lib/withFallback"
3
3
 
4
4
  import NestableWidget from "../nestable/NestableWidget"
5
- import SlicesTypes from "./SlicesTypes"
5
+ import { SlicesTypes } from "./SlicesTypes"
6
6
 
7
7
  const IMAGE_PLACEHOLDER_URL =
8
8
  "https://images.prismic.io/slice-machine/621a5ec4-0387-4bc5-9860-2dd46cbc07cd_default_ss.png?auto=compress,format"
@@ -1,6 +1,6 @@
1
1
  import * as t from "io-ts"
2
2
 
3
- import SlicesTypes from "./SlicesTypes"
3
+ import { SlicesTypes } from "./SlicesTypes"
4
4
 
5
5
  const SharedSliceRef = t.exact(
6
6
  t.type({
@@ -1,12 +1,12 @@
1
1
  import * as t from "io-ts"
2
2
 
3
3
  import { StringOrNull } from "../../../validators"
4
- import WidgetTypes from "../WidgetTypes"
4
+ import { WidgetTypes } from "../WidgetTypes"
5
5
  import CompositeSlice from "./CompositeSlice"
6
6
  import LegacySlice from "./LegacySlice"
7
7
  import { SharedSlice } from "./SharedSlice"
8
8
  import SharedSliceRef from "./SharedSliceRef"
9
- import SlicesTypes from "./SlicesTypes"
9
+ import { SlicesTypes } from "./SlicesTypes"
10
10
 
11
11
  export const SlicesLabels = t.union([
12
12
  t.record(
@@ -1,6 +1,6 @@
1
- const SlicesTypes = {
1
+ export const SlicesTypes = {
2
2
  Slice: "Slice",
3
3
  SharedSlice: "SharedSlice",
4
4
  } as const
5
5
 
6
- export default SlicesTypes
6
+ export type SlicesTypes = typeof SlicesTypes[keyof typeof SlicesTypes]
@@ -4,4 +4,4 @@ export * from "./SharedSlice"
4
4
  export { default as SharedSliceRef } from "./SharedSliceRef"
5
5
  export * as Slice from "./Slice"
6
6
  export * as SliceZone from "./Slices"
7
- export { default as SlicesTypes } from "./SlicesTypes"
7
+ export { SlicesTypes } from "./SlicesTypes"
@@ -1,7 +1,7 @@
1
1
  import { EmptyContentType } from "./EmptyContent"
2
2
  import { GroupContentType } from "./GroupContent"
3
3
  import { NestableTypes } from "./nestable"
4
- import { SlicesContent, SlicesContentType } from "./slices/SlicesContent"
4
+ import { SlicesContent, SlicesContentType } from "./slices"
5
5
  import StaticWidgetContent from "./StaticWidgetContent"
6
6
  import { UIDContentType } from "./UIDContent"
7
7
 
@@ -24,7 +24,10 @@ export const WidgetTypes = {
24
24
  slices: SlicesContentType,
25
25
  } as const
26
26
 
27
+ export type WidgetTypes = typeof WidgetTypes[keyof typeof WidgetTypes]
28
+
27
29
  export type WidgetKey = string
30
+
28
31
  export type WidgetContent = SlicesContent | StaticWidgetContent
29
32
 
30
33
  export const Widget = {
@@ -31,3 +31,5 @@ export const LinksTypes = {
31
31
  ImageLink: ImageLinkType,
32
32
  LinkContent: LinkContentType,
33
33
  } as const
34
+
35
+ export type LinksTypes = typeof LinksTypes[keyof typeof LinksTypes]
@@ -19,7 +19,7 @@ export const Meta = t.exact(
19
19
  t.type({
20
20
  start: t.number,
21
21
  end: t.number,
22
- type: t.union([RichTextNodeTypeCodec, t.literal('label')]),
22
+ type: t.union([RichTextNodeTypeCodec, t.literal("label")]),
23
23
  }),
24
24
  ]),
25
25
  )