@prismicio/types-internal 2.0.0-alpha.4 → 2.0.0-alpha.6

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 (48) hide show
  1. package/lib/content/Document.d.ts +72 -616
  2. package/lib/content/Document.js +4 -3
  3. package/lib/content/fields/GroupContent.d.ts +23 -193
  4. package/lib/content/fields/GroupContent.js +3 -3
  5. package/lib/content/fields/WidgetContent.d.ts +104 -920
  6. package/lib/content/fields/nestable/EmbedContent.d.ts +30 -45
  7. package/lib/content/fields/nestable/EmbedContent.js +25 -12
  8. package/lib/content/fields/nestable/LinkContent.d.ts +8 -8
  9. package/lib/content/fields/nestable/LinkContent.js +1 -1
  10. package/lib/content/fields/nestable/NestableContent.d.ts +14 -115
  11. package/lib/content/fields/nestable/NestableContent.js +2 -1
  12. package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +11 -78
  13. package/lib/content/fields/nestable/RichTextContent/Blocks.js +5 -5
  14. package/lib/content/fields/nestable/RichTextContent/index.d.ts +9 -77
  15. package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +26 -230
  16. package/lib/content/fields/slices/Slice/CompositeSliceContent.js +4 -4
  17. package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +9 -77
  18. package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +26 -230
  19. package/lib/content/fields/slices/Slice/SharedSliceContent.js +4 -4
  20. package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +22 -192
  21. package/lib/content/fields/slices/Slice/index.d.ts +50 -424
  22. package/lib/content/fields/slices/SliceItem.d.ts +54 -462
  23. package/lib/content/fields/slices/SliceItem.js +2 -1
  24. package/lib/content/fields/slices/SlicesContent.d.ts +78 -690
  25. package/lib/content/utils.js +3 -3
  26. package/lib/customtypes/index.d.ts +2 -2
  27. package/lib/customtypes/index.js +2 -3
  28. package/lib/customtypes/widgets/nestable/RichText.d.ts +1 -1
  29. package/lib/customtypes/widgets/nestable/RichText.js +10 -10
  30. package/lib/customtypes/widgets/slices/Slices.d.ts +12 -3
  31. package/lib/customtypes/widgets/slices/Slices.js +4 -4
  32. package/lib/customtypes/widgets/slices/index.d.ts +6 -6
  33. package/lib/customtypes/widgets/slices/index.js +6 -11
  34. package/package.json +1 -1
  35. package/src/content/Document.ts +4 -3
  36. package/src/content/fields/GroupContent.ts +4 -4
  37. package/src/content/fields/nestable/EmbedContent.ts +52 -28
  38. package/src/content/fields/nestable/LinkContent.ts +1 -1
  39. package/src/content/fields/nestable/NestableContent.ts +2 -1
  40. package/src/content/fields/nestable/RichTextContent/Blocks.ts +6 -5
  41. package/src/content/fields/slices/Slice/CompositeSliceContent.ts +4 -3
  42. package/src/content/fields/slices/Slice/SharedSliceContent.ts +4 -3
  43. package/src/content/fields/slices/SliceItem.ts +2 -2
  44. package/src/content/utils.ts +4 -5
  45. package/src/customtypes/index.ts +2 -2
  46. package/src/customtypes/widgets/nestable/RichText.ts +16 -16
  47. package/src/customtypes/widgets/slices/Slices.ts +4 -4
  48. package/src/customtypes/widgets/slices/index.ts +6 -6
@@ -1,24 +1,7 @@
1
1
  import * as t from "io-ts";
2
2
  import type { LegacyContentCtx, WithTypes } from "../../LegacyContentCtx";
3
3
  export declare const EmbedContentType = "EmbedContent";
