@prismicio/client 7.7.2 → 7.7.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.
Files changed (304) hide show
  1. package/README.md +3 -3
  2. package/dist/buildQueryURL.cjs.map +1 -1
  3. package/dist/buildQueryURL.d.ts +1 -1
  4. package/dist/buildQueryURL.js.map +1 -1
  5. package/dist/cookie.cjs.map +1 -1
  6. package/dist/cookie.js.map +1 -1
  7. package/dist/createClient.cjs +31 -31
  8. package/dist/createClient.cjs.map +1 -1
  9. package/dist/createClient.d.ts +35 -35
  10. package/dist/createClient.js +31 -31
  11. package/dist/createClient.js.map +1 -1
  12. package/dist/errors/ForbiddenError.cjs.map +1 -1
  13. package/dist/errors/ForbiddenError.js.map +1 -1
  14. package/dist/errors/NotFoundError.cjs.map +1 -1
  15. package/dist/errors/NotFoundError.js.map +1 -1
  16. package/dist/errors/ParsingError.cjs.map +1 -1
  17. package/dist/errors/ParsingError.js.map +1 -1
  18. package/dist/errors/PreviewTokenExpired.cjs.map +1 -1
  19. package/dist/errors/PreviewTokenExpired.js.map +1 -1
  20. package/dist/errors/PrismicError.cjs.map +1 -1
  21. package/dist/errors/PrismicError.js.map +1 -1
  22. package/dist/errors/PrismicRichTextSerializerError.cjs.map +1 -1
  23. package/dist/errors/PrismicRichTextSerializerError.js.map +1 -1
  24. package/dist/errors/RefExpiredError.cjs.map +1 -1
  25. package/dist/errors/RefExpiredError.js.map +1 -1
  26. package/dist/errors/RefNotFoundError.cjs.map +1 -1
  27. package/dist/errors/RefNotFoundError.js.map +1 -1
  28. package/dist/errors/RepositoryNotFoundError.cjs.map +1 -1
  29. package/dist/errors/RepositoryNotFoundError.js.map +1 -1
  30. package/dist/filter.cjs.map +1 -1
  31. package/dist/filter.js.map +1 -1
  32. package/dist/getGraphQLEndpoint.cjs.map +1 -1
  33. package/dist/getGraphQLEndpoint.js.map +1 -1
  34. package/dist/getRepositoryEndpoint.cjs.map +1 -1
  35. package/dist/getRepositoryEndpoint.js.map +1 -1
  36. package/dist/getRepositoryName.cjs.map +1 -1
  37. package/dist/getRepositoryName.js.map +1 -1
  38. package/dist/getToolbarSrc.cjs.map +1 -1
  39. package/dist/getToolbarSrc.js.map +1 -1
  40. package/dist/helpers/asDate.cjs.map +1 -1
  41. package/dist/helpers/asDate.js.map +1 -1
  42. package/dist/helpers/asHTML.cjs.map +1 -1
  43. package/dist/helpers/asHTML.d.ts +2 -2
  44. package/dist/helpers/asHTML.js.map +1 -1
  45. package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
  46. package/dist/helpers/asImagePixelDensitySrcSet.d.ts +2 -2
  47. package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
  48. package/dist/helpers/asImageSrc.cjs.map +1 -1
  49. package/dist/helpers/asImageSrc.d.ts +2 -2
  50. package/dist/helpers/asImageSrc.js.map +1 -1
  51. package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
  52. package/dist/helpers/asImageWidthSrcSet.d.ts +2 -2
  53. package/dist/helpers/asImageWidthSrcSet.js.map +1 -1
  54. package/dist/helpers/asLink.cjs.map +1 -1
  55. package/dist/helpers/asLink.d.ts +2 -4
  56. package/dist/helpers/asLink.js.map +1 -1
  57. package/dist/helpers/asLinkAttrs.cjs.map +1 -1
  58. package/dist/helpers/asLinkAttrs.d.ts +2 -2
  59. package/dist/helpers/asLinkAttrs.js.map +1 -1
  60. package/dist/helpers/asText.cjs.map +1 -1
  61. package/dist/helpers/asText.d.ts +1 -1
  62. package/dist/helpers/asText.js.map +1 -1
  63. package/dist/helpers/documentToLinkField.cjs.map +1 -1
  64. package/dist/helpers/documentToLinkField.js.map +1 -1
  65. package/dist/helpers/isFilled.cjs.map +1 -1
  66. package/dist/helpers/isFilled.js.map +1 -1
  67. package/dist/helpers/mapSliceZone.cjs.map +1 -1
  68. package/dist/helpers/mapSliceZone.d.ts +1 -1
  69. package/dist/helpers/mapSliceZone.js.map +1 -1
  70. package/dist/helpers/unstable_htmlAsRichText.cjs.map +1 -1
  71. package/dist/helpers/unstable_htmlAsRichText.d.ts +4 -4
  72. package/dist/helpers/unstable_htmlAsRichText.js.map +1 -1
  73. package/dist/helpers/unstable_markdownAsRichText.cjs.map +1 -1
  74. package/dist/helpers/unstable_markdownAsRichText.d.ts +2 -2
  75. package/dist/helpers/unstable_markdownAsRichText.js.map +1 -1
  76. package/dist/index.cjs.map +1 -1
  77. package/dist/index.js.map +1 -1
  78. package/dist/isRepositoryEndpoint.cjs.map +1 -1
  79. package/dist/isRepositoryEndpoint.js.map +1 -1
  80. package/dist/isRepositoryName.cjs.map +1 -1
  81. package/dist/isRepositoryName.js.map +1 -1
  82. package/dist/lib/RichTextFieldBuilder.cjs.map +1 -1
  83. package/dist/lib/RichTextFieldBuilder.d.ts +1 -1
  84. package/dist/lib/RichTextFieldBuilder.js.map +1 -1
  85. package/dist/lib/appendFilters.cjs.map +1 -1
  86. package/dist/lib/appendFilters.js.map +1 -1
  87. package/dist/lib/castArray.cjs.map +1 -1
  88. package/dist/lib/castArray.js.map +1 -1
  89. package/dist/lib/castThunk.cjs.map +1 -1
  90. package/dist/lib/castThunk.js.map +1 -1
  91. package/dist/lib/devMsg.cjs.map +1 -1
  92. package/dist/lib/devMsg.d.ts +1 -1
  93. package/dist/lib/devMsg.js.map +1 -1
  94. package/dist/lib/escapeHTML.cjs.map +1 -1
  95. package/dist/lib/escapeHTML.js.map +1 -1
  96. package/dist/lib/everyTagFilter.cjs.map +1 -1
  97. package/dist/lib/everyTagFilter.js.map +1 -1
  98. package/dist/lib/filterRichTextField.cjs.map +1 -1
  99. package/dist/lib/filterRichTextField.d.ts +3 -3
  100. package/dist/lib/filterRichTextField.js.map +1 -1
  101. package/dist/lib/findMasterRef.cjs.map +1 -1
  102. package/dist/lib/findMasterRef.d.ts +1 -1
  103. package/dist/lib/findMasterRef.js.map +1 -1
  104. package/dist/lib/findRef.cjs.map +1 -1
  105. package/dist/lib/findRef.d.ts +1 -1
  106. package/dist/lib/findRef.js.map +1 -1
  107. package/dist/lib/findRefByID.cjs.map +1 -1
  108. package/dist/lib/findRefByID.d.ts +1 -1
  109. package/dist/lib/findRefByID.js.map +1 -1
  110. package/dist/lib/findRefByLabel.cjs.map +1 -1
  111. package/dist/lib/findRefByLabel.d.ts +1 -1
  112. package/dist/lib/findRefByLabel.js.map +1 -1
  113. package/dist/lib/getPreviewCookie.cjs.map +1 -1
  114. package/dist/lib/getPreviewCookie.js.map +1 -1
  115. package/dist/lib/hastSerializerHelpers.cjs.map +1 -1
  116. package/dist/lib/hastSerializerHelpers.d.ts +3 -3
  117. package/dist/lib/hastSerializerHelpers.js.map +1 -1
  118. package/dist/lib/hastToRichText.cjs +3 -4
  119. package/dist/lib/hastToRichText.cjs.map +1 -1
  120. package/dist/lib/hastToRichText.d.ts +4 -4
  121. package/dist/lib/hastToRichText.js +3 -4
  122. package/dist/lib/hastToRichText.js.map +1 -1
  123. package/dist/lib/isInternalURL.cjs.map +1 -1
  124. package/dist/lib/isInternalURL.js.map +1 -1
  125. package/dist/lib/minifyGraphQLQuery.cjs.map +1 -1
  126. package/dist/lib/minifyGraphQLQuery.js.map +1 -1
  127. package/dist/lib/rehypeRichText.cjs.map +1 -1
  128. package/dist/lib/rehypeRichText.d.ts +5 -5
  129. package/dist/lib/rehypeRichText.js.map +1 -1
  130. package/dist/lib/serializerHelpers.cjs.map +1 -1
  131. package/dist/lib/serializerHelpers.d.ts +2 -2
  132. package/dist/lib/serializerHelpers.js.map +1 -1
  133. package/dist/lib/someTagsFilter.cjs.map +1 -1
  134. package/dist/lib/someTagsFilter.js.map +1 -1
  135. package/dist/lib/typeFilter.cjs.map +1 -1
  136. package/dist/lib/typeFilter.js.map +1 -1
  137. package/dist/package.json.cjs +1 -1
  138. package/dist/package.json.js +1 -1
  139. package/dist/richtext/asText.cjs.map +1 -1
  140. package/dist/richtext/asText.d.ts +1 -1
  141. package/dist/richtext/asText.js.map +1 -1
  142. package/dist/richtext/asTree.cjs.map +1 -1
  143. package/dist/richtext/asTree.d.ts +2 -2
  144. package/dist/richtext/asTree.js.map +1 -1
  145. package/dist/richtext/composeSerializers.cjs.map +1 -1
  146. package/dist/richtext/composeSerializers.d.ts +1 -1
  147. package/dist/richtext/composeSerializers.js.map +1 -1
  148. package/dist/richtext/serialize.cjs.map +1 -1
  149. package/dist/richtext/serialize.d.ts +1 -1
  150. package/dist/richtext/serialize.js.map +1 -1
  151. package/dist/richtext/types.cjs.map +1 -1
  152. package/dist/richtext/types.d.ts +1 -1
  153. package/dist/richtext/types.js.map +1 -1
  154. package/dist/richtext/wrapMapSerializer.cjs.map +1 -1
  155. package/dist/richtext/wrapMapSerializer.d.ts +1 -1
  156. package/dist/richtext/wrapMapSerializer.js.map +1 -1
  157. package/dist/types/api/query.d.ts +1 -1
  158. package/dist/types/api/release.d.ts +1 -1
  159. package/dist/types/api/repository.d.ts +1 -1
  160. package/dist/types/model/customType.d.ts +1 -1
  161. package/dist/types/model/link.cjs.map +1 -1
  162. package/dist/types/model/link.js.map +1 -1
  163. package/dist/types/model/slice.cjs.map +1 -1
  164. package/dist/types/model/slice.js.map +1 -1
  165. package/dist/types/model/sliceZone.cjs.map +1 -1
  166. package/dist/types/model/sliceZone.js.map +1 -1
  167. package/dist/types/model/title.d.ts +1 -1
  168. package/dist/types/model/types.cjs.map +1 -1
  169. package/dist/types/model/types.js.map +1 -1
  170. package/dist/types/value/document.d.ts +4 -4
  171. package/dist/types/value/embed.cjs.map +1 -1
  172. package/dist/types/value/embed.js.map +1 -1
  173. package/dist/types/value/link.cjs.map +1 -1
  174. package/dist/types/value/link.js.map +1 -1
  175. package/dist/types/value/richText.cjs.map +1 -1
  176. package/dist/types/value/richText.js.map +1 -1
  177. package/dist/types/webhook/apiUpdate.d.ts +1 -1
  178. package/dist/types/webhook/testTrigger.d.ts +1 -1
  179. package/dist/types/webhook/types.cjs.map +1 -1
  180. package/dist/types/webhook/types.d.ts +2 -2
  181. package/dist/types/webhook/types.js.map +1 -1
  182. package/package.json +1 -1
  183. package/src/buildQueryURL.ts +51 -51
  184. package/src/cookie.ts +1 -1
  185. package/src/createClient.ts +293 -293
  186. package/src/errors/ForbiddenError.ts +6 -6
  187. package/src/errors/NotFoundError.ts +1 -1
  188. package/src/errors/ParsingError.ts +8 -8
  189. package/src/errors/PreviewTokenExpired.ts +4 -4
  190. package/src/errors/PrismicError.ts +5 -5
  191. package/src/errors/PrismicRichTextSerializerError.ts +1 -1
  192. package/src/errors/RefExpiredError.ts +4 -4
  193. package/src/errors/RefNotFoundError.ts +4 -4
  194. package/src/errors/RepositoryNotFoundError.ts +1 -1
  195. package/src/filter.ts +22 -22
  196. package/src/getGraphQLEndpoint.ts +5 -5
  197. package/src/getRepositoryEndpoint.ts +5 -5
  198. package/src/getRepositoryName.ts +4 -4
  199. package/src/getToolbarSrc.ts +5 -5
  200. package/src/helpers/asDate.ts +7 -7
  201. package/src/helpers/asHTML.ts +54 -56
  202. package/src/helpers/asImagePixelDensitySrcSet.ts +14 -17
  203. package/src/helpers/asImageSrc.ts +9 -8
  204. package/src/helpers/asImageWidthSrcSet.ts +19 -22
  205. package/src/helpers/asLink.ts +26 -27
  206. package/src/helpers/asLinkAttrs.ts +30 -29
  207. package/src/helpers/asText.ts +15 -15
  208. package/src/helpers/documentToLinkField.ts +6 -6
  209. package/src/helpers/isFilled.ts +53 -53
  210. package/src/helpers/mapSliceZone.ts +34 -34
  211. package/src/helpers/unstable_htmlAsRichText.ts +23 -22
  212. package/src/helpers/unstable_markdownAsRichText.ts +14 -13
  213. package/src/index.ts +119 -119
  214. package/src/isRepositoryEndpoint.ts +4 -4
  215. package/src/isRepositoryName.ts +2 -2
  216. package/src/lib/RichTextFieldBuilder.ts +36 -41
  217. package/src/lib/appendFilters.ts +4 -4
  218. package/src/lib/castArray.ts +2 -2
  219. package/src/lib/castThunk.ts +2 -2
  220. package/src/lib/devMsg.ts +4 -4
  221. package/src/lib/escapeHTML.ts +24 -24
  222. package/src/lib/everyTagFilter.ts +4 -4
  223. package/src/lib/filterRichTextField.ts +31 -31
  224. package/src/lib/findMasterRef.ts +4 -4
  225. package/src/lib/findRef.ts +6 -6
  226. package/src/lib/findRefByID.ts +4 -4
  227. package/src/lib/findRefByLabel.ts +4 -4
  228. package/src/lib/getPreviewCookie.ts +11 -11
  229. package/src/lib/hastSerializerHelpers.ts +41 -37
  230. package/src/lib/hastToRichText.ts +74 -73
  231. package/src/lib/isInternalURL.ts +4 -4
  232. package/src/lib/minifyGraphQLQuery.ts +2 -2
  233. package/src/lib/rehypeRichText.ts +42 -41
  234. package/src/lib/serializerHelpers.ts +53 -54
  235. package/src/lib/someTagsFilter.ts +4 -4
  236. package/src/lib/typeFilter.ts +3 -3
  237. package/src/richtext/asText.ts +5 -5
  238. package/src/richtext/asTree.ts +53 -53
  239. package/src/richtext/composeSerializers.ts +6 -6
  240. package/src/richtext/index.ts +7 -7
  241. package/src/richtext/serialize.ts +11 -11
  242. package/src/richtext/types.ts +38 -38
  243. package/src/richtext/wrapMapSerializer.ts +6 -9
  244. package/src/types/api/query.ts +9 -9
  245. package/src/types/api/ref.ts +5 -5
  246. package/src/types/api/release.ts +2 -2
  247. package/src/types/api/repository.ts +24 -24
  248. package/src/types/api/tags.ts +1 -1
  249. package/src/types/model/boolean.ts +7 -7
  250. package/src/types/model/color.ts +5 -5
  251. package/src/types/model/contentRelationship.ts +9 -9
  252. package/src/types/model/customType.ts +9 -9
  253. package/src/types/model/date.ts +6 -6
  254. package/src/types/model/embed.ts +5 -5
  255. package/src/types/model/geoPoint.ts +4 -4
  256. package/src/types/model/group.ts +6 -6
  257. package/src/types/model/image.ts +9 -9
  258. package/src/types/model/integration.ts +6 -6
  259. package/src/types/model/keyText.ts +5 -5
  260. package/src/types/model/link.ts +8 -8
  261. package/src/types/model/linkToMedia.ts +7 -7
  262. package/src/types/model/number.ts +7 -7
  263. package/src/types/model/range.ts +8 -8
  264. package/src/types/model/richText.ts +16 -16
  265. package/src/types/model/select.ts +7 -7
  266. package/src/types/model/separator.ts +4 -4
  267. package/src/types/model/sharedSlice.ts +7 -7
  268. package/src/types/model/sharedSliceVariation.ts +9 -9
  269. package/src/types/model/slice.ts +12 -12
  270. package/src/types/model/sliceZone.ts +11 -11
  271. package/src/types/model/timestamp.ts +6 -6
  272. package/src/types/model/title.ts +2 -2
  273. package/src/types/model/types.ts +26 -26
  274. package/src/types/model/uid.ts +5 -5
  275. package/src/types/value/boolean.ts +1 -1
  276. package/src/types/value/color.ts +2 -2
  277. package/src/types/value/contentRelationship.ts +15 -15
  278. package/src/types/value/date.ts +2 -2
  279. package/src/types/value/document.ts +23 -23
  280. package/src/types/value/embed.ts +33 -33
  281. package/src/types/value/geoPoint.ts +4 -4
  282. package/src/types/value/group.ts +3 -3
  283. package/src/types/value/image.ts +21 -21
  284. package/src/types/value/integration.ts +2 -2
  285. package/src/types/value/keyText.ts +2 -2
  286. package/src/types/value/link.ts +12 -12
  287. package/src/types/value/linkToMedia.ts +11 -11
  288. package/src/types/value/number.ts +2 -2
  289. package/src/types/value/richText.ts +58 -58
  290. package/src/types/value/select.ts +2 -2
  291. package/src/types/value/sharedSlice.ts +5 -5
  292. package/src/types/value/sharedSliceVariation.ts +5 -5
  293. package/src/types/value/slice.ts +6 -6
  294. package/src/types/value/sliceZone.ts +4 -4
  295. package/src/types/value/timestamp.ts +3 -3
  296. package/src/types/value/title.ts +4 -4
  297. package/src/types/value/types.ts +22 -22
  298. package/src/types/webhook/apiUpdate.ts +18 -18
  299. package/src/types/webhook/testTrigger.ts +2 -2
  300. package/src/types/webhook/types.ts +8 -8
  301. package/dist/_node_modules/hast-util-whitespace/lib/index.cjs +0 -11
  302. package/dist/_node_modules/hast-util-whitespace/lib/index.cjs.map +0 -1
  303. package/dist/_node_modules/hast-util-whitespace/lib/index.js +0 -11
  304. package/dist/_node_modules/hast-util-whitespace/lib/index.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  RTAnyNode,
