@prismicio/types-internal 0.3.3 → 1.0.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.
Files changed (94) hide show
  1. package/lib/customtypes/CustomType.d.ts +309 -311
  2. package/lib/customtypes/CustomType.js +6 -6
  3. package/lib/customtypes/Format.d.ts +4 -0
  4. package/lib/customtypes/Format.js +8 -0
  5. package/lib/customtypes/Section.d.ts +309 -309
  6. package/lib/customtypes/widgets/Group.d.ts +22 -23
  7. package/lib/customtypes/widgets/Group.js +2 -2
  8. package/lib/customtypes/widgets/UID.d.ts +1 -2
  9. package/lib/customtypes/widgets/UID.js +2 -2
  10. package/lib/customtypes/widgets/Widget.d.ts +353 -354
  11. package/lib/customtypes/widgets/Widget.js +3 -3
  12. package/lib/customtypes/widgets/WidgetTypes.d.ts +22 -22
  13. package/lib/customtypes/widgets/WidgetTypes.js +22 -23
  14. package/lib/customtypes/widgets/index.d.ts +1 -1
  15. package/lib/customtypes/widgets/index.js +1 -1
  16. package/lib/customtypes/widgets/nestable/BooleanField.d.ts +1 -2
  17. package/lib/customtypes/widgets/nestable/BooleanField.js +2 -2
  18. package/lib/customtypes/widgets/nestable/Color.d.ts +1 -2
  19. package/lib/customtypes/widgets/nestable/Color.js +2 -2
  20. package/lib/customtypes/widgets/nestable/Date.d.ts +1 -2
  21. package/lib/customtypes/widgets/nestable/Date.js +2 -2
  22. package/lib/customtypes/widgets/nestable/Embed.d.ts +1 -2
  23. package/lib/customtypes/widgets/nestable/Embed.js +2 -2
  24. package/lib/customtypes/widgets/nestable/GeoPoint.d.ts +1 -2
  25. package/lib/customtypes/widgets/nestable/GeoPoint.js +2 -2
  26. package/lib/customtypes/widgets/nestable/Image.d.ts +2 -3
  27. package/lib/customtypes/widgets/nestable/Image.js +3 -3
  28. package/lib/customtypes/widgets/nestable/IntegrationField.d.ts +1 -2
  29. package/lib/customtypes/widgets/nestable/IntegrationField.js +2 -2
  30. package/lib/customtypes/widgets/nestable/Link.d.ts +4 -5
  31. package/lib/customtypes/widgets/nestable/Link.js +3 -3
  32. package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +21 -21
  33. package/lib/customtypes/widgets/nestable/Number.d.ts +1 -2
  34. package/lib/customtypes/widgets/nestable/Number.js +2 -2
  35. package/lib/customtypes/widgets/nestable/Range.d.ts +1 -2
  36. package/lib/customtypes/widgets/nestable/Range.js +2 -2
  37. package/lib/customtypes/widgets/nestable/RichText.d.ts +22 -22
  38. package/lib/customtypes/widgets/nestable/RichText.js +38 -39
  39. package/lib/customtypes/widgets/nestable/Select.d.ts +2 -3
  40. package/lib/customtypes/widgets/nestable/Select.js +3 -3
  41. package/lib/customtypes/widgets/nestable/Separator.d.ts +1 -2
  42. package/lib/customtypes/widgets/nestable/Separator.js +2 -2
  43. package/lib/customtypes/widgets/nestable/Text.d.ts +1 -2
  44. package/lib/customtypes/widgets/nestable/Text.js +2 -2
  45. package/lib/customtypes/widgets/nestable/Timestamp.d.ts +1 -2
  46. package/lib/customtypes/widgets/nestable/Timestamp.js +2 -2
  47. package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +43 -44
  48. package/lib/customtypes/widgets/slices/CompositeSlice.js +2 -2
  49. package/lib/customtypes/widgets/slices/LegacySlice.d.ts +43 -43
  50. package/lib/customtypes/widgets/slices/SharedSlice.d.ts +86 -87
  51. package/lib/customtypes/widgets/slices/SharedSlice.js +3 -3
  52. package/lib/customtypes/widgets/slices/SharedSliceRef.d.ts +1 -2
  53. package/lib/customtypes/widgets/slices/SharedSliceRef.js +2 -2
  54. package/lib/customtypes/widgets/slices/Slices.d.ts +529 -531
  55. package/lib/customtypes/widgets/slices/Slices.js +6 -6
  56. package/lib/customtypes/widgets/slices/SlicesTypes.d.ts +5 -5
  57. package/lib/customtypes/widgets/slices/SlicesTypes.js +5 -6
  58. package/lib/customtypes/widgets/slices/index.d.ts +1 -1
  59. package/lib/customtypes/widgets/slices/index.js +1 -1
  60. package/lib/documents/widgets/index.d.ts +1 -0
  61. package/lib/documents/widgets/nestable/Link/index.d.ts +1 -0
  62. package/lib/documents/widgets/nestable/StructuredTextContent/Block.d.ts +16 -17
  63. package/lib/documents/widgets/nestable/StructuredTextContent/Block.js +1 -1
  64. package/package.json +1 -1
  65. package/src/customtypes/CustomType.ts +2 -2
  66. package/src/customtypes/widgets/Group.ts +1 -1
  67. package/src/customtypes/widgets/UID.ts +1 -1
  68. package/src/customtypes/widgets/Widget.ts +1 -1
  69. package/src/customtypes/widgets/WidgetTypes.ts +22 -22
  70. package/src/customtypes/widgets/index.ts +1 -1
  71. package/src/customtypes/widgets/nestable/BooleanField.ts +1 -1
  72. package/src/customtypes/widgets/nestable/Color.ts +1 -1
  73. package/src/customtypes/widgets/nestable/Date.ts +1 -1
  74. package/src/customtypes/widgets/nestable/Embed.ts +1 -1
  75. package/src/customtypes/widgets/nestable/GeoPoint.ts +1 -1
  76. package/src/customtypes/widgets/nestable/Image.ts +2 -2
  77. package/src/customtypes/widgets/nestable/IntegrationField.ts +1 -1
  78. package/src/customtypes/widgets/nestable/Link.ts +4 -4
  79. package/src/customtypes/widgets/nestable/Number.ts +1 -1
  80. package/src/customtypes/widgets/nestable/Range.ts +1 -1
  81. package/src/customtypes/widgets/nestable/RichText.ts +37 -35
  82. package/src/customtypes/widgets/nestable/Select.ts +4 -2
  83. package/src/customtypes/widgets/nestable/Separator.ts +1 -1
  84. package/src/customtypes/widgets/nestable/Text.ts +1 -1
  85. package/src/customtypes/widgets/nestable/Timestamp.ts +1 -1
  86. package/src/customtypes/widgets/slices/CompositeSlice.ts +1 -1
  87. package/src/customtypes/widgets/slices/SharedSlice.ts +2 -2
  88. package/src/customtypes/widgets/slices/SharedSliceRef.ts +1 -1
  89. package/src/customtypes/widgets/slices/Slices.ts +3 -3
  90. package/src/customtypes/widgets/slices/SlicesTypes.ts +5 -5
  91. package/src/customtypes/widgets/slices/index.ts +1 -1
  92. package/src/documents/widgets/index.ts +1 -5
  93. package/src/documents/widgets/nestable/Link/index.ts +2 -0
  94. package/src/documents/widgets/nestable/StructuredTextContent/Block.ts +1 -1
