@prismicio/types-internal 1.5.3 → 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/lib/common/WidgetKey.d.ts +3 -0
  2. package/lib/common/WidgetKey.js +8 -0
  3. package/lib/common/index.d.ts +1 -0
  4. package/lib/common/index.js +4 -0
  5. package/lib/content/Document.d.ts +4285 -2573
  6. package/lib/content/Document.js +87 -10
  7. package/lib/content/LegacyContentCtx.d.ts +41 -0
  8. package/lib/content/LegacyContentCtx.js +65 -0
  9. package/lib/content/fields/EmptyContent.d.ts +16 -0
  10. package/lib/content/fields/EmptyContent.js +30 -0
  11. package/lib/content/fields/GroupContent.d.ts +1063 -364
  12. package/lib/content/fields/GroupContent.js +65 -6
  13. package/lib/content/fields/UIDContent.d.ts +10 -1
  14. package/lib/content/fields/UIDContent.js +17 -4
  15. package/lib/content/fields/WidgetContent.d.ts +6820 -0
  16. package/lib/content/fields/WidgetContent.js +57 -0
  17. package/lib/content/fields/index.d.ts +1 -2989
  18. package/lib/content/fields/index.js +1 -18
  19. package/lib/content/fields/nestable/BooleanContent.d.ts +10 -1
  20. package/lib/content/fields/nestable/BooleanContent.js +17 -4
  21. package/lib/content/fields/nestable/EmbedContent.d.ts +56 -5
  22. package/lib/content/fields/nestable/EmbedContent.js +57 -6
  23. package/lib/content/fields/nestable/FieldContent/ColorContent.d.ts +18 -0
  24. package/lib/content/fields/nestable/FieldContent/ColorContent.js +34 -0
  25. package/lib/content/fields/nestable/FieldContent/DateContent.d.ts +18 -0
  26. package/lib/content/fields/nestable/FieldContent/DateContent.js +34 -0
  27. package/lib/content/fields/nestable/FieldContent/NumberContent.d.ts +18 -0
  28. package/lib/content/fields/nestable/FieldContent/NumberContent.js +34 -0
  29. package/lib/content/fields/nestable/FieldContent/RangeContent.d.ts +18 -0
  30. package/lib/content/fields/nestable/FieldContent/RangeContent.js +34 -0
  31. package/lib/content/fields/nestable/FieldContent/SelectContent.d.ts +18 -0
  32. package/lib/content/fields/nestable/FieldContent/SelectContent.js +34 -0
  33. package/lib/content/fields/nestable/FieldContent/TextContent.d.ts +18 -0
  34. package/lib/content/fields/nestable/FieldContent/TextContent.js +34 -0
  35. package/lib/content/fields/nestable/FieldContent/TimestampContent.d.ts +18 -0
  36. package/lib/content/fields/nestable/FieldContent/TimestampContent.js +34 -0
  37. package/lib/content/fields/nestable/FieldContent/common.d.ts +1 -0
  38. package/lib/content/fields/nestable/FieldContent/common.js +4 -0
  39. package/lib/content/fields/nestable/FieldContent/index.d.ts +49 -0
  40. package/lib/content/fields/nestable/FieldContent/index.js +38 -0
  41. package/lib/content/fields/nestable/FieldContent.d.ts +7 -1
  42. package/lib/content/fields/nestable/FieldContent.js +19 -4
  43. package/lib/content/fields/nestable/GeoPointContent.d.ts +19 -4
  44. package/lib/content/fields/nestable/GeoPointContent.js +22 -5
  45. package/lib/content/fields/nestable/ImageContent.d.ts +109 -11
  46. package/lib/content/fields/nestable/ImageContent.js +64 -6
  47. package/lib/content/fields/nestable/IntegrationFieldContent.d.ts +10 -1
  48. package/lib/content/fields/nestable/IntegrationFieldContent.js +20 -4
  49. package/lib/content/fields/nestable/LinkContent.d.ts +240 -87
  50. package/lib/content/fields/nestable/LinkContent.js +133 -36
  51. package/lib/content/fields/nestable/NestableContent.d.ts +711 -251
  52. package/lib/content/fields/nestable/NestableContent.js +116 -13
  53. package/lib/content/fields/nestable/RichTextContent/Blocks.d.ts +594 -0
  54. package/lib/content/fields/nestable/RichTextContent/Blocks.js +151 -0
  55. package/lib/content/fields/nestable/RichTextContent/index.d.ts +489 -0
  56. package/lib/content/fields/nestable/RichTextContent/index.js +27 -0
  57. package/lib/content/fields/nestable/SeparatorContent.d.ts +8 -1
  58. package/lib/content/fields/nestable/SeparatorContent.js +15 -4
  59. package/lib/content/fields/slices/CompositeSliceContent.d.ts +296 -362
  60. package/lib/content/fields/slices/RepeatableContent.d.ts +148 -181
  61. package/lib/content/fields/slices/SharedSliceContent.d.ts +296 -362
  62. package/lib/content/fields/slices/SimpleSliceContent.d.ts +296 -362
  63. package/lib/content/fields/slices/Slice/CompositeSliceContent.d.ts +1709 -0
  64. package/lib/content/fields/slices/Slice/CompositeSliceContent.js +81 -0
  65. package/lib/content/fields/slices/Slice/RepeatableContent.d.ts +582 -0
  66. package/lib/content/fields/slices/Slice/RepeatableContent.js +18 -0
  67. package/lib/content/fields/slices/Slice/SharedSliceContent.d.ts +1713 -0
  68. package/lib/content/fields/slices/Slice/SharedSliceContent.js +98 -0
  69. package/lib/content/fields/slices/Slice/SimpleSliceContent.d.ts +1429 -0
  70. package/lib/content/fields/slices/Slice/SimpleSliceContent.js +24 -0
  71. package/lib/content/fields/slices/Slice/index.d.ts +3216 -0
  72. package/lib/content/fields/slices/Slice/index.js +41 -0
  73. package/lib/content/fields/slices/SliceItem.d.ts +3498 -0
  74. package/lib/content/fields/slices/SliceItem.js +61 -0
  75. package/lib/content/fields/slices/SlicesContent.d.ts +4243 -3576
  76. package/lib/content/fields/slices/SlicesContent.js +28 -18
  77. package/lib/content/fields/slices/index.d.ts +4 -3
  78. package/lib/content/fields/slices/index.js +4 -3
  79. package/lib/content/index.d.ts +1 -0
  80. package/lib/content/index.js +1 -0
  81. package/lib/content/utils.d.ts +10 -0
  82. package/lib/content/utils.js +19 -0
  83. package/lib/customtypes/CustomType.d.ts +366 -366
  84. package/lib/customtypes/CustomType.js +4 -7
  85. package/lib/customtypes/Section.d.ts +366 -366
  86. package/lib/customtypes/Section.js +2 -2
  87. package/lib/customtypes/diff/SharedSlice.d.ts +4 -4
  88. package/lib/customtypes/diff/Variation.d.ts +4 -4
  89. package/lib/customtypes/index.d.ts +1 -1
  90. package/lib/customtypes/index.js +2 -2
  91. package/lib/customtypes/widgets/Group.d.ts +1 -0
  92. package/lib/customtypes/widgets/Group.js +6 -5
  93. package/lib/customtypes/widgets/UID.d.ts +1 -0
  94. package/lib/customtypes/widgets/UID.js +3 -2
  95. package/lib/customtypes/widgets/Widget.d.ts +384 -362
  96. package/lib/customtypes/widgets/Widget.js +29 -8
  97. package/lib/customtypes/widgets/index.d.ts +6 -7
  98. package/lib/customtypes/widgets/index.js +6 -11
  99. package/lib/customtypes/widgets/nestable/BooleanField.d.ts +10 -3
  100. package/lib/customtypes/widgets/nestable/BooleanField.js +6 -6
  101. package/lib/customtypes/widgets/nestable/Color.d.ts +8 -3
  102. package/lib/customtypes/widgets/nestable/Color.js +6 -6
  103. package/lib/customtypes/widgets/nestable/Date.d.ts +9 -3
  104. package/lib/customtypes/widgets/nestable/Date.js +6 -6
  105. package/lib/customtypes/widgets/nestable/Embed.d.ts +9 -3
  106. package/lib/customtypes/widgets/nestable/Embed.js +6 -6
  107. package/lib/customtypes/widgets/nestable/GeoPoint.d.ts +7 -3
  108. package/lib/customtypes/widgets/nestable/GeoPoint.js +6 -6
  109. package/lib/customtypes/widgets/nestable/Image.d.ts +25 -3
  110. package/lib/customtypes/widgets/nestable/Image.js +8 -8
  111. package/lib/customtypes/widgets/nestable/IntegrationField.d.ts +9 -3
  112. package/lib/customtypes/widgets/nestable/IntegrationField.js +6 -6
  113. package/lib/customtypes/widgets/nestable/Link.d.ts +14 -2
  114. package/lib/customtypes/widgets/nestable/Link.js +7 -6
  115. package/lib/customtypes/widgets/nestable/NestableWidget.d.ts +3 -3
  116. package/lib/customtypes/widgets/nestable/NestableWidget.js +30 -30
  117. package/lib/customtypes/widgets/nestable/Number.d.ts +11 -3
  118. package/lib/customtypes/widgets/nestable/Number.js +6 -6
  119. package/lib/customtypes/widgets/nestable/Range.d.ts +11 -3
  120. package/lib/customtypes/widgets/nestable/Range.js +6 -6
  121. package/lib/customtypes/widgets/nestable/RichText.d.ts +1 -0
  122. package/lib/customtypes/widgets/nestable/RichText.js +3 -3
  123. package/lib/customtypes/widgets/nestable/Select.d.ts +10 -3
  124. package/lib/customtypes/widgets/nestable/Select.js +6 -6
  125. package/lib/customtypes/widgets/nestable/Separator.d.ts +7 -3
  126. package/lib/customtypes/widgets/nestable/Separator.js +6 -6
  127. package/lib/customtypes/widgets/nestable/Text.d.ts +9 -2
  128. package/lib/customtypes/widgets/nestable/Text.js +7 -6
  129. package/lib/customtypes/widgets/nestable/Timestamp.d.ts +9 -3
  130. package/lib/customtypes/widgets/nestable/Timestamp.js +6 -6
  131. package/lib/customtypes/widgets/nestable/index.d.ts +15 -15
  132. package/lib/customtypes/widgets/nestable/index.js +15 -31
  133. package/lib/customtypes/widgets/slices/CompositeSlice.d.ts +1 -0
  134. package/lib/customtypes/widgets/slices/CompositeSlice.js +7 -6
  135. package/lib/customtypes/widgets/slices/LegacySlice.js +2 -2
  136. package/lib/customtypes/widgets/slices/SharedSlice.d.ts +1 -0
  137. package/lib/customtypes/widgets/slices/SharedSlice.js +7 -7
  138. package/lib/customtypes/widgets/slices/SharedSliceRef.js +2 -2
  139. package/lib/customtypes/widgets/slices/Slices.d.ts +364 -362
  140. package/lib/customtypes/widgets/slices/Slices.js +8 -8
  141. package/lib/customtypes/widgets/slices/SlicesTypes.d.ts +6 -5
  142. package/lib/customtypes/widgets/slices/SlicesTypes.js +8 -4
  143. package/lib/documents/DocumentData.d.ts +3 -14
  144. package/lib/documents/DocumentData.js +5 -60
  145. package/lib/documents/widgets/nestable/ImageContent.d.ts +1 -1
  146. package/lib/documents/widgets/nestable/ImageContent.js +2 -2
  147. package/lib/utils/Objects.d.ts +1 -0
  148. package/lib/utils/Objects.js +10 -1
  149. package/package.json +1 -1
  150. package/src/common/WidgetKey.ts +13 -0
  151. package/src/common/index.ts +1 -0
  152. package/src/content/Document.ts +129 -16
  153. package/src/content/LegacyContentCtx.ts +57 -0
  154. package/src/content/fields/EmptyContent.ts +45 -0
  155. package/src/content/fields/GroupContent.ts +103 -8
  156. package/src/content/fields/UIDContent.ts +33 -3
  157. package/src/content/fields/WidgetContent.ts +76 -0
  158. package/src/content/fields/index.ts +1 -23
  159. package/src/content/fields/nestable/BooleanContent.ts +32 -3
  160. package/src/content/fields/nestable/EmbedContent.ts +79 -8
  161. package/src/content/fields/nestable/FieldContent/ColorContent.ts +48 -0
  162. package/src/content/fields/nestable/FieldContent/DateContent.ts +48 -0
  163. package/src/content/fields/nestable/FieldContent/NumberContent.ts +48 -0
  164. package/src/content/fields/nestable/FieldContent/RangeContent.ts +48 -0
  165. package/src/content/fields/nestable/FieldContent/SelectContent.ts +48 -0
  166. package/src/content/fields/nestable/FieldContent/TextContent.ts +48 -0
  167. package/src/content/fields/nestable/FieldContent/TimestampContent.ts +48 -0
  168. package/src/content/fields/nestable/FieldContent/common.ts +1 -0
  169. package/src/content/fields/nestable/FieldContent/index.ts +40 -0
  170. package/src/content/fields/nestable/GeoPointContent.ts +38 -7
  171. package/src/content/fields/nestable/ImageContent.ts +91 -11
  172. package/src/content/fields/nestable/IntegrationFieldContent.ts +42 -3
  173. package/src/content/fields/nestable/LinkContent.ts +208 -47
  174. package/src/content/fields/nestable/NestableContent.ts +180 -24
  175. package/src/content/fields/nestable/RichTextContent/Blocks.ts +205 -0
  176. package/src/content/fields/nestable/RichTextContent/index.ts +43 -0
  177. package/src/content/fields/nestable/SeparatorContent.ts +26 -3
  178. package/src/content/fields/slices/Slice/CompositeSliceContent.ts +118 -0
  179. package/src/content/fields/slices/{RepeatableContent.ts → Slice/RepeatableContent.ts} +7 -4
  180. package/src/content/fields/slices/Slice/SharedSliceContent.ts +129 -0
  181. package/src/content/fields/slices/Slice/SimpleSliceContent.ts +30 -0
  182. package/src/content/fields/slices/Slice/index.ts +47 -0
  183. package/src/content/fields/slices/SliceItem.ts +83 -0
  184. package/src/content/fields/slices/SlicesContent.ts +47 -19
  185. package/src/content/fields/slices/index.ts +4 -3
  186. package/src/content/index.ts +1 -0
  187. package/src/content/utils.ts +20 -0
  188. package/src/customtypes/CustomType.ts +4 -10
  189. package/src/customtypes/Section.ts +1 -1
  190. package/src/customtypes/index.ts +1 -1
  191. package/src/customtypes/widgets/Group.ts +4 -4
  192. package/src/customtypes/widgets/UID.ts +3 -2
  193. package/src/customtypes/widgets/Widget.ts +53 -7
  194. package/src/customtypes/widgets/index.ts +6 -7
  195. package/src/customtypes/widgets/nestable/BooleanField.ts +7 -8
  196. package/src/customtypes/widgets/nestable/Color.ts +6 -8
  197. package/src/customtypes/widgets/nestable/Date.ts +7 -8
  198. package/src/customtypes/widgets/nestable/Embed.ts +7 -8
  199. package/src/customtypes/widgets/nestable/GeoPoint.ts +7 -8
  200. package/src/customtypes/widgets/nestable/Image.ts +9 -10
  201. package/src/customtypes/widgets/nestable/IntegrationField.ts +6 -8
  202. package/src/customtypes/widgets/nestable/Link.ts +7 -6
  203. package/src/customtypes/widgets/nestable/NestableWidget.ts +17 -18
  204. package/src/customtypes/widgets/nestable/Number.ts +7 -8
  205. package/src/customtypes/widgets/nestable/Range.ts +7 -8
  206. package/src/customtypes/widgets/nestable/RichText.ts +3 -2
  207. package/src/customtypes/widgets/nestable/Select.ts +7 -8
  208. package/src/customtypes/widgets/nestable/Separator.ts +7 -8
  209. package/src/customtypes/widgets/nestable/Text.ts +7 -6
  210. package/src/customtypes/widgets/nestable/Timestamp.ts +7 -8
  211. package/src/customtypes/widgets/nestable/index.ts +15 -15
  212. package/src/customtypes/widgets/slices/CompositeSlice.ts +5 -4
  213. package/src/customtypes/widgets/slices/LegacySlice.ts +1 -1
  214. package/src/customtypes/widgets/slices/SharedSlice.ts +5 -4
  215. package/src/customtypes/widgets/slices/SharedSliceRef.ts +2 -2
  216. package/src/customtypes/widgets/slices/Slices.ts +7 -6
  217. package/src/customtypes/widgets/slices/SlicesTypes.ts +10 -5
  218. package/src/utils/Objects.ts +12 -0
  219. package/src/content/fields/nestable/FieldContent.ts +0 -25
  220. package/src/content/fields/nestable/RichTextContent.ts +0 -32
  221. package/src/content/fields/slices/CompositeSliceContent.ts +0 -14
  222. package/src/content/fields/slices/SharedSliceContent.ts +0 -14
  223. package/src/content/fields/slices/SimpleSliceContent.ts +0 -7
  224. package/src/customtypes/widgets/WidgetTypes.ts +0 -24
  225. package/src/documents/DocumentData.ts +0 -112
  226. package/src/documents/index.ts +0 -2
  227. package/src/documents/widgets/EmptyContent.ts +0 -8
  228. package/src/documents/widgets/GroupContent.ts +0 -91
  229. package/src/documents/widgets/SimpleWidgetContent.ts +0 -96
  230. package/src/documents/widgets/StaticWidgetContent.ts +0 -46
  231. package/src/documents/widgets/UIDContent.ts +0 -18
  232. package/src/documents/widgets/index.ts +0 -70
  233. package/src/documents/widgets/nestable/BooleanContent.ts +0 -21
  234. package/src/documents/widgets/nestable/EmbedContent.ts +0 -56
  235. package/src/documents/widgets/nestable/FieldContent.ts +0 -53
  236. package/src/documents/widgets/nestable/GeoPointContent.ts +0 -18
  237. package/src/documents/widgets/nestable/ImageContent.ts +0 -51
  238. package/src/documents/widgets/nestable/IntegrationFieldsContent.ts +0 -26
  239. package/src/documents/widgets/nestable/Link/DocumentLink.ts +0 -18
  240. package/src/documents/widgets/nestable/Link/ExternalLink.ts +0 -31
  241. package/src/documents/widgets/nestable/Link/FileLink.ts +0 -30
  242. package/src/documents/widgets/nestable/Link/ImageLink.ts +0 -31
  243. package/src/documents/widgets/nestable/Link/LinkContent.ts +0 -25
  244. package/src/documents/widgets/nestable/Link/index.ts +0 -35
  245. package/src/documents/widgets/nestable/SeparatorContent.ts +0 -13
  246. package/src/documents/widgets/nestable/StructuredTextContent/Block.ts +0 -126
  247. package/src/documents/widgets/nestable/StructuredTextContent/index.ts +0 -25
  248. package/src/documents/widgets/nestable/index.ts +0 -35
  249. package/src/documents/widgets/slices/CompositeSliceContent.ts +0 -77
  250. package/src/documents/widgets/slices/SharedSliceContent.ts +0 -94
  251. package/src/documents/widgets/slices/SimpleSliceContent.ts +0 -4
  252. package/src/documents/widgets/slices/SliceWidgetContent.ts +0 -51
  253. package/src/documents/widgets/slices/SlicesContent.ts +0 -91
  254. package/src/documents/widgets/slices/index.ts +0 -5
  255. package/src/index.ts +0 -3