3
3
  RTEmNode,
4
4
  RTEmbedNode,
@@ -19,9 +19,9 @@ import {
19
19
  RTPreformattedNode,
20
20
  RTSpanNode,
21
21
  RTStrongNode,
22
- RichTextNodeType,
23
22
  RichTextNodeTypes,
24
- } from "../types/value/richText";
23
+ } from "../types/value/richText"
24
+ import { RichTextNodeType } from "../types/value/richText"
25
25
 
26
26
  // Serializers
27
27
 
@@ -38,7 +38,7 @@ export type RichTextFunctionSerializer<ReturnType> = (
38
38
  text: string | undefined,
39
39
  children: ReturnType[],
40
40
  key: string,
41
- ) => ReturnType | null | undefined;
41
+ ) => ReturnType | null | undefined
42
42
 
43
43
  /**
44
44
  * Map serializer's tag function serializer, can be helpful for typing those
@@ -51,12 +51,12 @@ export type RichTextMapSerializerFunction<
51
51
  Node extends RTAnyNode = RTAnyNode,
52
52
  TextType = string | undefined,
53
53
  > = (payload: {
54
- type: Node["type"];
55
- node: Node;
56
- text: TextType;
57
- children: ReturnType[];
58
- key: string;
59
- }) => ReturnType | null | undefined;
54
+ type: Node["type"]
55
+ node: Node
56
+ text: TextType
57
+ children: ReturnType[]
58
+ key: string
59
+ }) => ReturnType | null | undefined
60
60
 
61
61
  /**
62
62
  * Serializes a node from a rich text or title field with a map
@@ -74,75 +74,75 @@ export type RichTextMapSerializer<ReturnType> = {
74
74
  ReturnType,
75
75
  RTHeading1Node,
76
76
  undefined
77
- >;
77
+ >
78
78
  heading2?: RichTextMapSerializerFunction<
79
79
  ReturnType,
80
80
  RTHeading2Node,
81
81
  undefined
82
- >;
82
+ >
83
83
  heading3?: RichTextMapSerializerFunction<
84
84
  ReturnType,
85
85
  RTHeading3Node,
86
86
  undefined
87
- >;
87
+ >
88
88
  heading4?: RichTextMapSerializerFunction<
89
89
  ReturnType,
90
90
  RTHeading4Node,
91
91
  undefined
92
- >;
92
+ >
93
93
  heading5?: RichTextMapSerializerFunction<
94
94
  ReturnType,
95
95
  RTHeading5Node,
96
96
  undefined
97
- >;
97
+ >
98
98
  heading6?: RichTextMapSerializerFunction<
99
99
  ReturnType,
100
100
  RTHeading6Node,
101
101
  undefined
102
- >;
102
+ >
103
103
  paragraph?: RichTextMapSerializerFunction<
104
104
  ReturnType,
105
105
  RTParagraphNode,
106
106
  undefined
107
- >;
107
+ >
108
108
  preformatted?: RichTextMapSerializerFunction<
109
109
  ReturnType,
110
110
  RTPreformattedNode,
111
111
  undefined
112
- >;
113
- strong?: RichTextMapSerializerFunction<ReturnType, RTStrongNode, string>;
114
- em?: RichTextMapSerializerFunction<ReturnType, RTEmNode, string>;
112
+ >
113
+ strong?: RichTextMapSerializerFunction<ReturnType, RTStrongNode, string>
114
+ em?: RichTextMapSerializerFunction<ReturnType, RTEmNode, string>
115
115
  listItem?: RichTextMapSerializerFunction<
116
116
  ReturnType,
117
117
  RTListItemNode,
118
118
  undefined
119
- >;
119
+ >
120
120
  oListItem?: RichTextMapSerializerFunction<
121
121
  ReturnType,
122
122
  RTOListItemNode,
123
123
  undefined
124
- >;
125
- list?: RichTextMapSerializerFunction<ReturnType, RTListNode, undefined>;
126
- oList?: RichTextMapSerializerFunction<ReturnType, RTOListNode, undefined>;
127
- image?: RichTextMapSerializerFunction<ReturnType, RTImageNode, undefined>;
128
- embed?: RichTextMapSerializerFunction<ReturnType, RTEmbedNode, undefined>;
129
- hyperlink?: RichTextMapSerializerFunction<ReturnType, RTLinkNode, string>;
130
- label?: RichTextMapSerializerFunction<ReturnType, RTLabelNode, string>;
131
- span?: RichTextMapSerializerFunction<ReturnType, RTSpanNode, string>;
132
- };
124
+ >
125
+ list?: RichTextMapSerializerFunction<ReturnType, RTListNode, undefined>
126
+ oList?: RichTextMapSerializerFunction<ReturnType, RTOListNode, undefined>
127
+ image?: RichTextMapSerializerFunction<ReturnType, RTImageNode, undefined>
128
+ embed?: RichTextMapSerializerFunction<ReturnType, RTEmbedNode, undefined>
129
+ hyperlink?: RichTextMapSerializerFunction<ReturnType, RTLinkNode, string>
130
+ label?: RichTextMapSerializerFunction<ReturnType, RTLabelNode, string>
131
+ span?: RichTextMapSerializerFunction<ReturnType, RTSpanNode, string>
132
+ }
133
133
 
134
134
  // Tree
135
135
  export interface Tree {
136
- key: string;
137
- children: TreeNode[];
136
+ key: string
137
+ children: TreeNode[]
138
138
  }
139
139
 
140
140
  export interface TreeNode {
141
- key: string;
142
- type: RichTextNodeTypes;
143
- text?: string;
144
- node: RTAnyNode;
145
- children: TreeNode[];
141
+ key: string
142
+ type: RichTextNodeTypes
143
+ text?: string
144
+ node: RTAnyNode
145
+ children: TreeNode[]
146
146
  }
147
147
 
148
148
  // Helpers
@@ -151,4 +151,4 @@ export const RichTextReversedNodeType = {
151
151
  [RichTextNodeType.oListItem]: "oListItem",
152
152
  [RichTextNodeType.list]: "list",
153
153
  [RichTextNodeType.oList]: "oList",
154
- } as const;
154
+ } as const
@@ -1,8 +1,5 @@
1
- import {
2
- RichTextFunctionSerializer,
3
- RichTextMapSerializer,
4
- RichTextReversedNodeType,
5
- } from "./types";
1
+ import type { RichTextFunctionSerializer, RichTextMapSerializer } from "./types"
2
+ import { RichTextReversedNodeType } from "./types"
6
3
 
7
4
  /**
8
5
  * Wraps a map serializer into a regular function serializer
@@ -26,7 +23,7 @@ export const wrapMapSerializer = <SerializerReturnType>(
26
23
  (RichTextReversedNodeType[
27
24
  type as keyof typeof RichTextReversedNodeType
28
25
  ] || type) as keyof RichTextMapSerializer<SerializerReturnType>
29
- ];
26
+ ]
30
27
 
31
28
  if (tagSerializer) {
32
29
  return tagSerializer({
@@ -40,7 +37,7 @@ export const wrapMapSerializer = <SerializerReturnType>(
40
37
  children,
41
38
  // @ts-expect-error cannot type check here
42
39
  key,
43
- });
40
+ })
44
41
  }
45
- };
46
- };
42
+ }
43
+ }
@@ -1,4 +1,4 @@
1
- import { PrismicDocument } from "../value/document";
1
+ import type { PrismicDocument } from "../value/document"
2
2
 
3
3
  /**
4
4
  * A query response from the Prismic REST API V2. The response contains
@@ -12,40 +12,40 @@ export interface Query<Document extends PrismicDocument = PrismicDocument> {
12
12
  /**
13
13
  * The page number for this page of results.
14
14
  */