@@ -1,7 +1,6 @@
1
1
  import * as t from "io-ts";
2
- import WidgetTypes from "./WidgetTypes";
3
2
  declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
4
- type: t.LiteralC<WidgetTypes.Group>;
3
+ type: t.LiteralC<"Group">;
5
4
  }>, t.PartialC<{
6
5
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
7
6
  icon: t.StringC;
@@ -10,7 +9,7 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
10
9
  label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
11
10
  repeat: t.BooleanC;
12
11
  fields: t.RecordC<t.StringC, t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
13
- type: t.LiteralC<WidgetTypes.Color>;
12
+ type: t.LiteralC<"Color">;
14
13
  }>, t.PartialC<{
15
14
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
16
15
  config: t.ExactC<t.PartialC<{
@@ -18,7 +17,7 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
18
17
  placeholder: t.StringC;
19
18
  }>>;
20
19
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
21
- type: t.LiteralC<WidgetTypes.BooleanField>;
20
+ type: t.LiteralC<"Boolean">;
22
21
  }>, t.PartialC<{
23
22
  config: t.ExactC<t.PartialC<{
24
23
  label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
@@ -27,7 +26,7 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
27
26
  placeholder_false: t.StringC;
28
27
  }>>;
29
28
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
30
- type: t.LiteralC<WidgetTypes.Embed>;
29
+ type: t.LiteralC<"Embed">;
31
30
  }>, t.PartialC<{
32
31
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
33
32
  config: t.ExactC<t.PartialC<{
@@ -36,14 +35,14 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
36
35
  useAsTitle: t.BooleanC;
37
36
  }>>;
38
37
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
39
- type: t.LiteralC<WidgetTypes.GeoPoint>;
38
+ type: t.LiteralC<"GeoPoint">;
40
39
  }>, t.PartialC<{
41
40
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
42
41
  config: t.ExactC<t.PartialC<{
43
42
  label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
44
43
  }>>;
45
44
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
46
- type: t.LiteralC<WidgetTypes.Date>;
45
+ type: t.LiteralC<"Date">;
47
46
  }>, t.PartialC<{
48
47
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
49
48
  config: t.ExactC<t.PartialC<{
@@ -52,7 +51,7 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
52
51
  default: t.StringC;
53
52
  }>>;
54
53
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
55
- type: t.LiteralC<WidgetTypes.Number>;
54
+ type: t.LiteralC<"Number">;
56
55
  }>, t.PartialC<{
57
56
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
58
57
  config: t.ExactC<t.PartialC<{
@@ -63,7 +62,7 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
63
62
  step: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
64
63
  }>>;
65
64
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
66
- type: t.LiteralC<WidgetTypes.Range>;
65
+ type: t.LiteralC<"Range">;
67
66
  }>, t.PartialC<{
68
67
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
69
68
  config: t.ExactC<t.PartialC<{
@@ -74,7 +73,7 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
74
73
  step: t.UnionC<[t.NumberC, import("io-ts-types").NumberFromStringC]>;
75
74
  }>>;
76
75
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
77
- type: t.LiteralC<WidgetTypes.RichText>;
76
+ type: t.LiteralC<"StructuredText">;
78
77
  }>, t.PartialC<{
79
78
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
80
79
  config: t.ExactC<t.PartialC<{
@@ -87,27 +86,27 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
87
86
  width: t.Type<number | null, unknown, unknown>;
88
87
  height: t.Type<number | null, unknown, unknown>;
89
88
  }>;
90
- labels: t.Type<string[], object, unknown>;
89
+ labels: t.Type<readonly string[], object, unknown>;
91
90
  allowTargetBlank: t.BooleanC;
92
91
  }>>;