@@ -0,0 +1,594 @@
1
+ import * as t from "io-ts";
2
+ import { Link, LinkLegacy } from "../LinkContent";
3
+ export declare const Meta: t.ExactC<t.IntersectionC<[t.PartialC<{
4
+ data: t.UnknownC;
5
+ }>, t.TypeC<{
6
+ start: t.NumberC;
7
+ end: t.NumberC;
8
+ type: t.UnionC<[t.KeyofC<{
9
+ heading1: null;
10
+ heading2: null;
11
+ heading3: null;
12
+ heading4: null;
13
+ heading5: null;
14
+ heading6: null;
15
+ paragraph: null;
16
+ strong: null;
17
+ em: null;
18
+ preformatted: null;
19
+ hyperlink: null;
20
+ image: null;
21
+ embed: null;
22
+ "list-item": null;
23
+ "o-list-item": null;
24
+ rtl: null;
25
+ }>, t.LiteralC<"label">]>;
26
+ }>]>>;
27
+ export declare type Meta = t.TypeOf<typeof Meta>;
28
+ export declare const Span: t.ExactC<t.IntersectionC<[t.PartialC<{
29
+ data: t.UnknownC;
30
+ }>, t.TypeC<{
31
+ start: t.NumberC;
32
+ end: t.NumberC;
33
+ type: t.UnionC<[t.KeyofC<{
34
+ heading1: null;
35
+ heading2: null;
36
+ heading3: null;
37
+ heading4: null;
38
+ heading5: null;
39
+ heading6: null;
40
+ paragraph: null;
41
+ strong: null;
42
+ em: null;
43
+ preformatted: null;
44
+ hyperlink: null;
45
+ image: null;
46
+ embed: null;
47
+ "list-item": null;
48
+ "o-list-item": null;
49
+ rtl: null;
50
+ }>, t.LiteralC<"label">]>;
51
+ }>]>>;
52
+ export declare type Span = Meta;
53
+ export declare const ValidatedMetas: (linkCodec: LinkCodec) => t.Type<({
54
+ data?: unknown;
55
+ } & {
56
+ start: number;
57
+ end: number;
58
+ type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
59
+ })[], ({
60
+ data?: unknown;
61
+ } & {
62
+ start: number;
63
+ end: number;
64
+ type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
65
+ })[], unknown>;
66
+ export declare const ImageBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
67
+ type: t.LiteralC<"image">;
68
+ data: t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
69
+ origin: t.ExactC<t.TypeC<{
70
+ id: t.StringC;
71
+ url: t.StringC;
72
+ width: t.NumberC;
73
+ height: t.NumberC;
74
+ }>>;
75
+ width: t.NumberC;
76
+ height: t.NumberC;
77
+ edit: t.TypeC<{
78
+ zoom: t.NumberC;
79
+ crop: t.TypeC<{
80
+ x: t.NumberC;
81
+ y: t.NumberC;
82
+ }>;
83
+ background: t.StringC;
84
+ }>;
85
+ }>, t.PartialC<{
86
+ url: t.StringC;
87
+ credits: t.Type<string | null, string | null, unknown>;
88
+ alt: t.Type<string | null, string | null, unknown>;
89
+ provider: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
90
+ }>]>>, t.PartialC<{
91
+ linkTo: t.UnionC<[t.Type<({
92
+ __TYPE__: "ImageLink";
93
+ } & {
94
+ id: string;
95
+ url: string;
96
+ height: string;
97
+ width: string;
98
+ size: string;
99
+ name: string;
100
+ kind: string;
101
+ } & {
102
+ date?: string | null | undefined;
103
+ }) | ({
104
+ id: string;
105
+ url: string;
106
+ name: string;
107
+ kind: string;
108
+ } & {
109
+ date?: string | null | undefined;
110
+ size?: string;
111
+ } & {
112
+ __TYPE__: "FileLink";
113
+ } & {
114
+ size?: string;
115
+ }) | ({
116
+ __TYPE__: "DocumentLink";
117
+ } & {
118
+ id: string;
119
+ }) | ({
120
+ __TYPE__: "ExternalLink";
121
+ } & {
122
+ url: string;
123
+ } & {
124
+ kind?: "web";
125
+ target?: string | null | undefined;
126
+ preview?: {
127
+ title?: string;
128
+ } | null | undefined;
129
+ }), ({
130
+ __TYPE__: "ImageLink";
131
+ } & {
132
+ id: string;
133
+ url: string;
134
+ height: string;
135
+ width: string;
136
+ size: string;
137
+ name: string;
138
+ kind: string;
139
+ } & {
140
+ date?: string | null | undefined;
141
+ }) | ({
142
+ id: string;
143
+ url: string;
144
+ name: string;
145
+ kind: string;
146
+ } & {
147
+ date?: string | null | undefined;
148
+ size?: string;
149
+ } & {
150
+ __TYPE__: "FileLink";
151
+ } & {
152
+ size?: string;
153
+ }) | ({
154
+ __TYPE__: "DocumentLink";
155
+ } & {
156
+ id: string;
157
+ }) | ({
158
+ __TYPE__: "ExternalLink";
159
+ } & {
160
+ url: string;
161
+ } & {
162
+ kind?: "web";
163
+ target?: string | null | undefined;
164
+ preview?: {
165
+ title?: string;
166
+ } | null | undefined;
167
+ }), unknown>, t.NullC, t.UndefinedC]>;
168
+ }>]>;
169
+ }>, t.PartialC<{
170
+ label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
171
+ direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
172
+ }>]>>;
173
+ export declare type ImageBlock = t.TypeOf<typeof ImageBlock>;
174
+ export declare function checkImageBlock(block: Block): block is ImageBlock;
175
+ export declare const EmbedBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
176
+ 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
+ }>>]>;
195
+ }>, t.PartialC<{
196
+ label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
197
+ direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
198
+ }>]>>;
199
+ export declare type EmbedBlock = t.TypeOf<typeof EmbedBlock>;
200
+ export declare function checkEmbedBlock(block: Block): block is EmbedBlock;
201
+ declare type LinkCodec = typeof Link | typeof LinkLegacy;
202
+ export declare const TextBlock: t.ExactC<t.IntersectionC<[t.TypeC<{
203
+ type: t.Type<"paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl", "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
204
+ content: t.IntersectionC<[t.TypeC<{
205
+ text: t.StringC;
206
+ }>, t.PartialC<{
207
+ spans: t.Type<({
208
+ data?: unknown;
209
+ } & {
210
+ start: number;
211
+ end: number;
212
+ type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
213
+ })[], ({
214
+ data?: unknown;
215
+ } & {
216
+ start: number;
217
+ end: number;
218
+ type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
219
+ })[], unknown>;
220
+ }>]>;
221
+ }>, t.PartialC<{
222
+ label: t.StringC;
223
+ direction: t.StringC;
224
+ }>]>>;
225
+ export declare type TextBlock = t.TypeOf<typeof TextBlock>;
226
+ export declare const BlockLegacy: t.Type<({
227
+ type: "image";
228
+ data: {
229
+ origin: {
230
+ id: string;
231
+ url: string;
232
+ width: number;
233
+ height: number;
234
+ };
235
+ width: number;
236
+ height: number;
237
+ edit: {
238
+ zoom: number;
239
+ crop: {
240
+ x: number;
241
+ y: number;
242
+ };
243
+ background: string;
244
+ };
245
+ } & {
246
+ url?: string;
247
+ credits?: string | null;
248
+ alt?: string | null;
249
+ provider?: string | null | undefined;
250
+ } & {
251
+ linkTo?: ({
252
+ __TYPE__: "ImageLink";
253
+ } & {
254
+ id: string;
255
+ url: string;
256
+ height: string;
257
+ width: string;
258
+ size: string;
259
+ name: string;
260
+ kind: string;
261
+ } & {
262
+ date?: string | null | undefined;
263
+ }) | ({
264
+ id: string;
265
+ url: string;
266
+ name: string;
267
+ kind: string;
268
+ } & {
269
+ date?: string | null | undefined;
270
+ size?: string;
271
+ } & {
272
+ __TYPE__: "FileLink";
273
+ } & {
274
+ size?: string;
275
+ }) | ({
276
+ __TYPE__: "DocumentLink";
277
+ } & {
278
+ id: string;
279
+ }) | ({
280
+ __TYPE__: "ExternalLink";
281
+ } & {
282
+ url: string;
283
+ } & {
284
+ kind?: "web";
285
+ target?: string | null | undefined;
286
+ preview?: {
287
+ title?: string;
288
+ } | null | undefined;
289
+ }) | null | undefined;
290
+ };
291
+ } & {
292
+ label?: string | null | undefined;
293
+ direction?: string | null | undefined;
294
+ }) | ({
295
+ 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
+ };
314
+ } & {
315
+ label?: string | null | undefined;
316
+ direction?: string | null | undefined;
317
+ }) | ({
318
+ type: "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
319
+ content: {
320
+ text: string;
321
+ } & {
322
+ spans?: ({
323
+ data?: unknown;
324
+ } & {
325
+ start: number;
326
+ end: number;
327
+ type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
328
+ })[];
329
+ };
330
+ } & {
331
+ label?: string;
332
+ direction?: string;
333
+ }), ({
334
+ type: "image";
335
+ data: {
336
+ origin: {
337
+ id: string;
338
+ url: string;
339
+ width: number;
340
+ height: number;
341
+ };
342
+ width: number;
343
+ height: number;
344
+ edit: {
345
+ zoom: number;
346
+ crop: {
347
+ x: number;
348
+ y: number;
349
+ };
350
+ background: string;
351
+ };
352
+ } & {
353
+ url?: string;
354
+ credits?: string | null;
355
+ alt?: string | null;
356
+ provider?: string | null | undefined;
357
+ } & {
358
+ linkTo?: ({
359
+ __TYPE__: "ImageLink";
360
+ } & {
361
+ id: string;
362
+ url: string;
363
+ height: string;
364
+ width: string;
365
+ size: string;
366
+ name: string;
367
+ kind: string;
368
+ } & {
369
+ date?: string | null | undefined;
370
+ }) | ({
371
+ id: string;
372
+ url: string;
373
+ name: string;
374
+ kind: string;
375
+ } & {
376
+ date?: string | null | undefined;
377
+ size?: string;
378
+ } & {
379
+ __TYPE__: "FileLink";
380
+ } & {
381
+ size?: string;
382
+ }) | ({
383
+ __TYPE__: "DocumentLink";
384
+ } & {
385
+ id: string;
386
+ }) | ({
387
+ __TYPE__: "ExternalLink";
388
+ } & {
389
+ url: string;
390
+ } & {
391
+ kind?: "web";
392
+ target?: string | null | undefined;
393
+ preview?: {
394
+ title?: string;
395
+ } | null | undefined;
396
+ }) | null | undefined;
397
+ };
398
+ } & {
399
+ label?: string | null | undefined;
400
+ direction?: string | null | undefined;
401
+ }) | ({
402
+ 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
+ };
421
+ } & {
422
+ label?: string | null | undefined;
423
+ direction?: string | null | undefined;
424
+ }) | ({
425
+ type: "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
426
+ content: {
427
+ text: string;
428
+ } & {
429
+ spans?: ({
430
+ data?: unknown;
431
+ } & {
432
+ start: number;
433
+ end: number;
434
+ type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
435
+ })[];
436
+ };
437
+ } & {
438
+ label?: string;
439
+ direction?: string;
440
+ }), unknown>;
441
+ export declare const Block: t.UnionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
442
+ type: t.LiteralC<"image">;
443
+ data: t.IntersectionC<[t.ExactC<t.IntersectionC<[t.TypeC<{
444
+ origin: t.ExactC<t.TypeC<{
445
+ id: t.StringC;
446
+ url: t.StringC;
447
+ width: t.NumberC;
448
+ height: t.NumberC;
449
+ }>>;
450
+ width: t.NumberC;
451
+ height: t.NumberC;
452
+ edit: t.TypeC<{
453
+ zoom: t.NumberC;
454
+ crop: t.TypeC<{
455
+ x: t.NumberC;
456
+ y: t.NumberC;
457
+ }>;
458
+ background: t.StringC;
459
+ }>;
460
+ }>, t.PartialC<{
461
+ url: t.StringC;
462
+ credits: t.Type<string | null, string | null, unknown>;
463
+ alt: t.Type<string | null, string | null, unknown>;
464
+ provider: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
465
+ }>]>>, t.PartialC<{
466
+ linkTo: t.UnionC<[t.Type<({
467
+ __TYPE__: "ImageLink";
468
+ } & {
469
+ id: string;
470
+ url: string;
471
+ height: string;
472
+ width: string;
473
+ size: string;
474
+ name: string;
475
+ kind: string;
476
+ } & {
477
+ date?: string | null | undefined;
478
+ }) | ({
479
+ id: string;
480
+ url: string;
481
+ name: string;
482
+ kind: string;
483
+ } & {
484
+ date?: string | null | undefined;
485
+ size?: string;
486
+ } & {
487
+ __TYPE__: "FileLink";
488
+ } & {
489
+ size?: string;
490
+ }) | ({
491
+ __TYPE__: "DocumentLink";
492
+ } & {
493
+ id: string;
494
+ }) | ({
495
+ __TYPE__: "ExternalLink";
496
+ } & {
497
+ url: string;
498
+ } & {
499
+ kind?: "web";
500
+ target?: string | null | undefined;
501
+ preview?: {
502
+ title?: string;
503
+ } | null | undefined;
504
+ }), ({
505
+ __TYPE__: "ImageLink";
506
+ } & {
507
+ id: string;
508
+ url: string;
509
+ height: string;
510
+ width: string;
511
+ size: string;
512
+ name: string;
513
+ kind: string;
514
+ } & {
515
+ date?: string | null | undefined;
516
+ }) | ({
517
+ id: string;
518
+ url: string;
519
+ name: string;
520
+ kind: string;
521
+ } & {
522
+ date?: string | null | undefined;
523
+ size?: string;
524
+ } & {
525
+ __TYPE__: "FileLink";
526
+ } & {
527
+ size?: string;
528
+ }) | ({
529
+ __TYPE__: "DocumentLink";
530
+ } & {
531
+ id: string;
532
+ }) | ({
533
+ __TYPE__: "ExternalLink";
534
+ } & {
535
+ url: string;
536
+ } & {
537
+ kind?: "web";
538
+ target?: string | null | undefined;
539
+ preview?: {
540
+ title?: string;
541
+ } | null | undefined;
542
+ }), unknown>, t.NullC, t.UndefinedC]>;
543
+ }>]>;
544
+ }>, t.PartialC<{
545
+ label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
546
+ direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
547
+ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
548
+ 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
+ }>>]>;
567
+ }>, t.PartialC<{
568
+ label: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
569
+ direction: t.UnionC<[t.Type<string, string, unknown>, t.NullC, t.UndefinedC]>;
570
+ }>]>>, t.ExactC<t.IntersectionC<[t.TypeC<{
571
+ type: t.Type<"paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl", "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl", unknown>;
572
+ content: t.IntersectionC<[t.TypeC<{
573
+ text: t.StringC;
574
+ }>, t.PartialC<{
575
+ spans: t.Type<({
576
+ data?: unknown;
577
+ } & {
578
+ start: number;
579
+ end: number;
580
+ type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
581
+ })[], ({
582
+ data?: unknown;
583
+ } & {
584
+ start: number;
585
+ end: number;
586
+ type: "label" | "paragraph" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "strong" | "em" | "preformatted" | "hyperlink" | "image" | "embed" | "list-item" | "o-list-item" | "rtl";
587
+ })[], unknown>;
588
+ }>]>;
589
+ }>, t.PartialC<{
590
+ label: t.StringC;
591
+ direction: t.StringC;
592
+ }>]>>]>;
593
+ export declare type Block = t.TypeOf<typeof Block>;
594
+ export {};