15
- page: number;
15
+ page: number
16
16
 
17
17
  /**
18
18
  * Maximum number of results per page.
19
19
  */
20
- results_per_page: number;
20
+ results_per_page: number
21
21
 
22
22
  /**
23
23
  * Number of results in this page.
24
24
  */
25
- results_size: number;
25
+ results_size: number
26
26
 
27
27
  /**
28
28
  * Total number of results within all pages.
29
29
  */
30
- total_results_size: number;
30
+ total_results_size: number
31
31
 
32
32
  /**
33
33
  * Total number of pages.
34
34
  */
35
- total_pages: number;
35
+ total_pages: number
36
36
 
37
37
  /**
38
38
  * The Prismic REST API V2 URL to the next page, if one exists.
39
39
  */
40
- next_page: string | null;
40
+ next_page: string | null
41
41
 
42
42
  /**
43
43
  * The Prismic REST API V2 URL to the previous page, if one exists.
44
44
  */
45
- prev_page: string | null;
45
+ prev_page: string | null
46
46
 
47
47
  /**
48
48
  * A paginated list of documents matching the query.
49
49
  */
50
- results: Document[];
50
+ results: Document[]
51
51
  }
@@ -7,24 +7,24 @@ export interface Ref {
7
7
  /**
8
8
  * The unique identifier for the ref.
9
9
  */
10
- id: string;
10
+ id: string
11
11
 
12
12
  /**
13
13
  * The identifier that should be provided to the API to select a content
14
14
  * version.
15
15
  */
16
- ref: string;
16
+ ref: string
17
17
 
18
18
  /**
19
19
  * A human-readable name for the ref. The master ref is always named "Master".
20
20
  */
21
- label: string;
21
+ label: string
22
22
 
23
23
  /**
24
24
  * Determines if the ref is the master ref. The master ref contains the latest
25
25
  * published content.
26
26
  */
27
- isMasterRef: boolean;
27
+ isMasterRef: boolean
28
28
 
29
29
  /**
30
30
  * If the ref is associated with a Release, this field contains the timestamp
@@ -32,5 +32,5 @@ export interface Ref {
32
32
  *
33
33
  * @see More details on Releases: {@link https://prismic.io/docs/guides/draft-plan-and-schedule-content#releases}
34
34
  */
35
- scheduledAt?: string;
35
+ scheduledAt?: string
36
36
  }