4
- export declare const isEmbedContent: (u: unknown) => u is {
5
- embed_url: string;
6
- type: string;
7
- } & {
8
- version?: string | number | null;
9
- title?: string | null | undefined;
10
- author_name?: string | null | undefined;
11
- author_url?: string | null | undefined;
12
- provider_name?: string | null | undefined;
13
- provider_url?: string | null | undefined;
14
- cache_age?: string | number | null;
15
- thumbnail_url?: string | null | undefined;
16
- thumbnail_width?: number | null | undefined;
17
- thumbnail_height?: number | null | undefined;
18
- html?: string | null | undefined;
19
- } & {
20
- __TYPE__: "EmbedContent";
21
- };
4
+ export declare const isEmbedContent: (u: unknown) => u is EmbedContent;
22
5
  export declare const EmbedContentLegacy: t.ExactC<t.IntersectionC<[t.TypeC<{
23
6
  embed_url: t.StringC;
24
7
  type: t.StringC;
@@ -35,8 +18,8 @@ export declare const EmbedContentLegacy: t.ExactC<t.IntersectionC<[t.TypeC<{
35
18
  thumbnail_height: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
36
19
  html: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
37
20
  }>]>>;
38
- export type EmbedLegacy = t.TypeOf<typeof EmbedContentLegacy>;
39
- export declare const EmbedLegacy: (ctx: LegacyContentCtx) => t.Type<{
21
+ type EmbedLegacy = t.TypeOf<typeof EmbedContentLegacy>;
22
+ export declare const EmbedLegacy: (ctx: LegacyContentCtx) => t.Type<EmbedContent, WithTypes<{
40
23
  embed_url: string;
41
24
  type: string;
42
25
  } & {
@@ -51,13 +34,33 @@ export declare const EmbedLegacy: (ctx: LegacyContentCtx) => t.Type<{
51
34
  thumbnail_width?: number | null | undefined;
52
35
  thumbnail_height?: number | null | undefined;
53
36
  html?: string | null | undefined;
54
- } & {
55
- __TYPE__: "EmbedContent";
56
- }, WithTypes<{
57
- embed_url: string;
37
+ }>, unknown>;
38
+ export type EmbedContent = EmbedLegacy & {
39
+ __TYPE__: typeof EmbedContentType;
40
+ all: unknown;
41
+ };
42
+ export declare const EmbedContent: t.Type<EmbedContent, EmbedContent, unknown>;
43
+ export declare function buildEmbedContent(embed: Omit<EmbedContent, "all">): {
44
+ all: {
45
+ embed_url: string;
46
+ type: string;
47
+ } & {
48
+ version?: string | number | null;
49
+ title?: string | null | undefined;
50
+ author_name?: string | null | undefined;
51
+ author_url?: string | null | undefined;
52
+ provider_name?: string | null | undefined;
53
+ provider_url?: string | null | undefined;
54
+ cache_age?: string | number | null;
55
+ thumbnail_url?: string | null | undefined;
56
+ thumbnail_width?: number | null | undefined;
57
+ thumbnail_height?: number | null | undefined;
58
+ html?: string | null | undefined;
59
+ };
58
60
  type: string;
59
- } & {
60
61
  version?: string | number | null;
62
+ __TYPE__: "EmbedContent";
63
+ embed_url: string;
61
64
  title?: string | null | undefined;
62
65
  author_name?: string | null | undefined;
63
66
  author_url?: string | null | undefined;
@@ -68,23 +71,5 @@ export declare const EmbedLegacy: (ctx: LegacyContentCtx) => t.Type<{
68
71
  thumbnail_width?: number | null | undefined;
69
72
  thumbnail_height?: number | null | undefined;
70
73
  html?: string | null | undefined;
71
- }>, unknown>;
72
- export declare const EmbedContent: t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
73
- embed_url: t.StringC;
74
- type: t.StringC;
75
- }>, t.PartialC<{
76
- version: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
77
- title: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
78
- author_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
79
- author_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
80
- provider_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
81
- provider_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
82
- cache_age: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
83
- thumbnail_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
84
- thumbnail_width: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
85
- thumbnail_height: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
86
- html: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
87
- }>]>>, t.ExactC<t.TypeC<{
88
- __TYPE__: t.LiteralC<"EmbedContent">;
89
- }>>]>;
90
- export type EmbedContent = t.TypeOf<typeof EmbedContent>;
74
+ };
75
+ export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EmbedContent = exports.EmbedLegacy = exports.EmbedContentLegacy = exports.isEmbedContent = exports.EmbedContentType = void 0;
3
+ exports.buildEmbedContent = exports.EmbedContent = exports.EmbedLegacy = exports.EmbedContentLegacy = exports.isEmbedContent = exports.EmbedContentType = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const fp_ts_1 = require("fp-ts");
6
6
  const function_1 = require("fp-ts/lib/function");
@@ -31,13 +31,33 @@ exports.EmbedContentLegacy = t.exact(t.intersection([
31
31
  }),
32
32
  ]));
