@prismicio/types-internal 2.4.0-alpha.3 → 2.4.0-alpha.4

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.
@@ -13,6 +13,10 @@ const fields_1 = require("./fields");
13
13
  const LegacyContentCtx_1 = require("./LegacyContentCtx");
14
14
  exports.Document = t.record(common_1.WidgetKey, fields_1.WidgetContent);
15
15
  const legacyDocReader = t.record(common_1.WidgetKey, t.unknown);
16
+ /**
17
+ * `DocumentLegacyCodec` handles decoding and encoding documents to the legacy
18
+ * format used by Prismic DB, therefore, this function itself is not "legacy".
19
+ */
16
20
  const DocumentLegacyCodec = (allTypes) => {
17
21
  return new t.Type("Document", (u) => !!u && typeof u === "object", (doc) => {
18
22
  return (0, function_1.pipe)(legacyDocReader.decode(doc), fp_ts_1.either.map((parsedDoc) => {
@@ -1760,6 +1760,7 @@ export declare const GroupContent: t.ExactC<t.TypeC<{
1760
1760
  }>>>;
1761
1761
  }>>;
1762
1762
  export declare type GroupContent = t.TypeOf<typeof GroupContent>;
1763
+ export declare const GroupContentDefaultValue: GroupContent;
1763
1764
  export declare function groupContentWithDefaultValues(customType: Group, content: GroupContent): GroupContent;
1764
1765
  export declare function traverseGroupContent({ path, key, apiId, model, content, }: {
1765
1766
  path: ContentPath;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.traverseGroupItemsContent = exports.traverseGroupContent = exports.groupContentWithDefaultValues = exports.GroupContent = exports.isGroupContent = exports.GroupContentType = exports.GroupLegacy = exports.GroupItemLegacy = exports.GroupItemContent = exports.GroupItemContentType = void 0;
3
+ exports.traverseGroupItemsContent = exports.traverseGroupContent = exports.groupContentWithDefaultValues = exports.GroupContentDefaultValue = exports.GroupContent = exports.isGroupContent = exports.GroupContentType = exports.GroupLegacy = exports.GroupItemLegacy = exports.GroupItemContent = exports.GroupItemContentType = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const fp_ts_1 = require("fp-ts");
6
6
  const Either_1 = require("fp-ts/lib/Either");
@@ -82,6 +82,10 @@ exports.GroupContent = t.strict({
82
82
  __TYPE__: t.literal(exports.GroupContentType),
83
83
  value: t.array(exports.GroupItemContent),
84
84
  });
85
+ exports.GroupContentDefaultValue = {
86
+ __TYPE__: exports.GroupContentType,
87
+ value: [],
88
+ };
85
89
  function groupContentWithDefaultValues(customType, content) {
86
90
  var _a;
87
91
  const fields = (_a = customType.config) === null || _a === void 0 ? void 0 : _a.fields;