@@ -1,4 +1,4 @@
1
- import { Ref } from "./ref";
1
+ import type { Ref } from "./ref"
2
2
 
3
3
  /**
4
4
  * Metadata for a Release.
@@ -9,4 +9,4 @@ import { Ref } from "./ref";
9
9
  * @see {@link Ref}
10
10
  * @see More details on Releases: {@link https://prismic.io/docs/guides/draft-plan-and-schedule-content#releases}
11
11
  */
12
- export type Release = Ref;
12
+ export type Release = Ref
@@ -1,4 +1,4 @@
1
- import { Ref } from "./ref";
1
+ import type { Ref } from "./ref"
2
2
 
3
3
  /**
4
4
  * Repository metadata returned from the Prismic REST API V2. This data can be
@@ -12,70 +12,70 @@ export interface Repository {
12
12
  *
13
13
  * @see {@link Ref}
14
14
  */
15
- refs: Ref[];
15
+ refs: Ref[]
16
16
 
17
17
  /**
18
18
  * An identifier used to query content with the latest integration fields
19
19
  * data.
20
20
  */
21
- integrationFieldsRef: string | null;
21
+ integrationFieldsRef: string | null
22
22
 
23
23
  /**
24
24
  * A list of languages for the repository.
25
25
  *
26
26
  * @see {@link Language}
27
27
  */