93
92
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
94
- type: t.LiteralC<WidgetTypes.Select>;
93
+ type: t.LiteralC<"Select">;
95
94
  }>, t.PartialC<{
96
95
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
97
96
  config: t.ExactC<t.PartialC<{
98
97
  label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
99
98
  placeholder: t.StringC;
100
99
  default_value: t.StringC;
101
- options: t.ArrayC<t.UnionC<[t.StringC, t.Type<string, string, unknown>, t.Type<string, string, unknown>]>>;
100
+ options: t.ReadonlyArrayC<t.UnionC<[t.StringC, t.Type<string, string, unknown>, t.Type<string, string, unknown>]>>;
102
101
  }>>;
103
102
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
104
- type: t.LiteralC<WidgetTypes.Separator>;
103
+ type: t.LiteralC<"Separator">;
105
104
  }>, t.PartialC<{
106
105
  config: t.ExactC<t.PartialC<{
107
106
  label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
108
107
  }>>;
109
108
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
110
- type: t.LiteralC<WidgetTypes.Text>;
109
+ type: t.LiteralC<"Text">;
111
110
  }>, t.PartialC<{
112
111
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
113
112
  config: t.ExactC<t.PartialC<{
@@ -116,7 +115,7 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
116
115
  placeholder: t.StringC;
117
116
  }>>;
118
117
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
119
- type: t.LiteralC<WidgetTypes.Timestamp>;
118
+ type: t.LiteralC<"Timestamp">;
120
119
  }>, t.PartialC<{
121
120
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
122
121
  config: t.ExactC<t.PartialC<{
@@ -125,7 +124,7 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
125
124
  default: t.StringC;
126
125
  }>>;
127
126
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
128
- type: t.LiteralC<WidgetTypes.Link>;
127
+ type: t.LiteralC<"Link">;
129
128
  }>, t.PartialC<{
130
129
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
131
130
  config: t.ExactC<t.PartialC<{
@@ -133,13 +132,13 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
133
132
  useAsTitle: t.BooleanC;
134
133
  placeholder: t.StringC;
135
134
  select: t.UnionC<[t.LiteralC<"media">, t.LiteralC<"document">, t.LiteralC<"web">, t.NullC]>;
136
- customtypes: t.ArrayC<t.StringC>;
137
- masks: t.Type<string[], object, unknown>;
138
- tags: t.Type<string[], object, unknown>;
135
+ customtypes: t.ReadonlyArrayC<t.StringC>;
136
+ masks: t.Type<readonly string[], object, unknown>;
137
+ tags: t.Type<readonly string[], object, unknown>;
139
138
  allowTargetBlank: t.BooleanC;
140
139
  }>>;
141
140
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
142
- type: t.LiteralC<WidgetTypes.Image>;
141
+ type: t.LiteralC<"Image">;
143
142
  }>, t.PartialC<{
144
143
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
145
144
  config: t.ExactC<t.PartialC<{
@@ -149,7 +148,7 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
149
148
  width: t.Type<number | null, unknown, unknown>;
150
149
  height: t.Type<number | null, unknown, unknown>;
151
150
  }>;
152
- thumbnails: t.ArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{
151
+ thumbnails: t.ReadonlyArrayC<t.ExactC<t.IntersectionC<[t.TypeC<{
153
152
  name: t.StringC;
154
153
  }>, t.PartialC<{
155
154
  width: t.Type<number | null, unknown, unknown>;
@@ -157,7 +156,7 @@ declare const Group: t.ExactC<t.IntersectionC<[t.TypeC<{
157
156
  }>]>>>;
158
157
  }>>;
159
158
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
160
- type: t.LiteralC<WidgetTypes.IntegrationField>;
159
+ type: t.LiteralC<"IntegrationFields">;
161
160
  }>, t.PartialC<{
162
161
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
163
162
  config: t.ExactC<t.PartialC<{
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
4
4
  const t = (0, tslib_1.__importStar)(require("io-ts"));
5
5
  const validators_1 = require("../../validators");
6
6
  const NestableWidget_1 = (0, tslib_1.__importDefault)(require("./nestable/NestableWidget"));
7
- const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("./WidgetTypes"));
7
+ const WidgetTypes_1 = require("./WidgetTypes");
8
8
  const GroupConfig = t.exact(t.partial({
9
9
  label: validators_1.StringOrNull,
10
10
  repeat: t.boolean,
@@ -12,7 +12,7 @@ const GroupConfig = t.exact(t.partial({
12
12
  }));
13
13
  const Group = t.exact(t.intersection([
14
14
  t.type({
15
- type: t.literal(WidgetTypes_1.default.Group),
15
+ type: t.literal(WidgetTypes_1.WidgetTypes.Group),
16
16
  }),
17
17
  t.partial({
18
18
  fieldset: validators_1.StringOrNull,
@@ -1,7 +1,6 @@
1
1
  import * as t from "io-ts";
2
- import WidgetTypes from "./WidgetTypes";
3
2
  declare const UID: t.ExactC<t.IntersectionC<[t.TypeC<{
4
- type: t.LiteralC<WidgetTypes.UID>;
3
+ type: t.LiteralC<"UID">;
5
4
  }>, t.PartialC<{
6
5
  fieldset: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
7
6
  config: t.ExactC<t.PartialC<{
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const t = (0, tslib_1.__importStar)(require("io-ts"));
5
5
  const validators_1 = require("../../validators");
6
- const WidgetTypes_1 = (0, tslib_1.__importDefault)(require("./WidgetTypes"));
6
+ const WidgetTypes_1 = require("./WidgetTypes");
7
7
  const UIDConfig = t.exact(t.partial({
8
8
  label: validators_1.StringOrNull,
9
9
  useAsTitle: t.boolean,
@@ -11,7 +11,7 @@ const UIDConfig = t.exact(t.partial({
11
11
  }));
12
12
  const UID = t.exact(t.intersection([
13
13
  t.type({
14
- type: t.literal(WidgetTypes_1.default.UID),
14
+ type: t.literal(WidgetTypes_1.WidgetTypes.UID),
15
15
  }),
16
16
  t.partial({
17
17
  fieldset: validators_1.StringOrNull,