33
33
  const EmbedLegacy = (ctx) => new t.Type("EmbedLegacy", exports.isEmbedContent, (u) => {
34
- return (0, function_1.pipe)(exports.EmbedContentLegacy.decode(u), fp_ts_1.either.map((embed) => exports.EmbedContent.encode({
34
+ return (0, function_1.pipe)(exports.EmbedContentLegacy.decode(u), fp_ts_1.either.map((embed) => buildEmbedContent({
35
35
  ...embed,
36
36
  __TYPE__: exports.EmbedContentType,
37
37
  })));
38
38
  }, (embed) => {
39
39
  return {
40
- content: (0, Objects_1.withOptionals)({
40
+ content: buildEmbedContent(embed).all,
41
+ types: { [ctx.keyOfType]: "Embed" },
42
+ };
43
+ });
44
+ exports.EmbedLegacy = EmbedLegacy;
45
+ exports.EmbedContent = new t.Type("EmbedContent", exports.isEmbedContent, (u) => {
46
+ return (0, function_1.pipe)(t
47
+ .intersection([
48
+ exports.EmbedContentLegacy,
49
+ t.strict({
50
+ __TYPE__: t.literal(exports.EmbedContentType),
51
+ }),
52
+ ])
53
+ .decode(u), fp_ts_1.either.map((parsedEmbed) => {
54
+ return buildEmbedContent(parsedEmbed);
55
+ }));
56
+ }, (e) => e);
57
+ function buildEmbedContent(embed) {
58
+ return {
59
+ ...embed,
60
+ all: (0, Objects_1.withOptionals)({
41
61
  embed_url: embed.embed_url,
42
62
  type: embed.type,
43
63
  }, [
@@ -53,13 +73,6 @@ const EmbedLegacy = (ctx) => new t.Type("EmbedLegacy", exports.isEmbedContent, (
53
73
  ["title", embed.title],
54
74
  ["version", embed.version],
55
75
  ]),
56
- types: { [ctx.keyOfType]: "Embed" },
57
76
  };
58
- });
59
- exports.EmbedLegacy = EmbedLegacy;
60
- exports.EmbedContent = t.intersection([
61
- exports.EmbedContentLegacy,
62
- t.strict({
63
- __TYPE__: t.literal(exports.EmbedContentType),
64
- }),
65
- ]);
77
+ }
78
+ exports.buildEmbedContent = buildEmbedContent;
@@ -21,9 +21,9 @@ export declare const FileLinkContent: t.IntersectionC<[t.ExactC<t.IntersectionC<
21
21
  url: t.StringC;
22
22
  name: t.StringC;
23
23
  kind: t.StringC;
24
+ size: t.StringC;
24
25
  }>, t.PartialC<{
25
26
  date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
26
- size: t.StringC;
27
27
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
28
28
  __TYPE__: t.LiteralC<"FileLink">;
29
29
  }>, t.PartialC<{
@@ -72,9 +72,9 @@ export declare const isLinkContent: (u: unknown) => u is {
72
72
  url: string;
73
73
  name: string;
74
74
  kind: string;
75
+ size: string;
75
76
  } & {
76
77
  date?: string | null | undefined;
77
- size?: string;
78
78
  } & {
79
79
  __TYPE__: "FileLink";
80
80
  } & {
@@ -122,9 +122,9 @@ export declare const LinkLegacy: t.UnionC<[t.Type<{
122
122
  url: string;
123
123
  name: string;
124
124
  kind: string;
125
+ size: string;
125
126
  } & {
126
127
  date?: string | null | undefined;
127
- size?: string;
128
128
  } & {
129
129
  __TYPE__: "FileLink";
130
130
  } & {
@@ -134,9 +134,9 @@ export declare const LinkLegacy: t.UnionC<[t.Type<{
134
134
  url: string;
135
135
  name: string;
136
136
  kind: string;
137
+ size: string;
137
138
  } & {
138
139
  date?: string | null | undefined;
139
- size?: string;
140
140
  }, unknown>, t.Type<{
141
141
  __TYPE__: "DocumentLink";
142
142
  } & {
@@ -181,9 +181,9 @@ export declare const LinkContentLegacy: (ctx: LegacyContentCtx) => t.Type<{
181
181
  url: string;
182
182
  name: string;
183
183
  kind: string;
184
+ size: string;
184
185
  } & {
185
186
  date?: string | null | undefined;
186
- size?: string;
187
187
  } & {
188
188
  __TYPE__: "FileLink";
189
189
  } & {
@@ -218,9 +218,9 @@ export declare const LinkContentLegacy: (ctx: LegacyContentCtx) => t.Type<{
218
218
  url: string;
219
219
  name: string;
220
220
  kind: string;
221
+ size: string;
221
222
  } & {
222
223
  date?: string | null | undefined;
223
- size?: string;
224
224
  }) | {
225
225
  id: string;
226
226
  } | ({
@@ -249,9 +249,9 @@ export declare const Link: t.UnionC<[t.IntersectionC<[t.ExactC<t.TypeC<{
249
249
  url: t.StringC;
250
250
  name: t.StringC;
251
251
  kind: t.StringC;
252
+ size: t.StringC;
252
253
  }>, t.PartialC<{
253
254
  date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
254
- size: t.StringC;
255
255
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
256
256
  __TYPE__: t.LiteralC<"FileLink">;
257
257
  }>, t.PartialC<{
@@ -292,9 +292,9 @@ export declare const LinkContent: t.ExactC<t.TypeC<{
292
292
  url: t.StringC;
293
293
  name: t.StringC;
294
294
  kind: t.StringC;
295
+ size: t.StringC;
295
296
  }>, t.PartialC<{
296
297
  date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
297
- size: t.StringC;
298
298
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
299
299
  __TYPE__: t.LiteralC<"FileLink">;
300
300
  }>, t.PartialC<{
@@ -47,10 +47,10 @@ const fileLinkLegacyCodec = t.exact(t.intersection([
47
47
  url: t.string,
48
48
  name: t.string,
49
49
  kind: t.string,
50
+ size: (0, io_ts_types_1.withFallback)(t.string, "0"),
50
51
  }),
51
52
  t.partial({
52
53
  date: (0, function_2.nullable)(t.string),
53
- size: (0, io_ts_types_1.withFallback)(t.string, "0"),
54
54
  }),
55
55
  ]));
56
56
  const FileLinkLegacy = new t.Type("FileLink", (u) => (0, utils_1.hasContentType)(u) && u.__TYPE__ === exports.FileLinkType, (file) => {
@@ -1,29 +1,13 @@
1
1
  import * as t from "io-ts";
2
2
  import type { LegacyContentCtx } from "../../LegacyContentCtx";
3
+ import { EmbedContent } from "./EmbedContent";
3
4
  export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
4
5
  type: t.StringC;
5
6
  __TYPE__: t.LiteralC<"EmptyContent">;
6
7
  }>>, t.ExactC<t.TypeC<{
7
8
  __TYPE__: t.LiteralC<"BooleanContent">;
8
9
  value: t.BooleanC;
9
- }>>, t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
10
- embed_url: t.StringC;
11
- type: t.StringC;
12
- }>, t.PartialC<{
13
- version: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
14
- title: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
15
- author_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
16
- author_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
17
- provider_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
18
- provider_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
19
- cache_age: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
20
- thumbnail_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
21
- thumbnail_width: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
22
- thumbnail_height: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
23
- html: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
24
- }>]>>, t.ExactC<t.TypeC<{
25
- __TYPE__: t.LiteralC<"EmbedContent">;
26
- }>>]>, t.ExactC<t.TypeC<{
10
+ }>>, t.Type<EmbedContent, EmbedContent, unknown>, t.ExactC<t.TypeC<{
27
11
  type: t.LiteralC<"Text">;
28
12
  value: t.Type<string, string, unknown>;
29
13
  __TYPE__: t.LiteralC<"FieldContent">;
@@ -128,9 +112,9 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
128
112
  url: t.StringC;
129
113
  name: t.StringC;
130
114
  kind: t.StringC;
115
+ size: t.StringC;
131
116
  }>, t.PartialC<{
132
117
  date: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
133
- size: t.StringC;
134
118
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
135
119
  __TYPE__: t.LiteralC<"FileLink">;
136
120
  }>, t.PartialC<{
@@ -196,9 +180,9 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
196
180
  url: string;
197
181
  name: string;
198
182
  kind: string;
183
+ size: string;
199
184
  } & {
200
185
  date?: string | null | undefined;
201
- size?: string;
202
186
  } & {
203
187
  __TYPE__: "FileLink";
204
188
  } & {
@@ -234,9 +218,9 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
234
218
  url: string;
235
219
  name: string;
236
220
  kind: string;
221
+ size: string;
237
222
  } & {
238
223
  date?: string | null | undefined;
239
- size?: string;
240
224
  } & {
241
225
  __TYPE__: "FileLink";
242
226
  } & {
@@ -262,24 +246,7 @@ export declare const NestableContent: t.UnionC<[t.ExactC<t.TypeC<{
262
246
  direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
263
247
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
264
248
  type: t.LiteralC<"embed">;
265
- data: t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
266
- embed_url: t.StringC;
267
- type: t.StringC;
268
- }>, t.PartialC<{
269
- version: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
270
- title: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
271
- author_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
272
- author_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
273
- provider_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
274
- provider_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
275
- cache_age: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
276
- thumbnail_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
277
- thumbnail_width: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
278
- thumbnail_height: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
279
- html: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
280
- }>]>>, t.ExactC<t.TypeC<{
281
- __TYPE__: t.LiteralC<"EmbedContent">;
282
- }>>]>;
249
+ data: t.Type<EmbedContent, EmbedContent, unknown>;
283
250
  }>, t.PartialC<{
284
251
  label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
285
252
  direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
@@ -314,24 +281,7 @@ export type NestableContentType = NestableContent["__TYPE__"];
314
281
  export declare const isNestableContent: (u: unknown) => u is {
315
282
  __TYPE__: "BooleanContent";
316
283
  value: boolean;
317
- } | ({
318
- embed_url: string;
319
- type: string;
320
- } & {
321
- version?: string | number | null;
322
- title?: string | null | undefined;
323
- author_name?: string | null | undefined;
324
- author_url?: string | null | undefined;
325
- provider_name?: string | null | undefined;
326
- provider_url?: string | null | undefined;
327
- cache_age?: string | number | null;
328
- thumbnail_url?: string | null | undefined;
329
- thumbnail_width?: number | null | undefined;
330
- thumbnail_height?: number | null | undefined;
331
- html?: string | null | undefined;
332
- } & {
333
- __TYPE__: "EmbedContent";
334
- }) | {
284
+ } | EmbedContent | {
335
285
  type: "Color";
336
286
  value: string;
337
287
  __TYPE__: "FieldContent";
@@ -438,9 +388,9 @@ export declare const isNestableContent: (u: unknown) => u is {
438
388
  url: string;
439
389
  name: string;
440
390
  kind: string;
391
+ size: string;
441
392
  } & {
442
393
  date?: string | null | undefined;
443
- size?: string;
444
394
  } & {
445
395
  __TYPE__: "FileLink";
446
396
  } & {
@@ -507,9 +457,9 @@ export declare const isNestableContent: (u: unknown) => u is {
507
457
  url: string;
508
458
  name: string;
509
459
  kind: string;
460
+ size: string;
510
461
  } & {
511
462
  date?: string | null | undefined;
512
- size?: string;
513
463
  } & {
514
464
  __TYPE__: "FileLink";
515
465
  } & {
@@ -535,24 +485,7 @@ export declare const isNestableContent: (u: unknown) => u is {
535
485
  direction?: string | null | undefined;
536
486
  }) | ({
537
487
  type: "embed";
538
- data: {
539
- embed_url: string;
540
- type: string;
541
- } & {
542
- version?: string | number | null;
543
- title?: string | null | undefined;
544
- author_name?: string | null | undefined;
545
- author_url?: string | null | undefined;
546
- provider_name?: string | null | undefined;
547
- provider_url?: string | null | undefined;
548
- cache_age?: string | number | null;
549
- thumbnail_url?: string | null | undefined;
550
- thumbnail_width?: number | null | undefined;
551
- thumbnail_height?: number | null | undefined;
552
- html?: string | null | undefined;
553
- } & {
554
- __TYPE__: "EmbedContent";
555
- };
488
+ data: EmbedContent;
556
489
  } & {
557
490
  label?: string | null | undefined;
558
491
  direction?: string | null | undefined;
@@ -580,24 +513,7 @@ export declare const NestableLegacy: (ctx: LegacyContentCtx) => {
580
513
  decode(value: unknown): import("fp-ts/lib/Either").Left<t.Errors> | import("fp-ts/lib/Either").Right<{
581
514
  __TYPE__: "BooleanContent";
582
515
  value: boolean;
583
- }> | import("fp-ts/lib/Either").Right<{
584
- embed_url: string;
585
- type: string;
586
- } & {
587
- version?: string | number | null;
588
- title?: string | null | undefined;
589
- author_name?: string | null | undefined;
590
- author_url?: string | null | undefined;
591
- provider_name?: string | null | undefined;
592
- provider_url?: string | null | undefined;
593
- cache_age?: string | number | null;
594
- thumbnail_url?: string | null | undefined;
595
- thumbnail_width?: number | null | undefined;
596
- thumbnail_height?: number | null | undefined;
597
- html?: string | null | undefined;
598
- } & {
599
- __TYPE__: "EmbedContent";
600
- }> | import("fp-ts/lib/Either").Right<{
516
+ }> | import("fp-ts/lib/Either").Right<EmbedContent> | import("fp-ts/lib/Either").Right<{
601
517
  type: "Color";
602
518
  value: string;
603
519
  __TYPE__: "FieldContent";
@@ -704,9 +620,9 @@ export declare const NestableLegacy: (ctx: LegacyContentCtx) => {
704
620
  url: string;
705
621
  name: string;
706
622
  kind: string;
623
+ size: string;
707
624
  } & {
708
625
  date?: string | null | undefined;
709
- size?: string;
710
626
  } & {
711
627
  __TYPE__: "FileLink";
712
628
  } & {
@@ -773,9 +689,9 @@ export declare const NestableLegacy: (ctx: LegacyContentCtx) => {
773
689
  url: string;
774
690
  name: string;
775
691
  kind: string;
692
+ size: string;
776
693
  } & {
777
694
  date?: string | null | undefined;
778
- size?: string;
779
695
  } & {
780
696
  __TYPE__: "FileLink";
781
697
  } & {
@@ -801,24 +717,7 @@ export declare const NestableLegacy: (ctx: LegacyContentCtx) => {
801
717
  direction?: string | null | undefined;
802
718
  }) | ({
803
719
  type: "embed";
804
- data: {
805
- embed_url: string;
806
- type: string;
807
- } & {
808
- version?: string | number | null;
809
- title?: string | null | undefined;
810
- author_name?: string | null | undefined;
811
- author_url?: string | null | undefined;
812
- provider_name?: string | null | undefined;
813
- provider_url?: string | null | undefined;
814
- cache_age?: string | number | null;
815
- thumbnail_url?: string | null | undefined;
816
- thumbnail_width?: number | null | undefined;
817
- thumbnail_height?: number | null | undefined;
818
- html?: string | null | undefined;
819
- } & {
820
- __TYPE__: "EmbedContent";
821
- };
720
+ data: EmbedContent;
822
721
  } & {
823
722
  label?: string | null | undefined;
824
723
  direction?: string | null | undefined;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NestableLegacy = exports.isNestableContent = exports.NestableContent = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const Either_1 = require("fp-ts/lib/Either");
5
6
  const t = tslib_1.__importStar(require("io-ts"));
6
7
  const EmptyContent_1 = require("../EmptyContent");
7
8
  const BooleanContent_1 = require("./BooleanContent");
@@ -54,7 +55,7 @@ const NestableLegacy = (ctx) => {
54
55
  if (!ctx.fieldType)
55
56
  return;
56
57
  const nullValue = (0, EmptyContent_1.EmptyLegacy)(ctx.fieldType).decode(value);
57
- if (nullValue._tag === "Right")
58
+ if ((0, Either_1.isRight)(nullValue))
58
59
  return nullValue;
59
60
  const codec = (() => {
60
61
  switch (ctx.fieldType) {
@@ -1,4 +1,5 @@
1
1
  import * as t from "io-ts";
2
+ import { EmbedContent } from "../EmbedContent";
2
3
  import { Link, LinkLegacy } from "../LinkContent";
3
4
  export declare const Meta: t.ExactC<t.IntersectionC<[t.PartialC<{
4
5
  data: t.UnknownC;
@@ -105,9 +106,9 @@ export declare const ImageBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
105
106
  url: string;
106
107
  name: string;
107
108
  kind: string;
109
+ size: string;
108
110
  } & {
109
111
  date?: string | null | undefined;
110
- size?: string;
111
112
  } & {
112
113
  __TYPE__: "FileLink";
113
114
  } & {
@@ -143,9 +144,9 @@ export declare const ImageBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
143
144
  url: string;
144
145
  name: string;
145
146
  kind: string;
147
+ size: string;
146
148
  } & {
147
149
  date?: string | null | undefined;
148
- size?: string;
149
150
  } & {
150
151
  __TYPE__: "FileLink";
151
152
  } & {
@@ -174,24 +175,7 @@ export type ImageBlock = t.TypeOf<typeof ImageBlock>;
174
175
  export declare function checkImageBlock(block: Block): block is ImageBlock;
175
176
  export declare const EmbedBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
176
177
  type: t.LiteralC<"embed">;
177
- data: t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
178
- embed_url: t.StringC;
179
- type: t.StringC;
180
- }>, t.PartialC<{
181
- version: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
182
- title: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
183
- author_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
184
- author_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
185
- provider_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
186
- provider_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
187
- cache_age: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
188
- thumbnail_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
189
- thumbnail_width: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
190
- thumbnail_height: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
191
- html: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
192
- }>]>>, t.ExactC<t.TypeC<{
193
- __TYPE__: t.LiteralC<"EmbedContent">;
194
- }>>]>;
178
+ data: t.Type<EmbedContent, EmbedContent, unknown>;
195
179
  }>, t.PartialC<{
196
180
  label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
197
181
  direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
@@ -265,9 +249,9 @@ export declare const BlockLegacy: t.Type<({
265
249
  url: string;
266
250
  name: string;
267
251
  kind: string;
252
+ size: string;
268
253
  } & {
269
254
  date?: string | null | undefined;
270
- size?: string;
271
255
  } & {
272
256
  __TYPE__: "FileLink";
273
257
  } & {
@@ -293,24 +277,7 @@ export declare const BlockLegacy: t.Type<({
293
277
  direction?: string | null | undefined;
294
278
  }) | ({
295
279
  type: "embed";
296
- data: {
297
- embed_url: string;
298
- type: string;
299
- } & {
300
- version?: string | number | null;
301
- title?: string | null | undefined;
302
- author_name?: string | null | undefined;
303
- author_url?: string | null | undefined;
304
- provider_name?: string | null | undefined;
305
- provider_url?: string | null | undefined;
306
- cache_age?: string | number | null;
307
- thumbnail_url?: string | null | undefined;
308
- thumbnail_width?: number | null | undefined;
309
- thumbnail_height?: number | null | undefined;
310
- html?: string | null | undefined;
311
- } & {
312
- __TYPE__: "EmbedContent";
313
- };
280
+ data: EmbedContent;
314
281
  } & {
315
282
  label?: string | null | undefined;
316
283
  direction?: string | null | undefined;
@@ -372,9 +339,9 @@ export declare const BlockLegacy: t.Type<({
372
339
  url: string;
373
340
  name: string;
374
341
  kind: string;
342
+ size: string;
375
343
  } & {
376
344
  date?: string | null | undefined;
377
- size?: string;
378
345
  } & {
379
346
  __TYPE__: "FileLink";
380
347
  } & {
@@ -400,24 +367,7 @@ export declare const BlockLegacy: t.Type<({
400
367
  direction?: string | null | undefined;
401
368
  }) | ({
402
369
  type: "embed";
403
- data: {
404
- embed_url: string;
405
- type: string;
406
- } & {
407
- version?: string | number | null;
408
- title?: string | null | undefined;
409
- author_name?: string | null | undefined;
410
- author_url?: string | null | undefined;
411
- provider_name?: string | null | undefined;
412
- provider_url?: string | null | undefined;
413
- cache_age?: string | number | null;
414
- thumbnail_url?: string | null | undefined;
415
- thumbnail_width?: number | null | undefined;
416
- thumbnail_height?: number | null | undefined;
417
- html?: string | null | undefined;
418
- } & {
419
- __TYPE__: "EmbedContent";
420
- };
370
+ data: EmbedContent;
421
371
  } & {
422
372
  label?: string | null | undefined;
423
373
  direction?: string | null | undefined;
@@ -480,9 +430,9 @@ export declare const Block: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
480
430
  url: string;
481
431
  name: string;
482
432
  kind: string;
433
+ size: string;
483
434
  } & {
484
435
  date?: string | null | undefined;
485
- size?: string;
486
436
  } & {
487
437
  __TYPE__: "FileLink";
488
438
  } & {
@@ -518,9 +468,9 @@ export declare const Block: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
518
468
  url: string;
519
469
  name: string;
520
470
  kind: string;
471
+ size: string;
521
472
  } & {
522
473
  date?: string | null | undefined;
523
- size?: string;
524
474
  } & {
525
475
  __TYPE__: "FileLink";
526
476
  } & {
@@ -546,24 +496,7 @@ export declare const Block: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
546
496
  direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
547
497
  }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
548
498
  type: t.LiteralC<"embed">;
549
- data: t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
550
- embed_url: t.StringC;
551
- type: t.StringC;
552
- }>, t.PartialC<{
553
- version: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
554
- title: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
555
- author_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
556
- author_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
557
- provider_name: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
558
- provider_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
559
- cache_age: t.UnionC<[t.StringC, t.NumberC, t.NullC]>;
560
- thumbnail_url: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
561
- thumbnail_width: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
562
- thumbnail_height: t.UnionC<[t.Type<number, number, unknown>, t.NullC, t.UndefinedC]>;
563
- html: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
564
- }>]>>, t.ExactC<t.TypeC<{
565
- __TYPE__: t.LiteralC<"EmbedContent">;
566
- }>>]>;
499
+ data: t.Type<EmbedContent, EmbedContent, unknown>;
567
500
  }>, t.PartialC<{
568
501
  label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
569
502
  direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;