28
- languages: Language[];
28
+ languages: Language[]
29
29
 
30
30
  /**
31
31
  * A list of the repository's custom type API IDs mapped to their
32
32
  * human-readable name.
33
33
  */
34
- types: Record<string, string>;
34
+ types: Record<string, string>
35
35
 
36
36
  /**
37
37
  * @deprecated Tags are only available in the forms object.
38
38
  *
39
39
  * @see More details in the blog post "A change to how the Prismic API handles tags": {@link https://prismic.io/blog/a-change-to-how-the-prismic-api-handles-tags}
40
40
  */
41
- tags: string[];
41
+ tags: string[]
42
42
 
43
43
  /**
44
44
  * An internally-used list of REST API features for the repository.
45
45
  *
46
46
  * @internal
47
47
  */
48
- forms: Record<string, Form>;
48
+ forms: Record<string, Form>
49
49
 
50
50
  /**
51
51
  * The URL used to begin the OAuth process for the repository.
52
52
  */
53
- oauth_initiate: string;
53
+ oauth_initiate: string
54
54
 
55
55
  /**
56
56
  * The token used for the OAuth process for the repository.
57
57
  */
58
- oauth_token: string;
58
+ oauth_token: string
59
59
 
60
60
  /**
61
61
  * The version of the API.
62
62
  */
