@prismicio/types-internal 3.16.0 → 3.16.1-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.
Files changed (235) hide show
  1. package/lib/content/fields/RepeatableContent.d.ts +51 -123
  2. package/lib/content/fields/RepeatableContent.js +10 -14
  3. package/lib/content/fields/nestable/RichTextContent/Block.d.ts +1036 -0
  4. package/lib/content/fields/nestable/RichTextContent/Block.js +31 -0
  5. package/lib/content/fields/nestable/RichTextContent/EmbedBlock.d.ts +60 -0
  6. package/lib/content/fields/nestable/RichTextContent/EmbedBlock.js +53 -0
  7. package/lib/content/fields/nestable/RichTextContent/ImageBlock.d.ts +203 -0
  8. package/lib/content/fields/nestable/RichTextContent/ImageBlock.js +36 -0
  9. package/lib/content/fields/nestable/RichTextContent/TableBlock.d.ts +500 -0
  10. package/lib/content/fields/nestable/RichTextContent/TableBlock.js +21 -0
  11. package/lib/content/fields/nestable/RichTextContent/TextBlock.d.ts +590 -0
  12. package/lib/content/fields/nestable/RichTextContent/TextBlock.js +80 -0
  13. package/lib/scripts/release.d.ts +1 -0
  14. package/lib/scripts/release.js +34 -0
  15. package/lib/src/_internal/utils.d.ts +36 -0
  16. package/lib/src/_internal/utils.js +20 -0
  17. package/lib/src/common/Asset.d.ts +16 -0
  18. package/lib/src/common/Asset.js +11 -0
  19. package/lib/src/common/Embed.d.ts +15 -0
  20. package/lib/src/common/Embed.js +10 -0
  21. package/lib/src/common/HexaColorCode.d.ts +4 -0
  22. package/lib/src/common/HexaColorCode.js +7 -0
  23. package/lib/src/common/UUID.d.ts +6 -0
  24. package/lib/src/common/UUID.js +8 -0
  25. package/lib/src/common/WidgetKey.d.ts +3 -0
  26. package/lib/src/common/WidgetKey.js +8 -0
  27. package/lib/src/common/index.d.ts +3 -0
  28. package/lib/src/common/index.js +6 -0
  29. package/lib/src/content/Document.d.ts +11803 -0
  30. package/lib/src/content/Document.js +266 -0
  31. package/lib/src/content/LegacyContentCtx.d.ts +64 -0
  32. package/lib/src/content/LegacyContentCtx.js +130 -0
  33. package/lib/src/content/fields/EmptyContent.d.ts +16 -0
  34. package/lib/src/content/fields/EmptyContent.js +30 -0
  35. package/lib/src/content/fields/GroupContent.d.ts +42 -0
  36. package/lib/src/content/fields/GroupContent.js +208 -0
  37. package/lib/src/content/fields/UIDContent.d.ts +16 -0
  38. package/lib/src/content/fields/UIDContent.js +25 -0
  39. package/lib/src/content/fields/WidgetContent.d.ts +11749 -0
  40. package/lib/src/content/fields/WidgetContent.js +57 -0
  41. package/lib/src/content/fields/index.d.ts +6 -0
  42. package/lib/src/content/fields/index.js +9 -0
  43. package/lib/src/content/fields/nestable/BooleanContent.d.ts +18 -0
  44. package/lib/src/content/fields/nestable/BooleanContent.js +35 -0
  45. package/lib/src/content/fields/nestable/EmbedContent.d.ts +78 -0
  46. package/lib/src/content/fields/nestable/EmbedContent.js +56 -0
  47. package/lib/src/content/fields/nestable/FieldContent/ColorContent.d.ts +18 -0
  48. package/lib/src/content/fields/nestable/FieldContent/ColorContent.js +35 -0
  49. package/lib/src/content/fields/nestable/FieldContent/DateContent.d.ts +18 -0
  50. package/lib/src/content/fields/nestable/FieldContent/DateContent.js +35 -0
  51. package/lib/src/content/fields/nestable/FieldContent/NumberContent.d.ts +18 -0
  52. package/lib/src/content/fields/nestable/FieldContent/NumberContent.js +35 -0
  53. package/lib/src/content/fields/nestable/FieldContent/RangeContent.d.ts +18 -0
  54. package/lib/src/content/fields/nestable/FieldContent/RangeContent.js +35 -0
  55. package/lib/src/content/fields/nestable/FieldContent/SelectContent.d.ts +20 -0
  56. package/lib/src/content/fields/nestable/FieldContent/SelectContent.js +46 -0
  57. package/lib/src/content/fields/nestable/FieldContent/TextContent.d.ts +18 -0
  58. package/lib/src/content/fields/nestable/FieldContent/TextContent.js +35 -0
  59. package/lib/src/content/fields/nestable/FieldContent/TimestampContent.d.ts +18 -0
  60. package/lib/src/content/fields/nestable/FieldContent/TimestampContent.js +35 -0
  61. package/lib/src/content/fields/nestable/FieldContent/common.d.ts +1 -0
  62. package/lib/src/content/fields/nestable/FieldContent/common.js +4 -0
  63. package/lib/src/content/fields/nestable/FieldContent/index.d.ts +49 -0
  64. package/lib/src/content/fields/nestable/FieldContent/index.js +38 -0
  65. package/lib/src/content/fields/nestable/GeoPointContent.d.ts +33 -0
  66. package/lib/src/content/fields/nestable/GeoPointContent.js +31 -0
  67. package/lib/src/content/fields/nestable/ImageContent.d.ts +227 -0
  68. package/lib/src/content/fields/nestable/ImageContent.js +73 -0
  69. package/lib/src/content/fields/nestable/IntegrationFieldContent.d.ts +16 -0
  70. package/lib/src/content/fields/nestable/IntegrationFieldContent.js +28 -0
  71. package/lib/src/content/fields/nestable/LinkContent.d.ts +919 -0
  72. package/lib/src/content/fields/nestable/LinkContent.js +399 -0
  73. package/lib/src/content/fields/nestable/NestableContent.d.ts +1953 -0
  74. package/lib/src/content/fields/nestable/NestableContent.js +167 -0
  75. package/lib/src/content/fields/nestable/RepeatableContent.d.ts +176 -0
  76. package/lib/src/content/fields/nestable/RepeatableContent.js +104 -0
  77. package/lib/src/content/fields/nestable/RichTextContent/Blocks.d.ts +1261 -0
  78. package/lib/src/content/fields/nestable/RichTextContent/Blocks.js +170 -0
  79. package/lib/src/content/fields/nestable/RichTextContent/index.d.ts +1004 -0
  80. package/lib/src/content/fields/nestable/RichTextContent/index.js +28 -0
  81. package/lib/src/content/fields/nestable/SeparatorContent.d.ts +13 -0
  82. package/lib/src/content/fields/nestable/SeparatorContent.js +22 -0
  83. package/lib/src/content/fields/nestable/TableContent.d.ts +770 -0
  84. package/lib/src/content/fields/nestable/TableContent.js +121 -0
  85. package/lib/src/content/fields/nestable/index.d.ts +12 -0
  86. package/lib/src/content/fields/nestable/index.js +15 -0
  87. package/lib/src/content/fields/slices/Slice/CompositeSliceContent.d.ts +3934 -0
  88. package/lib/src/content/fields/slices/Slice/CompositeSliceContent.js +195 -0
  89. package/lib/src/content/fields/slices/Slice/RepeatableContent.d.ts +774 -0
  90. package/lib/src/content/fields/slices/Slice/RepeatableContent.js +21 -0
  91. package/lib/src/content/fields/slices/Slice/SharedSliceContent.d.ts +3937 -0
  92. package/lib/src/content/fields/slices/Slice/SharedSliceContent.js +215 -0
  93. package/lib/src/content/fields/slices/Slice/SimpleSliceContent.d.ts +1962 -0
  94. package/lib/src/content/fields/slices/Slice/SimpleSliceContent.js +130 -0
  95. package/lib/src/content/fields/slices/Slice/SlicePrimaryContent.d.ts +1952 -0
  96. package/lib/src/content/fields/slices/Slice/SlicePrimaryContent.js +30 -0
  97. package/lib/src/content/fields/slices/Slice/index.d.ts +6810 -0
  98. package/lib/src/content/fields/slices/Slice/index.js +45 -0
  99. package/lib/src/content/fields/slices/SliceItem.d.ts +6846 -0
  100. package/lib/src/content/fields/slices/SliceItem.js +116 -0
  101. package/lib/src/content/fields/slices/SlicesContent.d.ts +9809 -0
  102. package/lib/src/content/fields/slices/SlicesContent.js +187 -0
  103. package/lib/src/content/fields/slices/index.d.ts +3 -0
  104. package/lib/src/content/fields/slices/index.js +6 -0
  105. package/lib/src/content/fields/withDefaultValues.d.ts +9 -0
  106. package/lib/src/content/fields/withDefaultValues.js +79 -0
  107. package/lib/src/content/index.d.ts +3 -0
  108. package/lib/src/content/index.js +6 -0
  109. package/lib/src/content/utils.d.ts +14 -0
  110. package/lib/src/content/utils.js +33 -0
  111. package/lib/src/customtypes/CustomType.d.ts +3680 -0
  112. package/lib/src/customtypes/CustomType.js +184 -0
  113. package/lib/src/customtypes/Section.d.ts +3635 -0
  114. package/lib/src/customtypes/Section.js +66 -0
  115. package/lib/src/customtypes/diff/Changes.d.ts +17 -0
  116. package/lib/src/customtypes/diff/Changes.js +9 -0
  117. package/lib/src/customtypes/diff/SharedSlice.d.ts +1624 -0
  118. package/lib/src/customtypes/diff/SharedSlice.js +55 -0
  119. package/lib/src/customtypes/diff/Variation.d.ts +1605 -0
  120. package/lib/src/customtypes/diff/Variation.js +113 -0
  121. package/lib/src/customtypes/diff/Widgets.d.ts +11 -0
  122. package/lib/src/customtypes/diff/Widgets.js +2 -0
  123. package/lib/src/customtypes/diff/index.d.ts +4 -0
  124. package/lib/src/customtypes/diff/index.js +7 -0
  125. package/lib/src/customtypes/index.d.ts +4 -0
  126. package/lib/src/customtypes/index.js +7 -0
  127. package/lib/src/customtypes/widgets/Group.d.ts +1352 -0
  128. package/lib/src/customtypes/widgets/Group.js +92 -0
  129. package/lib/src/customtypes/widgets/UID.d.ts +19 -0
  130. package/lib/src/customtypes/widgets/UID.js +21 -0
  131. package/lib/src/customtypes/widgets/Widget.d.ts +4457 -0
  132. package/lib/src/customtypes/widgets/Widget.js +49 -0
  133. package/lib/src/customtypes/widgets/index.d.ts +6 -0
  134. package/lib/src/customtypes/widgets/index.js +9 -0
  135. package/lib/src/customtypes/widgets/nestable/BooleanField.d.ts +20 -0
  136. package/lib/src/customtypes/widgets/nestable/BooleanField.js +21 -0
  137. package/lib/src/customtypes/widgets/nestable/Color.d.ts +17 -0
  138. package/lib/src/customtypes/widgets/nestable/Color.js +20 -0
  139. package/lib/src/customtypes/widgets/nestable/Date.d.ts +19 -0
  140. package/lib/src/customtypes/widgets/nestable/Date.js +21 -0
  141. package/lib/src/customtypes/widgets/nestable/Embed.d.ts +19 -0
  142. package/lib/src/customtypes/widgets/nestable/Embed.js +21 -0
  143. package/lib/src/customtypes/widgets/nestable/GeoPoint.d.ts +15 -0
  144. package/lib/src/customtypes/widgets/nestable/GeoPoint.js +19 -0
  145. package/lib/src/customtypes/widgets/nestable/Image.d.ts +44 -0
  146. package/lib/src/customtypes/widgets/nestable/Image.js +29 -0
  147. package/lib/src/customtypes/widgets/nestable/IntegrationField.d.ts +19 -0
  148. package/lib/src/customtypes/widgets/nestable/IntegrationField.js +21 -0
  149. package/lib/src/customtypes/widgets/nestable/Link.d.ts +196 -0
  150. package/lib/src/customtypes/widgets/nestable/Link.js +167 -0
  151. package/lib/src/customtypes/widgets/nestable/NestableWidget.d.ts +217 -0
  152. package/lib/src/customtypes/widgets/nestable/NestableWidget.js +39 -0
  153. package/lib/src/customtypes/widgets/nestable/Number.d.ts +23 -0
  154. package/lib/src/customtypes/widgets/nestable/Number.js +24 -0
  155. package/lib/src/customtypes/widgets/nestable/Range.d.ts +23 -0
  156. package/lib/src/customtypes/widgets/nestable/Range.js +24 -0
  157. package/lib/src/customtypes/widgets/nestable/RichText.d.ts +73 -0
  158. package/lib/src/customtypes/widgets/nestable/RichText.js +131 -0
  159. package/lib/src/customtypes/widgets/nestable/Select.d.ts +21 -0
  160. package/lib/src/customtypes/widgets/nestable/Select.js +22 -0
  161. package/lib/src/customtypes/widgets/nestable/Separator.d.ts +14 -0
  162. package/lib/src/customtypes/widgets/nestable/Separator.js +18 -0
  163. package/lib/src/customtypes/widgets/nestable/Table.d.ts +21 -0
  164. package/lib/src/customtypes/widgets/nestable/Table.js +30 -0
  165. package/lib/src/customtypes/widgets/nestable/Text.d.ts +19 -0
  166. package/lib/src/customtypes/widgets/nestable/Text.js +21 -0
  167. package/lib/src/customtypes/widgets/nestable/Timestamp.d.ts +19 -0
  168. package/lib/src/customtypes/widgets/nestable/Timestamp.js +21 -0
  169. package/lib/src/customtypes/widgets/nestable/index.d.ts +17 -0
  170. package/lib/src/customtypes/widgets/nestable/index.js +20 -0
  171. package/lib/src/customtypes/widgets/shared/ImageConstraint.d.ts +7 -0
  172. package/lib/src/customtypes/widgets/shared/ImageConstraint.js +31 -0
  173. package/lib/src/customtypes/widgets/shared/index.d.ts +1 -0
  174. package/lib/src/customtypes/widgets/shared/index.js +8 -0
  175. package/lib/src/customtypes/widgets/slices/CompositeSlice.d.ts +455 -0
  176. package/lib/src/customtypes/widgets/slices/CompositeSlice.js +63 -0
  177. package/lib/src/customtypes/widgets/slices/LegacySlice.d.ts +442 -0
  178. package/lib/src/customtypes/widgets/slices/LegacySlice.js +12 -0
  179. package/lib/src/customtypes/widgets/slices/SharedSlice.d.ts +1807 -0
  180. package/lib/src/customtypes/widgets/slices/SharedSlice.js +118 -0
  181. package/lib/src/customtypes/widgets/slices/SharedSliceRef.d.ts +5 -0
  182. package/lib/src/customtypes/widgets/slices/SharedSliceRef.js +9 -0
  183. package/lib/src/customtypes/widgets/slices/Slice.d.ts +6 -0
  184. package/lib/src/customtypes/widgets/slices/Slice.js +2 -0
  185. package/lib/src/customtypes/widgets/slices/SlicePrimaryWidget.d.ts +1259 -0
  186. package/lib/src/customtypes/widgets/slices/SlicePrimaryWidget.js +10 -0
  187. package/lib/src/customtypes/widgets/slices/Slices.d.ts +5917 -0
  188. package/lib/src/customtypes/widgets/slices/Slices.js +146 -0
  189. package/lib/src/customtypes/widgets/slices/SlicesTypes.d.ts +6 -0
  190. package/lib/src/customtypes/widgets/slices/SlicesTypes.js +11 -0
  191. package/lib/src/customtypes/widgets/slices/index.d.ts +8 -0
  192. package/lib/src/customtypes/widgets/slices/index.js +11 -0
  193. package/lib/src/utils/Arrays.d.ts +1 -0
  194. package/lib/src/utils/Arrays.js +13 -0
  195. package/lib/src/utils/DocumentId.d.ts +2 -0
  196. package/lib/src/utils/DocumentId.js +7 -0
  197. package/lib/src/utils/Objects.d.ts +8 -0
  198. package/lib/src/utils/Objects.js +42 -0
  199. package/lib/src/utils/index.d.ts +3 -0
  200. package/lib/src/utils/index.js +7 -0
  201. package/lib/src/validators/BasicTypes.d.ts +10 -0
  202. package/lib/src/validators/BasicTypes.js +25 -0
  203. package/lib/src/validators/DateFromString.d.ts +3 -0
  204. package/lib/src/validators/DateFromString.js +11 -0
  205. package/lib/src/validators/DateFromStringOrNumber.d.ts +3 -0
  206. package/lib/src/validators/DateFromStringOrNumber.js +10 -0
  207. package/lib/src/validators/DateFromTsMs.d.ts +3 -0
  208. package/lib/src/validators/DateFromTsMs.js +10 -0
  209. package/lib/src/validators/DefaultOrElse.d.ts +5 -0
  210. package/lib/src/validators/DefaultOrElse.js +21 -0
  211. package/lib/src/validators/IntFromNumber.d.ts +5 -0
  212. package/lib/src/validators/IntFromNumber.js +14 -0
  213. package/lib/src/validators/IntFromPixels.d.ts +8 -0
  214. package/lib/src/validators/IntFromPixels.js +24 -0
  215. package/lib/src/validators/NonEmptyString.d.ts +3 -0
  216. package/lib/src/validators/NonEmptyString.js +6 -0
  217. package/lib/src/validators/NonEmptyStringOrNull.d.ts +3 -0
  218. package/lib/src/validators/NonEmptyStringOrNull.js +15 -0
  219. package/lib/src/validators/NumberOrNull.d.ts +3 -0
  220. package/lib/src/validators/NumberOrNull.js +6 -0
  221. package/lib/src/validators/NumberRange.d.ts +32 -0
  222. package/lib/src/validators/NumberRange.js +40 -0
  223. package/lib/src/validators/StringFromBoolean.d.ts +5 -0
  224. package/lib/src/validators/StringFromBoolean.js +10 -0
  225. package/lib/src/validators/StringFromNumber.d.ts +5 -0
  226. package/lib/src/validators/StringFromNumber.js +10 -0
  227. package/lib/src/validators/StringOrNull.d.ts +3 -0
  228. package/lib/src/validators/StringOrNull.js +6 -0
  229. package/lib/src/validators/TrimmedString.d.ts +5 -0
  230. package/lib/src/validators/TrimmedString.js +23 -0
  231. package/lib/src/validators/function.d.ts +34 -0
  232. package/lib/src/validators/function.js +100 -0
  233. package/lib/src/validators/index.d.ts +15 -0
  234. package/lib/src/validators/index.js +31 -0
  235. package/package.json +1 -1
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.traverseSlices = exports.Slices = exports.DynamicSlices = exports.StaticSlices = exports.slicesReader = exports.DynamicSlicesConfig = exports.StaticSlicesConfig = exports.slicesConfigReader = exports.SlicesLabels = exports.SlicesFieldType = exports.LegacySlicesFieldType = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
6
+ const common_1 = require("../../../common");
7
+ const validators_1 = require("../../../validators");
8
+ const Group_1 = require("../Group");
9
+ const CompositeSlice_1 = require("./CompositeSlice");
10
+ const LegacySlice_1 = require("./LegacySlice");
11
+ const SharedSlice_1 = require("./SharedSlice");
12
+ const SharedSliceRef_1 = require("./SharedSliceRef");
13
+ exports.LegacySlicesFieldType = "Choice";
14
+ exports.SlicesFieldType = "Slices";
15
+ exports.SlicesLabels = t.union([
16
+ t.record(t.string, t.readonlyArray(t.exact(t.intersection([
17
+ t.type({
18
+ name: t.string,
19
+ }),
20
+ t.partial({
21
+ display: t.string,
22
+ }),
23
+ ])))),
24
+ t.null,
25
+ ]);
26
+ function slicesConfigReader(codec) {
27
+ return t.exact(t.partial({
28
+ label: validators_1.StringOrNull,
29
+ labels: exports.SlicesLabels,
30
+ choices: t.record(common_1.WidgetKey, t.union([LegacySlice_1.LegacySlice, CompositeSlice_1.CompositeSlice, codec])),
31
+ }));
32
+ }
33
+ exports.slicesConfigReader = slicesConfigReader;
34
+ exports.StaticSlicesConfig = slicesConfigReader(SharedSlice_1.SharedSlice);
35
+ exports.DynamicSlicesConfig = slicesConfigReader(SharedSliceRef_1.SharedSliceRef);
36
+ const SlicesConfig = {
37
+ toStatic(config, sharedSlices) {
38
+ const choices = Object.entries(config.choices || {}).reduce((acc, [ref, slice]) => {
39
+ if (slice.type === "SharedSlice") {
40
+ const sharedSlice = sharedSlices.get(ref);
41
+ if (sharedSlice)
42
+ return { ...acc, [ref]: sharedSlice };
43
+ else
44
+ return acc;
45
+ }
46
+ else {
47
+ return { ...acc, [ref]: slice };
48
+ }
49
+ }, {});
50
+ return { ...config, choices };
51
+ },
52
+ };
53
+ function slicesReader(codec) {
54
+ return t.exact(t.intersection([
55
+ t.type({
56
+ type: t.keyof({
57
+ [exports.SlicesFieldType]: null,
58
+ [exports.LegacySlicesFieldType]: null,
59
+ }),
60
+ }),
61
+ t.partial({
62
+ fieldset: validators_1.StringOrNull,
63
+ config: codec,
64
+ }),
65
+ ]));
66
+ }
67
+ exports.slicesReader = slicesReader;
68
+ exports.StaticSlices = slicesReader(exports.StaticSlicesConfig);
69
+ exports.DynamicSlices = slicesReader(exports.DynamicSlicesConfig);
70
+ exports.Slices = {
71
+ toStatic(slices, sharedSlices) {
72
+ if (!slices.config)
73
+ return slices;
74
+ else {
75
+ return {
76
+ ...slices,
77
+ config: SlicesConfig.toStatic(slices.config, sharedSlices),
78
+ };
79
+ }
80
+ },
81
+ };
82
+ function traverseSlices(args) {
83
+ var _a;
84
+ const { path: prevPath, slices, onField } = args;
85
+ if (!((_a = slices.config) === null || _a === void 0 ? void 0 : _a.choices))
86
+ return slices;
87
+ let choices;
88
+ for (const [key, prevModel] of Object.entries(slices.config.choices)) {
89
+ const path = [...prevPath, key];
90
+ let model;
91
+ switch (prevModel.type) {
92
+ case "Slice":
93
+ model = (0, CompositeSlice_1.traverseCompositeSlice)({
94
+ path,
95
+ slice: prevModel,
96
+ onField: onField,
97
+ });
98
+ break;
99
+ case "SharedSlice":
100
+ if ("variations" in prevModel)
101
+ model = (0, SharedSlice_1.traverseSharedSlice)({
102
+ path,
103
+ slice: prevModel,
104
+ onField,
105
+ });
106
+ else
107
+ model = prevModel;
108
+ break;
109
+ // Group and other fields are technically possible because of legacy slices.
110
+ case "Group":
111
+ model = onField({
112
+ path,
113
+ key,
114
+ field: (0, Group_1.traverseNestedGroup)({
115
+ path,
116
+ group: prevModel,
117
+ onField: onField,
118
+ }),
119
+ });
120
+ break;
121
+ default:
122
+ model = onField({
123
+ path,
124
+ key,
125
+ field: prevModel,
126
+ });
127
+ break;
128
+ }
129
+ if (model !== prevModel) {
130
+ if (!choices)
131
+ choices = { ...slices.config.choices };
132
+ choices[key] = model;
133
+ }
134
+ }
135
+ // returns the traversed model instead of a new one if it didn't change
136
+ return choices
137
+ ? {
138
+ ...slices,
139
+ config: {
140
+ ...slices.config,
141
+ choices,
142
+ },
143
+ }
144
+ : slices;
145
+ }
146
+ exports.traverseSlices = traverseSlices;
@@ -0,0 +1,6 @@
1
+ import * as t from "io-ts";
2
+ export declare const SlicesTypes: t.KeyofC<{
3
+ Slice: null;
4
+ SharedSlice: null;
5
+ }>;
6
+ export declare type SlicesTypes = t.TypeOf<typeof SlicesTypes>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlicesTypes = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
6
+ const CompositeSlice_1 = require("./CompositeSlice");
7
+ const SharedSlice_1 = require("./SharedSlice");
8
+ exports.SlicesTypes = t.keyof({
9
+ [CompositeSlice_1.CompositeSliceType]: null,
10
+ [SharedSlice_1.SharedSliceType]: null,
11
+ });
@@ -0,0 +1,8 @@
1
+ export * from "./CompositeSlice";
2
+ export * from "./LegacySlice";
3
+ export * from "./SharedSlice";
4
+ export * from "./SharedSliceRef";
5
+ export * from "./Slice";
6
+ export * from "./SlicePrimaryWidget";
7
+ export * from "./Slices";
8
+ export * from "./SlicesTypes";
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ (0, tslib_1.__exportStar)(require("./CompositeSlice"), exports);
5
+ (0, tslib_1.__exportStar)(require("./LegacySlice"), exports);
6
+ (0, tslib_1.__exportStar)(require("./SharedSlice"), exports);
7
+ (0, tslib_1.__exportStar)(require("./SharedSliceRef"), exports);
8
+ (0, tslib_1.__exportStar)(require("./Slice"), exports);
9
+ (0, tslib_1.__exportStar)(require("./SlicePrimaryWidget"), exports);
10
+ (0, tslib_1.__exportStar)(require("./Slices"), exports);
11
+ (0, tslib_1.__exportStar)(require("./SlicesTypes"), exports);
@@ -0,0 +1 @@
1
+ export declare function toRecord<A extends object>(arr: ReadonlyArray<A>, key: (obj: A) => string): {};
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toRecord = void 0;
4
+ function toRecord(arr, key) {
5
+ return arr.reduce((acc, entry) => {
6
+ const k = key(entry);
7
+ return {
8
+ ...acc,
9
+ [k]: entry,
10
+ };
11
+ }, {});
12
+ }
13
+ exports.toRecord = toRecord;
@@ -0,0 +1,2 @@
1
+ import * as t from "io-ts";
2
+ export declare const DocumentId: t.Type<string, string, unknown>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentId = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
6
+ const function_1 = require("../validators/function");
7
+ exports.DocumentId = (0, function_1.withCustomError)((0, function_1.refineType)(t.string, "DocumentId", (s) => s.length === 16), () => "DocumentId must be a 16 character string");
@@ -0,0 +1,8 @@
1
+ export declare function zipObjects<A, B = A>(objLeft?: Partial<Record<string, A>> | undefined, objRight?: Partial<Record<string, B>> | undefined): Partial<Record<string, {
2
+ left?: A | undefined;
3
+ right?: B | undefined;
4
+ }>>;
5
+ export declare function isNotEmpty<A extends object>(obj: A): boolean;
6
+ export declare function withOptionals<T extends object>(object: T, optionals: Array<[keyof T, T[keyof T] | null | undefined]>): T;
7
+ export declare function isObject(value: unknown): value is Record<string, unknown>;
8
+ export declare function mapValues<T, O>(record: Record<string, T>, fn: (value: T, key: string) => O): Record<string, O>;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapValues = exports.isObject = exports.withOptionals = exports.isNotEmpty = exports.zipObjects = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const Either_1 = require("fp-ts/lib/Either");
6
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
7
+ function zipObjects(objLeft, objRight) {
8
+ const allKeys = [
9
+ ...new Set(Object.keys(objLeft || {}).concat(Object.keys(objRight || {}))),
10
+ ];
11
+ return allKeys.reduce((acc, key) => {
12
+ const left = objLeft === null || objLeft === void 0 ? void 0 : objLeft[key];
13
+ const right = objRight === null || objRight === void 0 ? void 0 : objRight[key];
14
+ return {
15
+ ...acc,
16
+ [key]: { left, right },
17
+ };
18
+ }, {});
19
+ }
20
+ exports.zipObjects = zipObjects;
21
+ function isNotEmpty(obj) {
22
+ return Boolean(Object.keys(obj).length);
23
+ }
24
+ exports.isNotEmpty = isNotEmpty;
25
+ function withOptionals(object, optionals) {
26
+ return {
27
+ ...object,
28
+ ...optionals.reduce((acc, [key, value]) => {
29
+ return value ? { ...acc, [key]: value } : acc;
30
+ }, {}),
31
+ };
32
+ }
33
+ exports.withOptionals = withOptionals;
34
+ const recordCodec = t.record(t.string, t.unknown);
35
+ function isObject(value) {
36
+ return (0, Either_1.isRight)(recordCodec.decode(value));
37
+ }
38
+ exports.isObject = isObject;
39
+ function mapValues(record, fn) {
40
+ return Object.entries(record).reduce((acc, [key, value]) => ({ ...acc, [key]: fn(value, key) }), {});
41
+ }
42
+ exports.mapValues = mapValues;
@@ -0,0 +1,3 @@
1
+ export * as HexaColorCode from "../common/HexaColorCode";
2
+ export * as Arrays from "./Arrays";
3
+ export * as Objects from "./Objects";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Objects = exports.Arrays = exports.HexaColorCode = void 0;
4
+ const tslib_1 = require("tslib");
5
+ exports.HexaColorCode = (0, tslib_1.__importStar)(require("../common/HexaColorCode"));
6
+ exports.Arrays = (0, tslib_1.__importStar)(require("./Arrays"));
7
+ exports.Objects = (0, tslib_1.__importStar)(require("./Objects"));
@@ -0,0 +1,10 @@
1
+ import * as t from "io-ts";
2
+ export declare const String: t.StringC;
3
+ export declare const StringOrNull: t.UnionC<[t.StringC, t.NullC]>;
4
+ export declare const Number: t.NumberC;
5
+ export declare const NumberOrNull: t.UnionC<[t.NumberC, t.NullC]>;
6
+ export declare const Boolean: t.BooleanC;
7
+ export declare const EmptyObject: t.Type<Record<never, never>, {
8
+ [key: string]: unknown;
9
+ }, unknown>;
10
+ export declare const EmptyArray: t.Type<never[], never[], unknown>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmptyArray = exports.EmptyObject = exports.Boolean = exports.NumberOrNull = exports.Number = exports.StringOrNull = exports.String = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const fp_ts_1 = require("fp-ts");
6
+ const function_1 = require("fp-ts/lib/function");
7
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
8
+ const function_2 = require("./function");
9
+ exports.String = (0, function_2.withCustomError)(t.string, () => "The value must be a string");
10
+ exports.StringOrNull = (0, function_2.withCustomError)(t.union([t.string, t.null]), () => "The value must be a string or null");
11
+ exports.Number = (0, function_2.withCustomError)(t.number, () => "The value must be a number");
12
+ exports.NumberOrNull = (0, function_2.withCustomError)(t.union([t.number, t.null]), () => "The value must be a number or null");
13
+ exports.Boolean = (0, function_2.withCustomError)(t.boolean, () => "The value must be a boolean");
14
+ exports.EmptyObject = t.UnknownRecord.pipe(new t.Type("emptyObject", (u) => t.UnknownRecord.is(u), (u, c) => {
15
+ if (Object.keys(u).length > 0)
16
+ return t.failure(u, c, "The object is not empty.");
17
+ return t.success({});
18
+ }, t.identity));
19
+ exports.EmptyArray = new t.Type("emptyArray", (u) => t.UnknownArray.is(u) && u.length === 0, (u, c) => {
20
+ return (0, function_1.pipe)(t.UnknownArray.decode(u), fp_ts_1.either.chain((parsedArray) => {
21
+ if (parsedArray.length > 0)
22
+ return t.failure(u, c, "The array is not empty.");
23
+ return t.success(new Array());
24
+ }));
25
+ }, () => []);
@@ -0,0 +1,3 @@
1
+ import * as t from "io-ts";
2
+ declare const _default: t.Type<Date, string, unknown>;
3
+ export default _default;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Either_1 = require("fp-ts/Either");
5
+ const function_1 = require("fp-ts/function");
6
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
7
+ const _1 = require(".");
8
+ exports.default = new t.Type("dateFromString", (u) => u instanceof Date, (u, c) => (0, function_1.pipe)(_1.String.validate(u, c), (0, Either_1.chain)((s) => {
9
+ const d = new Date(s);
10
+ return isNaN(d.getTime()) ? t.failure(u, c) : t.success(d);
11
+ })), (date) => date.toISOString());
@@ -0,0 +1,3 @@
1
+ import * as t from "io-ts";
2
+ declare const _default: t.Type<Date, Date, unknown>;
3
+ export default _default;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Either_1 = require("fp-ts/Either");
5
+ const function_1 = require("fp-ts/function");
6
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
7
+ exports.default = new t.Type("dateFromStringOrNumber", (u) => u instanceof Date, (u, c) => (0, function_1.pipe)(t.union([t.number, t.string]).validate(u, c), (0, Either_1.chain)((s) => {
8
+ const d = new Date(s);
9
+ return isNaN(d.getTime()) ? t.failure(u, c) : t.success(d);
10
+ })), (date) => date);
@@ -0,0 +1,3 @@
1
+ import * as t from "io-ts";
2
+ declare const _default: t.Type<Date, number, unknown>;
3
+ export default _default;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Either_1 = require("fp-ts/Either");
5
+ const function_1 = require("fp-ts/function");
6
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
7
+ exports.default = new t.Type("dateFromTsMs", (u) => u instanceof Date, (u, c) => (0, function_1.pipe)(t.number.validate(u, c), (0, Either_1.chain)((s) => {
8
+ const d = new Date(s);
9
+ return isNaN(d.getTime()) ? t.failure(u, c) : t.success(d);
10
+ })), (date) => date.getTime());
@@ -0,0 +1,5 @@
1
+ import * as t from "io-ts";
2
+ export declare const DefaultOrElse: <I, A, O = A>(inputValidator: t.Type<I, I, unknown>) => (codec: t.Type<A, O, unknown>) => t.Type<A | null, O | undefined, unknown>;
3
+ export declare const NullOrElse: <A, O = A>(codec: t.Type<A, O, unknown>) => t.Type<A | null, O | undefined, unknown>;
4
+ export declare const EmptyObjectOrElse: <A, O = A>(codec: t.Type<A, O, unknown>) => t.Type<A | null, O | undefined, unknown>;
5
+ export declare const EmptyArrayOrElse: <A, O = A>(codec: t.Type<A, O, unknown>) => t.Type<A | null, O | undefined, unknown>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmptyArrayOrElse = exports.EmptyObjectOrElse = exports.NullOrElse = exports.DefaultOrElse = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const Either_1 = require("fp-ts/lib/Either");
6
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
7
+ const BasicTypes_1 = require("./BasicTypes");
8
+ const DefaultOrElse = (inputValidator) => {
9
+ return (codec) => new t.Type(`DefaultOrElse<${inputValidator.name}, ${codec.name}>`, (u) => null === u || codec.is(u), (u, c) => {
10
+ if ((0, Either_1.isRight)(inputValidator.validate(u, c)))
11
+ return t.success(null);
12
+ return codec.validate(u, c);
13
+ }, (chunk) => (chunk ? codec.encode(chunk) : undefined));
14
+ };
15
+ exports.DefaultOrElse = DefaultOrElse;
16
+ const NullOrElse = (codec) => (0, exports.DefaultOrElse)(t.null)(codec);
17
+ exports.NullOrElse = NullOrElse;
18
+ const EmptyObjectOrElse = (codec) => (0, exports.DefaultOrElse)(BasicTypes_1.EmptyObject)(codec);
19
+ exports.EmptyObjectOrElse = EmptyObjectOrElse;
20
+ const EmptyArrayOrElse = (codec) => (0, exports.DefaultOrElse)(BasicTypes_1.EmptyArray)(codec);
21
+ exports.EmptyArrayOrElse = EmptyArrayOrElse;
@@ -0,0 +1,5 @@
1
+ import * as t from "io-ts";
2
+ export declare type IntFromNumberC = t.Type<t.Int, number, unknown>;
3
+ declare const _default: t.Type<t.Int, number, unknown>;
4
+ /** A codec that succeeds if a number can be parsed to an integer */
5
+ export default _default;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Either_1 = require("fp-ts/Either");
5
+ const function_1 = require("fp-ts/function");
6
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
7
+ /** A codec that succeeds if a number can be parsed to an integer */
8
+ exports.default = new t.Type("IntFromNumber", t.Int.is, (u, c) => (0, function_1.pipe)(t.number.validate(u, c), (0, Either_1.chain)((n) => {
9
+ if (t.Int.is(n))
10
+ return t.success(n);
11
+ else {
12
+ return t.success(Math.round(n));
13
+ }
14
+ })), t.Int.encode);
@@ -0,0 +1,8 @@
1
+ import * as t from "io-ts";
2
+ export declare type IntFromPixelsC = t.Type<t.Int, string, unknown>;
3
+ declare const _default: t.Type<t.Int, string, unknown>;
4
+ /**
5
+ * A codec that succeeds if a string representing pixels (eg: "200px") can be
6
+ * parsed to an integer
7
+ */
8
+ export default _default;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Either_1 = require("fp-ts/Either");
5
+ const function_1 = require("fp-ts/function");
6
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
7
+ const PixelsRegex = /^([0-9]+)px$/;
8
+ /**
9
+ * A codec that succeeds if a string representing pixels (eg: "200px") can be
10
+ * parsed to an integer
11
+ */
12
+ exports.default = new t.Type("IntFromPixels", t.Int.is, (u, c) => (0, function_1.pipe)(t.string.validate(u, c), (0, Either_1.chain)((strPixels) => {
13
+ try {
14
+ const matched = strPixels.match(PixelsRegex);
15
+ if (!matched)
16
+ return t.failure(u, c);
17
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
18
+ const parsed = parseInt(matched[1]);
19
+ return t.success(parsed);
20
+ }
21
+ catch {
22
+ return t.failure(u, c);
23
+ }
24
+ })), String);
@@ -0,0 +1,3 @@
1
+ import * as t from "io-ts";
2
+ declare const _default: t.Type<string, string, unknown>;
3
+ export default _default;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
5
+ const function_1 = require("./function");
6
+ exports.default = (0, function_1.withCustomError)((0, function_1.refineType)(t.string, "nonEmptyString", (s) => s.trim().length > 0), () => "The value must be a non-empty string");
@@ -0,0 +1,3 @@
1
+ import { Type } from "io-ts";
2
+ declare const _default: Type<string | null, string | null, unknown>;
3
+ export default _default;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Either_1 = require("fp-ts/Either");
5
+ const function_1 = require("fp-ts/function");
6
+ const io_ts_1 = require("io-ts");
7
+ const StringOrNull_1 = (0, tslib_1.__importDefault)(require("./StringOrNull"));
8
+ exports.default = new io_ts_1.Type("nonEmptyStringOrNull", (u) => typeof u === "string" || u === null, (u, c) => (0, function_1.pipe)(StringOrNull_1.default.validate(u, c), (0, Either_1.chain)((s) => {
9
+ if (typeof s === "string" && s.length > 0) {
10
+ return (0, io_ts_1.success)(s);
11
+ }
12
+ else {
13
+ return (0, io_ts_1.success)(null);
14
+ }
15
+ })), (s) => s);
@@ -0,0 +1,3 @@
1
+ import * as t from "io-ts";
2
+ declare const _default: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
3
+ export default _default;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
5
+ const function_1 = require("./function");
6
+ exports.default = (0, function_1.nullable)(t.number);
@@ -0,0 +1,32 @@
1
+ import * as t from "io-ts";
2
+ declare const _default: (min: number, max: number, fieldName: string) => t.Type<number, number, unknown>;
3
+ /**
4
+ * Creates a custom runtime type for validating that a number falls within a specified range.
5
+ *
6
+ * @param min - The minimum value of the range.
7
+ * @param max - The maximum value of the range.
8
+ * @param fieldName - The name of the field being validated (used in error messages).
9
+ * @returns A runtime type representing the number range validation.
10
+ *
11
+ * * @example
12
+ * // Creating a custom runtime type for age validation
13
+ * const AgeType = numberInRange(18, 99, 'Age');
14
+ *
15
+ * // Valid age
16
+ * const validAgeResult = AgeType.decode(25);
17
+ * if (t.isRight(validAgeResult)) {
18
+ * console.log('Valid age:', validAgeResult.right); // Output: Valid age: 25
19
+ * } else {
20
+ * console.error('Invalid age:', t.left(validAgeResult).map(t.reporter.report));
21
+ * }
22
+ *
23
+ * @example
24
+ * // Invalid age
25
+ * const invalidAgeResult = AgeType.decode(15);
26
+ * if (t.isRight(invalidAgeResult)) {
27
+ * console.log('Valid age:', invalidAgeResult.right);
28
+ * } else {
29
+ * console.error('Invalid age:', t.left(invalidAgeResult).map(t.reporter.report));
30
+ * }
31
+ */
32
+ export default _default;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
5
+ const BasicTypes_1 = require("./BasicTypes");
6
+ /**
7
+ * Creates a custom runtime type for validating that a number falls within a specified range.
8
+ *
9
+ * @param min - The minimum value of the range.
10
+ * @param max - The maximum value of the range.
11
+ * @param fieldName - The name of the field being validated (used in error messages).
12
+ * @returns A runtime type representing the number range validation.
13
+ *
14
+ * * @example
15
+ * // Creating a custom runtime type for age validation
16
+ * const AgeType = numberInRange(18, 99, 'Age');
17
+ *
18
+ * // Valid age
19
+ * const validAgeResult = AgeType.decode(25);
20
+ * if (t.isRight(validAgeResult)) {
21
+ * console.log('Valid age:', validAgeResult.right); // Output: Valid age: 25
22
+ * } else {
23
+ * console.error('Invalid age:', t.left(validAgeResult).map(t.reporter.report));
24
+ * }
25
+ *
26
+ * @example
27
+ * // Invalid age
28
+ * const invalidAgeResult = AgeType.decode(15);
29
+ * if (t.isRight(invalidAgeResult)) {
30
+ * console.log('Valid age:', invalidAgeResult.right);
31
+ * } else {
32
+ * console.error('Invalid age:', t.left(invalidAgeResult).map(t.reporter.report));
33
+ * }
34
+ */
35
+ exports.default = (min, max, fieldName) => BasicTypes_1.Number.pipe(new t.Type("numberInRange", (u) => BasicTypes_1.Number.is(u), (u, context) => {
36
+ if (u > max || u < min) {
37
+ return t.failure(u, context, `${fieldName} must be a number between ${min} and ${max}`);
38
+ }
39
+ return t.success(u);
40
+ }, t.identity));
@@ -0,0 +1,5 @@
1
+ import * as t from "io-ts";
2
+ export declare type StringFromBooleanC = t.Type<string, string, unknown>;
3
+ declare const _default: t.Type<string, string, unknown>;
4
+ /** A codec that validates a Boolean and convert it as a string */
5
+ export default _default;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Either_1 = require("fp-ts/Either");
5
+ const function_1 = require("fp-ts/function");
6
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
7
+ /** A codec that validates a Boolean and convert it as a string */
8
+ exports.default = new t.Type("StringFromInt", t.string.is, (u, c) => (0, function_1.pipe)(t.boolean.validate(u, c), (0, Either_1.chain)((i) => {
9
+ return t.success(i.toString());
10
+ })), (i) => i);
@@ -0,0 +1,5 @@
1
+ import * as t from "io-ts";
2
+ export declare type StringFromNumberC = t.Type<string, string, unknown>;
3
+ declare const _default: t.Type<string, string, unknown>;
4
+ /** A codec that validates a number and convert it as a string */
5
+ export default _default;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const Either_1 = require("fp-ts/Either");
5
+ const function_1 = require("fp-ts/function");
6
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
7
+ /** A codec that validates a number and convert it as a string */
8
+ exports.default = new t.Type("StringFromInt", t.string.is, (u, c) => (0, function_1.pipe)(t.number.validate(u, c), (0, Either_1.chain)((i) => {
9
+ return t.success(i.toString());
10
+ })), (i) => i);
@@ -0,0 +1,3 @@
1
+ import * as t from "io-ts";
2
+ declare const _default: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
3
+ export default _default;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const t = (0, tslib_1.__importStar)(require("io-ts"));
5
+ const function_1 = require("./function");
6
+ exports.default = (0, function_1.nullable)(t.string);
@@ -0,0 +1,5 @@
1
+ import * as t from "io-ts";
2
+ export declare type TrimmedStringC = t.Type<string, string, unknown>;
3
+ declare const _default: t.Type<string, string, unknown>;
4
+ /** A codec that validates a Boolean and convert it as a string */
5
+ export default _default;