63
- version: string;
63
+ version: string
64
64
 
65
65
  /**
66
66
  * Licensing information for the repository content.
67
67
  */
68
- license: string;
68
+ license: string
69
69
 
70
70
  /**
71
71
  * @deprecated Experiments are no longer part of Prismic.
72
72
  */
73
- experiments: unknown;
73
+ experiments: unknown
74
74
 
75
75
  /**
76
76
  * @deprecated Bookmarks are not longer part of Prismic.
77
77
  */
78
- bookmarks: Record<string, string>;
78
+ bookmarks: Record<string, string>
79
79
  }
80
80
 
81
81
  /**
@@ -85,12 +85,12 @@ export interface Language {
85
85
  /**
86
86
  * A unique identifier for the language.
87
87
  */
88
- id: string;
88
+ id: string
89
89
 
90
90
  /**
91
91
  * The name of the language.
92
92
  */
93
- name: string;
93
+ name: string
94
94
  }
95
95
 
96
96
  /**
@@ -100,12 +100,12 @@ export interface Language {
100
100
  * @internal
101
101
  */
102
102
  export interface Form {
103
- method: "GET";
104
- enctype: string;
105
- action: string;
106
- name?: string;
107
- rel?: string;
108
- fields: Record<string, FormField>;
103
+ method: "GET"
104
+ enctype: string
105
+ action: string
106
+ name?: string
107
+ rel?: string
108
+ fields: Record<string, FormField>
109
109
  }
110
110
 
111
111
  /**
@@ -115,7 +115,7 @@ export interface Form {
115
115
  * @internal
116
116
  */
117
117
  export interface FormField {
118
- type: "String" | "Integer";
119
- multiple: boolean;
120
- default?: string;
118
+ type: "String" | "Integer"
119
+ multiple: boolean
120
+ default?: string
121
121
  }
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * @see More details on the Tags API: {@link https://prismic.io/docs/tags-api-technical-reference}
8
8
  */
9
- export type Tags<Tag extends string = string> = Tag[];
9
+ export type Tags<Tag extends string = string> = Tag[]
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types"
2
2
 
3
3
  /**
4
4
  * A boolean custom type field.
@@ -6,11 +6,11 @@ import type { CustomTypeModelFieldType } from "./types";
6
6
  * More details: {@link https://prismic.io/docs/boolean}
7
7
  */
8
8
  export interface CustomTypeModelBooleanField {
9
- type: typeof CustomTypeModelFieldType.Boolean;
9
+ type: typeof CustomTypeModelFieldType.Boolean
10
10
  config?: {
11
- label?: string | null;
12
- default_value?: boolean;
13
- placeholder_true?: string;
14
- placeholder_false?: string;
15
- };
11
+ label?: string | null
12
+ default_value?: boolean
13
+ placeholder_true?: string
14
+ placeholder_false?: string
15
+ }
16
16
  }
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types"
2
2
 
3
3
  /**
4
4
  * A color custom type field.
@@ -6,9 +6,9 @@ import type { CustomTypeModelFieldType } from "./types";
6
6
  * More details: {@link https://prismic.io/docs/color}
7
7
  */
8
8
  export interface CustomTypeModelColorField {
9
- type: typeof CustomTypeModelFieldType.Color;
9
+ type: typeof CustomTypeModelFieldType.Color
10
10
  config?: {
11
- label?: string | null;
12
- placeholder?: string;
13
- };
11
+ label?: string | null
12
+ placeholder?: string
13
+ }
14
14
  }
@@ -1,6 +1,6 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types"
2
2
 
3
- import type { CustomTypeModelLinkSelectType } from "./link";
3
+ import type { CustomTypeModelLinkSelectType } from "./link"
4
4
 
5
5
  /**
6
6
  * A content relationship custom type field.
@@ -11,12 +11,12 @@ export interface CustomTypeModelContentRelationshipField<
11
11
  CustomTypeIDs extends string = string,
12
12
  Tags extends string = string,
13
13
  > {
14
- type: typeof CustomTypeModelFieldType.Link;
14
+ type: typeof CustomTypeModelFieldType.Link
15
15
  config?: {
16
- label?: string | null;
17
- placeholder?: string;
18
- select: typeof CustomTypeModelLinkSelectType.Document;
19
- customtypes?: readonly CustomTypeIDs[];
20
- tags?: readonly Tags[];
21
- };
16
+ label?: string | null
17
+ placeholder?: string
18
+ select: typeof CustomTypeModelLinkSelectType.Document
19
+ customtypes?: readonly CustomTypeIDs[]
20
+ tags?: readonly Tags[]
21
+ }
22
22
  }
@@ -1,4 +1,4 @@
1
- import { CustomTypeModelField } from "./types";
1
+ import type { CustomTypeModelField } from "./types"
2
2
 
3
3
  /**
4
4
  * A Prismic custom type model.
@@ -13,35 +13,35 @@ export interface CustomTypeModel<
13
13
  /**
14
14
  * The ID of the custom type model.
15
15
  */
16
- id: ID;
16
+ id: ID
17
17
 
18
18
  /**
19
19
  * The human readable name of the custom type model.
20
20
  */
21
21
  // TODO: Revert to `label?: string | null` if `label` can be partial in: https://github.com/prismicio/prismic-types-internal/blob/HEAD/src/customtypes/CustomType.ts#L39
22
- label: string | null | undefined;
22
+ label: string | null | undefined
23
23
 
24
24
  /**
25
25
  * The format of the custom type model.
26
26
  *
27
27
  * Fallback to "custom" if undefined.
28
28
  */
29
- format?: "page" | "custom";
29
+ format?: "page" | "custom"
30
30
 
31
31
  /**
32
32
  * Determines if more than one document for the custom type can be created.
33
33
  */
34
- repeatable: boolean;
34
+ repeatable: boolean
35
35
 
36
36
  /**
37
37
  * The custom type model definition.
38
38
  */
39
- json: Definition;
39
+ json: Definition
40
40
 
41
41
  /**
42
42
  * Determines if new documents for the custom type can be created.
43
43
  */
44
- status: boolean;
44
+ status: boolean
45
45
  }
46
46
 
47
47
  /**
@@ -52,7 +52,7 @@ export interface CustomTypeModel<
52
52
  export type CustomTypeModelDefinition<TabName extends string = string> = Record<
53
53
  TabName,
54
54
  CustomTypeModelTab
55
- >;
55
+ >
56
56
 
57
57
  /**
58
58
  * A custom type's tab. Each tab can contain any number of fields but is limited
@@ -65,4 +65,4 @@ export type CustomTypeModelTab<
65
65
  string,
66
66
  CustomTypeModelField
67
67
  >,
68
- > = Fields;
68
+ > = Fields
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types"
2
2
 
3
3
  /**
4
4
  * A date custom type field.
@@ -6,10 +6,10 @@ import type { CustomTypeModelFieldType } from "./types";
6
6
  * More details: {@link https://prismic.io/docs/date}
7
7
  */
8
8
  export interface CustomTypeModelDateField {
9
- type: typeof CustomTypeModelFieldType.Date;
9
+ type: typeof CustomTypeModelFieldType.Date
10
10
  config?: {
11
- label?: string | null;
12
- placeholder?: string;
13
- default?: string;
14
- };
11
+ label?: string | null
12
+ placeholder?: string
13
+ default?: string
14
+ }
15
15
  }
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types"
2
2
 
3
3
  /**
4
4
  * An embed custom type field.
@@ -6,9 +6,9 @@ import type { CustomTypeModelFieldType } from "./types";
6
6
  * More details: {@link https://prismic.io/docs/embed}
7
7
  */
8
8
  export interface CustomTypeModelEmbedField {
9
- type: typeof CustomTypeModelFieldType.Embed;
9
+ type: typeof CustomTypeModelFieldType.Embed
10
10
  config?: {
11
- label?: string | null;
12
- placeholder?: string;
13
- };
11
+ label?: string | null
12
+ placeholder?: string
13
+ }
14
14
  }
@@ -1,4 +1,4 @@
1
- import type { CustomTypeModelFieldType } from "./types";
1
+ import type { CustomTypeModelFieldType } from "./types"
2
2
 
3
3
  /**
4
4
  * A geopoint custom type field.
@@ -6,8 +6,8 @@ import type { CustomTypeModelFieldType } from "./types";
6
6
  * More details: {@link https://prismic.io/docs/geopoint}
7
7
  */
8
8
  export interface CustomTypeModelGeoPointField {
9
- type: typeof CustomTypeModelFieldType.GeoPoint;
9
+ type: typeof CustomTypeModelFieldType.GeoPoint
10
10
  config?: {
11
- label?: string | null;
12
- };
11
+ label?: string | null
12
+ }
13
13
  }
@@ -2,7 +2,7 @@ import type {
2
2
  CustomTypeModelFieldForGroup,
3
3
  CustomTypeModelFieldForNestedGroup,
4
4
  CustomTypeModelFieldType,
5
- } from "./types";
5
+ } from "./types"
6
6
 
7
7
  /**
8
8
  * A group custom type field.
@@ -17,11 +17,11 @@ export interface CustomTypeModelGroupField<
17
17
  CustomTypeModelFieldForGroup
18
18
  >,
19
19
  > {
20
- type: typeof CustomTypeModelFieldType.Group;
20
+ type: typeof CustomTypeModelFieldType.Group
21
21
  config?: {
22
- label?: string | null;
23
- fields?: Fields;
24
- };
22
+ label?: string | null
23
+ fields?: Fields
24
+ }
25
25
  }
26
26
 
27
27
  /**
@@ -36,4 +36,4 @@ export type CustomTypeModelNestedGroupField<
36
36
  string,
37
37
  CustomTypeModelFieldForNestedGroup
38
38
  >,
39
- > = CustomTypeModelGroupField<Fields>;
39
+ > = CustomTypeModelGroupField<Fields>