@prismicio/vue 3.1.3 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +1 -1
  2. package/dist/components/PrismicEmbed.cjs.map +1 -1
  3. package/dist/components/PrismicEmbed.d.ts +57 -63
  4. package/dist/components/PrismicEmbed.js.map +1 -1
  5. package/dist/components/PrismicImage.cjs.map +1 -1
  6. package/dist/components/PrismicImage.d.ts +162 -162
  7. package/dist/components/PrismicImage.js.map +1 -1
  8. package/dist/components/PrismicLink.cjs.map +1 -1
  9. package/dist/components/PrismicLink.d.ts +191 -191
  10. package/dist/components/PrismicLink.js.map +1 -1
  11. package/dist/components/PrismicRichText.cjs +7 -2
  12. package/dist/components/PrismicRichText.cjs.map +1 -1
  13. package/dist/components/PrismicRichText.d.ts +160 -139
  14. package/dist/components/PrismicRichText.js +7 -2
  15. package/dist/components/PrismicRichText.js.map +1 -1
  16. package/dist/components/PrismicText.cjs.map +1 -1
  17. package/dist/components/PrismicText.d.ts +117 -117
  18. package/dist/components/PrismicText.js.map +1 -1
  19. package/dist/components/SliceZone.cjs.map +1 -1
  20. package/dist/components/SliceZone.d.ts +357 -359
  21. package/dist/components/SliceZone.js.map +1 -1
  22. package/dist/components/index.d.ts +12 -12
  23. package/dist/composables.d.ts +366 -366
  24. package/dist/createPrismic.cjs +3 -3
  25. package/dist/createPrismic.cjs.map +1 -1
  26. package/dist/createPrismic.d.ts +12 -12
  27. package/dist/createPrismic.js +3 -3
  28. package/dist/createPrismic.js.map +1 -1
  29. package/dist/globalExtensions.d.ts +11 -11
  30. package/dist/index.cjs +16 -16
  31. package/dist/index.d.ts +10 -10
  32. package/dist/index.js +3 -3
  33. package/dist/injectionSymbols.d.ts +9 -9
  34. package/dist/lib/__PRODUCTION__.d.ts +7 -7
  35. package/dist/lib/getSlots.d.ts +14 -14
  36. package/dist/lib/isInternalURL.d.ts +8 -8
  37. package/dist/lib/simplyResolveComponent.cjs.map +1 -1
  38. package/dist/lib/simplyResolveComponent.d.ts +12 -12
  39. package/dist/lib/simplyResolveComponent.js.map +1 -1
  40. package/dist/types.d.ts +366 -357
  41. package/dist/usePrismic.d.ts +21 -21
  42. package/dist/useStatefulPrismicClientMethod.d.ts +64 -64
  43. package/package.json +15 -15
  44. package/src/components/PrismicEmbed.ts +6 -2
  45. package/src/components/PrismicImage.ts +6 -2
  46. package/src/components/PrismicLink.ts +11 -5
  47. package/src/components/PrismicRichText.ts +30 -5
  48. package/src/components/PrismicText.ts +6 -2
  49. package/src/components/SliceZone.ts +8 -2
  50. package/src/createPrismic.ts +3 -6
  51. package/src/lib/simplyResolveComponent.ts +8 -2
  52. package/src/types.ts +15 -4
package/dist/types.d.ts CHANGED
@@ -1,357 +1,366 @@
1
- import type { App, ConcreteComponent, Ref } from "vue";
2
- import type { Client, ClientConfig, cookie, predicate } from "@prismicio/client";
3
- import type { asText, asHTML, asLink, asDate, documentToLinkField, HTMLFunctionSerializer, HTMLMapSerializer, LinkResolverFunction, asImageSrc, asImageWidthSrcSet, asImagePixelDensitySrcSet } from "@prismicio/helpers";
4
- import type { SliceComponentType } from "./components/SliceZone";
5
- /**
6
- * Options used by `@prismicio/vue` components.
7
- */
8
- type PrismicPluginComponentsOptions = {
9
- /**
10
- * Value of the `rel` attribute to use on links rendered with
11
- * `target="_blank"`
12
- *
13
- * @defaultValue `"noopener noreferrer"`
14
- */
15
- linkBlankTargetRelAttribute?: string;
16
- /**
17
- * An HTML tag name, a component, or a functional component used to render
18
- * internal links.
19
- *
20
- * @remarks
21
- * HTML tag names will be rendered using the anchor tag interface (`href`,
22
- * `target`, and `rel` attributes).
23
- * @remarks
24
- * Components will be rendered using Vue Router {@link RouterLink} interface
25
- * (`to` props).
26
- * @defaultValue {@link RouterLink}
27
- */
28
- linkInternalComponent?: string | ConcreteComponent;
29
- /**
30
- * An HTML tag name, a component, or a functional component used to render
31
- * external links.
32
- *
33
- * @remarks
34
- * HTML tag names will be rendered using the anchor tag interface (`href`,
35
- * `target`, and `rel` attributes).
36
- * @remarks
37
- * Components will be rendered using Vue Router {@link RouterLink} interface
38
- * (`to` props).
39
- * @defaultValue `"a"`
40
- */
41
- linkExternalComponent?: string | ConcreteComponent;
42
- /**
43
- * An HTML tag name, a component, or a functional component used to render
44
- * images.
45
- *
46
- * @remarks
47
- * HTML tag names and components will be rendered using the `img` tag
48
- * interface (`src` and `alt` attribute). Components will also receive an
49
- * additional `copyright` props.
50
- * @defaultValue `"img"`
51
- */
52
- imageComponent?: string | ConcreteComponent;
53
- /**
54
- * Default widths to use when rendering an image with `widths="defaults"`
55
- *
56
- * @remarks
57
- * Consider configuring image widths within your content type definition and
58
- * using `widths="auto"` instead to give content writers the ability to crop
59
- * images in the editor.
60
- * @defaultValue `@prismicio/helpers` defaults
61
- */
62
- imageWidthSrcSetDefaults?: number[];
63
- /**
64
- * Default pixel densities to use when rendering an image with
65
- * `pixel-densities="defaults"`
66
- *
67
- * @defaultValue `@prismicio/helpers` defaults
68
- */
69
- imagePixelDensitySrcSetDefaults?: number[];
70
- /**
71
- * A component or a functional component rendered if a component mapping from
72
- * the `components` prop cannot be found.
73
- *
74
- * @remarks
75
- * Components will be rendered using the {@link SliceComponentProps} interface.
76
- *
77
- * @defaultValue `null` when `process.env.NODE_ENV === "production"` else {@link TODOSliceComponent}
78
- */
79
- sliceZoneDefaultComponent?: SliceComponentType;
80
- };
81
- /**
82
- * Common options supported by `@prismicio/vue` plugin.
83
- */
84
- type PrismicPluginOptionsBase = {
85
- /**
86
- * An optional link resolver function used to resolve links to Prismic
87
- * documents when not using the route resolver parameter with
88
- * `@prismicio/client`.
89
- *
90
- * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
91
- */
92
- linkResolver?: LinkResolverFunction;
93
- /**
94
- * An optional HTML serializer to customize the way rich text fields are
95
- * rendered.
96
- *
97
- * @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}
98
- */
99
- htmlSerializer?: HTMLFunctionSerializer | HTMLMapSerializer;
100
- /**
101
- * Whether or not to inject components globally.
102
- *
103
- * @defaultValue `true`
104
- */
105
- injectComponents?: boolean;
106
- /**
107
- * Options used by Prismic Vue components.
108
- *
109
- * @see Components options {@link PrismicPluginComponentsOptions}
110
- */
111
- components?: PrismicPluginComponentsOptions;
112
- };
113
- /**
114
- * Options to init `@prismicio/vue` plugin with a client instance.
115
- *
116
- * @see {@link PrismicPluginOptionsBase} for shared options
117
- */
118
- type PrismicPluginOptionsWithClient = PrismicPluginOptionsBase & {
119
- /**
120
- * A `@prismicio/client` instance used to fetch content from a Prismic
121
- * repository to configure the plugin with.
122
- *
123
- * @remarks
124
- * The client will be used by `@prismicio/vue` composables, such as
125
- * {@link usePrismicDocuments} and exposed through `this.$prismic.client` and
126
- * `usePrismic().client`.
127
- * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
128
- */
129
- client: Client;
130
- /**
131
- * Ensures type union is a strict or.
132
- *
133
- * @internal
134
- */
135
- endpoint?: never;
136
- /**
137
- * Ensures type union is a strict or.
138
- *
139
- * @internal
140
- */
141
- clientConfig?: never;
142
- };
143
- /**
144
- * Options to init `@prismicio/vue` plugin with a repository ID or API endpoint.
145
- *
146
- * @see {@link PrismicPluginOptionsBase} for shared options
147
- */
148
- type PrismicPluginOptionsWithEndpoint = PrismicPluginOptionsBase & {
149
- /**
150
- * A Prismic repository endpoint to init the plugin's `@prismicio/client`
151
- * instance used to fetch content from a Prismic repository with.
152
- *
153
- * @remarks
154
- * Said client will be used by `@prismicio/vue` composables, such as
155
- * {@link usePrismicDocuments} and exposed through `this.$prismic.client` and
156
- * `usePrismic().client`.
157
- * @example A repository ID:
158
- *
159
- * "my-repo";
160
- *
161
- * @example A full repository endpoint:
162
- *
163
- * "https://my-repo.cdn.prismic.io/api/v2";
164
- *
165
- * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
166
- */
167
- endpoint: string;
168
- /**
169
- * An optional object to configure `@prismicio/client` instance further.
170
- *
171
- * @example Accessing a private private repository:
172
- *
173
- * ```javascript
174
- * {
175
- * "accessToken": "abc"
176
- * }
177
- * ```
178
- *
179
- * @example Using a route resolver:
180
- *
181
- * ```javascript
182
- * {
183
- * "defaultParams": {
184
- * "routes": [
185
- * {
186
- * "type": "page",
187
- * "path": "/:uid"
188
- * },
189
- * {
190
- * "type": "post",
191
- * "path": "/blog/:uid"
192
- * }
193
- * ]
194
- * }
195
- * }
196
- * ```
197
- *
198
- * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
199
- * @see Route resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#route-resolver}
200
- */
201
- clientConfig?: ClientConfig;
202
- /**
203
- * Ensures type union is a strict or.
204
- *
205
- * @internal
206
- */
207
- client?: never;
208
- };
209
- /**
210
- * `@prismicio/vue` plugin options.
211
- *
212
- * @see Prismic Official Vue.js documentation: {@link https://prismic.io/docs/technologies/vuejs}
213
- * @see Plugin repository: {@link https://github.com/prismicio/prismic-vue}
214
- */
215
- export type PrismicPluginOptions = PrismicPluginOptionsWithClient | PrismicPluginOptionsWithEndpoint;
216
- /**
217
- * `@prismicio/client` related methods and properties exposed by
218
- * `@prismicio/vue` plugin and accessible through `this.$prismic` and
219
- * `usePrismic()`.
220
- */
221
- export type PrismicPluginClient = {
222
- /**
223
- * A `@prismicio/client` instance.
224
- */
225
- client: Client;
226
- /**
227
- * Query predicates from `@prismicio/client`.
228
- */
229
- predicate: typeof predicate;
230
- /**
231
- * Prismic cookies from `@prismicio/client`.
232
- */
233
- cookie: typeof cookie;
234
- };
235
- /**
236
- * `@prismicio/helpers` related methods exposed by `@prismicio/vue` plugin and
237
- * accessible through `this.$prismic` and `usePrismic()`.
238
- */
239
- export type PrismicPluginHelpers = {
240
- /**
241
- * Serializes a rich text or title field to a plain text string. This is
242
- * `@prismicio/helpers` {@link asText} function.
243
- *
244
- * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
245
- */
246
- asText: typeof asText;
247
- /**
248
- * Serializes a rich text or title field to an HTML string. This is
249
- * `@prismicio/helpers` {@link asHTML} function.
250
- *
251
- * @remarks
252
- * If no `linkResolver` is provided the function will use the one provided to
253
- * the plugin at {@link PrismicPluginOptions.linkResolver} if available.
254
- * @remarks
255
- * If no `htmlSerializer` is provided the function will use the one provided
256
- * to the plugin at {@link PrismicPluginOptions.htmlSerializer} if available.
257
- * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
258
- */
259
- asHTML: typeof asHTML;
260
- /**
261
- * Resolves any type of link field or document to a URL. This is
262
- * `@prismicio/helpers` {@link asLink} function.
263
- *
264
- * @remarks
265
- * If no `linkResolver` is provided the function will use the one provided to
266
- * the plugin at {@link PrismicPluginOptions.linkResolver} if available.
267
- * @see Templating link fields {@link https://prismic.io/docs/technologies/vue-template-content#links-and-content-relationships}
268
- */
269
- asLink: (linkField: Parameters<typeof asLink>[0], linkResolver?: LinkResolverFunction) => string | null;
270
- /**
271
- * Transforms a date or timestamp field into a JavaScript Date object. This is
272
- * `@prismicio/helpers` {@link asDate} function.
273
- */
274
- asDate: typeof asDate;
275
- /**
276
- * Returns the URL of an Image field with optional image transformations (via
277
- * Imgix URL parameters). This is `@prismicio/helpers` {@link asImageSrc}
278
- * function.
279
- */
280
- asImageSrc: typeof asImageSrc;
281
- /**
282
- * Creates a width-based `srcset` from an Image field with optional image
283
- * transformations (via Imgix URL parameters). This is `@prismicio/helpers`
284
- * {@link asImageWidthSrcSet} function.
285
- */
286
- asImageWidthSrcSet: typeof asImageWidthSrcSet;
287
- /**
288
- * Creates a pixel-density-based `srcset` from an Image field with optional
289
- * image transformations (via Imgix URL parameters). This is
290
- * `@prismicio/helpers` {@link asImagePixelDensitySrcSet} function.
291
- */
292
- asImagePixelDensitySrcSet: typeof asImagePixelDensitySrcSet;
293
- /**
294
- * Converts a document into a link field. This is `@prismicio/helpers`
295
- * {@link documentToLinkField} function.
296
- *
297
- * @internal
298
- */
299
- documentToLinkField: typeof documentToLinkField;
300
- };
301
- /**
302
- * Methods and properties exposed by `@prismicio/vue` plugin and accessible
303
- * through `this.$prismic` and `usePrismic()`.
304
- */
305
- export type PrismicPlugin = {
306
- /**
307
- * Options uses to initialize the plugin.
308
- *
309
- * @see `@prismicio/vue` plugin options {@link PrismicPluginOptions}
310
- */
311
- readonly options: PrismicPluginOptions;
312
- /**
313
- * `@prismicio/vue` plugin install function used by Vue.
314
- *
315
- * @internal
316
- */
317
- install: (app: App) => void;
318
- } & PrismicPluginClient & PrismicPluginHelpers;
319
- /**
320
- * States of a `@prismicio/client` composable.
321
- */
322
- export declare const enum PrismicClientComposableState {
323
- /**
324
- * The composable has not started fetching.
325
- */
326
- Idle = "idle",
327
- /**
328
- * The composable is fetching data.
329
- */
330
- Pending = "pending",
331
- /**
332
- * The composable sucessfully fetched data.
333
- */
334
- Success = "success",
335
- /**
336
- * The composable failed to fetch data.
337
- */
338
- Error = "error"
339
- }
340
- /**
341
- * Type to transform a static object into one that allows passing Refs as
342
- * values.
343
- *
344
- * @internal
345
- */
346
- export type VueUseOptions<T> = {
347
- [K in keyof T]: Ref<T[K]> | T[K];
348
- };
349
- /**
350
- * Type to transform a static tuple into one that allows passing Refs as values.
351
- *
352
- * @internal
353
- */
354
- export type VueUseParameters<T> = {
355
- [K in keyof T]: T extends number ? Ref<T[K]> | T[K] : T[K];
356
- };
357
- export {};
1
+ import type { App, ConcreteComponent, DefineComponent, Raw, Ref } from "vue";
2
+ import type { Client, ClientConfig, cookie, predicate } from "@prismicio/client";
3
+ import type { asText, asHTML, asLink, asDate, documentToLinkField, HTMLFunctionSerializer, HTMLMapSerializer, LinkResolverFunction, asImageSrc, asImageWidthSrcSet, asImagePixelDensitySrcSet } from "@prismicio/helpers";
4
+ import type { SliceComponentType } from "./components/SliceZone";
5
+ /**
6
+ * Options used by `@prismicio/vue` components.
7
+ */
8
+ type PrismicPluginComponentsOptions = {
9
+ /**
10
+ * Value of the `rel` attribute to use on links rendered with
11
+ * `target="_blank"`
12
+ *
13
+ * @defaultValue `"noopener noreferrer"`
14
+ */
15
+ linkBlankTargetRelAttribute?: string;
16
+ /**
17
+ * An HTML tag name, a component, or a functional component used to render
18
+ * internal links.
19
+ *
20
+ * @remarks
21
+ * HTML tag names will be rendered using the anchor tag interface (`href`,
22
+ * `target`, and `rel` attributes).
23
+ * @remarks
24
+ * Components will be rendered using Vue Router {@link RouterLink} interface
25
+ * (`to` props).
26
+ * @defaultValue {@link RouterLink}
27
+ */
28
+ linkInternalComponent?: string | ConcreteComponent | Raw<DefineComponent>;
29
+ /**
30
+ * An HTML tag name, a component, or a functional component used to render
31
+ * external links.
32
+ *
33
+ * @remarks
34
+ * HTML tag names will be rendered using the anchor tag interface (`href`,
35
+ * `target`, and `rel` attributes).
36
+ * @remarks
37
+ * Components will be rendered using Vue Router {@link RouterLink} interface
38
+ * (`to` props).
39
+ * @defaultValue `"a"`
40
+ */
41
+ linkExternalComponent?: string | ConcreteComponent | Raw<DefineComponent>;
42
+ /**
43
+ * An HTML tag name, a component, or a functional component used to render
44
+ * images.
45
+ *
46
+ * @remarks
47
+ * HTML tag names and components will be rendered using the `img` tag
48
+ * interface (`src` and `alt` attribute). Components will also receive an
49
+ * additional `copyright` props.
50
+ * @defaultValue `"img"`
51
+ */
52
+ imageComponent?: string | ConcreteComponent | Raw<DefineComponent>;
53
+ /**
54
+ * Default widths to use when rendering an image with `widths="defaults"`
55
+ *
56
+ * @remarks
57
+ * Consider configuring image widths within your content type definition and
58
+ * using `widths="auto"` instead to give content writers the ability to crop
59
+ * images in the editor.
60
+ * @defaultValue `@prismicio/helpers` defaults
61
+ */
62
+ imageWidthSrcSetDefaults?: number[];
63
+ /**
64
+ * Default pixel densities to use when rendering an image with
65
+ * `pixel-densities="defaults"`
66
+ *
67
+ * @defaultValue `@prismicio/helpers` defaults
68
+ */
69
+ imagePixelDensitySrcSetDefaults?: number[];
70
+ /**
71
+ * A component or a functional component rendered if a component mapping from
72
+ * the `components` prop cannot be found.
73
+ *
74
+ * @remarks
75
+ * Components will be rendered using the {@link SliceComponentProps} interface.
76
+ *
77
+ * @defaultValue `null` when `process.env.NODE_ENV === "production"` else {@link TODOSliceComponent}
78
+ */
79
+ sliceZoneDefaultComponent?: SliceComponentType;
80
+ };
81
+ /**
82
+ * Common options supported by `@prismicio/vue` plugin.
83
+ */
84
+ type PrismicPluginOptionsBase = {
85
+ /**
86
+ * An optional link resolver function used to resolve links to Prismic
87
+ * documents when not using the route resolver parameter with
88
+ * `@prismicio/client`.
89
+ *
90
+ * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
91
+ */
92
+ linkResolver?: LinkResolverFunction;
93
+ /**
94
+ * An optional HTML serializer to customize the way rich text fields are
95
+ * rendered.
96
+ *
97
+ * @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}
98
+ */
99
+ richTextSerializer?: HTMLFunctionSerializer | HTMLMapSerializer;
100
+ /**
101
+ * An optional HTML serializer to customize the way rich text fields are
102
+ * rendered.
103
+ *
104
+ * @deprecated Use `richTextSerializer` instead.
105
+ *
106
+ * @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}
107
+ */
108
+ htmlSerializer?: HTMLFunctionSerializer | HTMLMapSerializer;
109
+ /**
110
+ * Whether or not to inject components globally.
111
+ *
112
+ * @defaultValue `true`
113
+ */
114
+ injectComponents?: boolean;
115
+ /**
116
+ * Options used by Prismic Vue components.
117
+ *
118
+ * @see Components options {@link PrismicPluginComponentsOptions}
119
+ */
120
+ components?: PrismicPluginComponentsOptions;
121
+ };
122
+ /**
123
+ * Options to init `@prismicio/vue` plugin with a client instance.
124
+ *
125
+ * @see {@link PrismicPluginOptionsBase} for shared options
126
+ */
127
+ type PrismicPluginOptionsWithClient = PrismicPluginOptionsBase & {
128
+ /**
129
+ * A `@prismicio/client` instance used to fetch content from a Prismic
130
+ * repository to configure the plugin with.
131
+ *
132
+ * @remarks
133
+ * The client will be used by `@prismicio/vue` composables, such as
134
+ * {@link usePrismicDocuments} and exposed through `this.$prismic.client` and
135
+ * `usePrismic().client`.
136
+ * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
137
+ */
138
+ client: Client;
139
+ /**
140
+ * Ensures type union is a strict or.
141
+ *
142
+ * @internal
143
+ */
144
+ endpoint?: never;
145
+ /**
146
+ * Ensures type union is a strict or.
147
+ *
148
+ * @internal
149
+ */
150
+ clientConfig?: never;
151
+ };
152
+ /**
153
+ * Options to init `@prismicio/vue` plugin with a repository ID or API endpoint.
154
+ *
155
+ * @see {@link PrismicPluginOptionsBase} for shared options
156
+ */
157
+ type PrismicPluginOptionsWithEndpoint = PrismicPluginOptionsBase & {
158
+ /**
159
+ * A Prismic repository endpoint to init the plugin's `@prismicio/client`
160
+ * instance used to fetch content from a Prismic repository with.
161
+ *
162
+ * @remarks
163
+ * Said client will be used by `@prismicio/vue` composables, such as
164
+ * {@link usePrismicDocuments} and exposed through `this.$prismic.client` and
165
+ * `usePrismic().client`.
166
+ * @example A repository ID:
167
+ *
168
+ * "my-repo";
169
+ *
170
+ * @example A full repository endpoint:
171
+ *
172
+ * "https://my-repo.cdn.prismic.io/api/v2";
173
+ *
174
+ * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
175
+ */
176
+ endpoint: string;
177
+ /**
178
+ * An optional object to configure `@prismicio/client` instance further.
179
+ *
180
+ * @example Accessing a private private repository:
181
+ *
182
+ * ```javascript
183
+ * {
184
+ * "accessToken": "abc"
185
+ * }
186
+ * ```
187
+ *
188
+ * @example Using a route resolver:
189
+ *
190
+ * ```javascript
191
+ * {
192
+ * "defaultParams": {
193
+ * "routes": [
194
+ * {
195
+ * "type": "page",
196
+ * "path": "/:uid"
197
+ * },
198
+ * {
199
+ * "type": "post",
200
+ * "path": "/blog/:uid"
201
+ * }
202
+ * ]
203
+ * }
204
+ * }
205
+ * ```
206
+ *
207
+ * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
208
+ * @see Route resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#route-resolver}
209
+ */
210
+ clientConfig?: ClientConfig;
211
+ /**
212
+ * Ensures type union is a strict or.
213
+ *
214
+ * @internal
215
+ */
216
+ client?: never;
217
+ };
218
+ /**
219
+ * `@prismicio/vue` plugin options.
220
+ *
221
+ * @see Prismic Official Vue.js documentation: {@link https://prismic.io/docs/technologies/vuejs}
222
+ * @see Plugin repository: {@link https://github.com/prismicio/prismic-vue}
223
+ */
224
+ export type PrismicPluginOptions = PrismicPluginOptionsWithClient | PrismicPluginOptionsWithEndpoint;
225
+ /**
226
+ * `@prismicio/client` related methods and properties exposed by
227
+ * `@prismicio/vue` plugin and accessible through `this.$prismic` and
228
+ * `usePrismic()`.
229
+ */
230
+ export type PrismicPluginClient = {
231
+ /**
232
+ * A `@prismicio/client` instance.
233
+ */
234
+ client: Client;
235
+ /**
236
+ * Query predicates from `@prismicio/client`.
237
+ */
238
+ predicate: typeof predicate;
239
+ /**
240
+ * Prismic cookies from `@prismicio/client`.
241
+ */
242
+ cookie: typeof cookie;
243
+ };
244
+ /**
245
+ * `@prismicio/helpers` related methods exposed by `@prismicio/vue` plugin and
246
+ * accessible through `this.$prismic` and `usePrismic()`.
247
+ */
248
+ export type PrismicPluginHelpers = {
249
+ /**
250
+ * Serializes a rich text or title field to a plain text string. This is
251
+ * `@prismicio/helpers` {@link asText} function.
252
+ *
253
+ * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
254
+ */
255
+ asText: typeof asText;
256
+ /**
257
+ * Serializes a rich text or title field to an HTML string. This is
258
+ * `@prismicio/helpers` {@link asHTML} function.
259
+ *
260
+ * @remarks
261
+ * If no `linkResolver` is provided the function will use the one provided to
262
+ * the plugin at {@link PrismicPluginOptions.linkResolver} if available.
263
+ * @remarks
264
+ * If no `htmlSerializer` is provided the function will use the one provided
265
+ * to the plugin at {@link PrismicPluginOptions.htmlSerializer} if available.
266
+ * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
267
+ */
268
+ asHTML: typeof asHTML;
269
+ /**
270
+ * Resolves any type of link field or document to a URL. This is
271
+ * `@prismicio/helpers` {@link asLink} function.
272
+ *
273
+ * @remarks
274
+ * If no `linkResolver` is provided the function will use the one provided to
275
+ * the plugin at {@link PrismicPluginOptions.linkResolver} if available.
276
+ * @see Templating link fields {@link https://prismic.io/docs/technologies/vue-template-content#links-and-content-relationships}
277
+ */
278
+ asLink: (linkField: Parameters<typeof asLink>[0], linkResolver?: LinkResolverFunction) => string | null;
279
+ /**
280
+ * Transforms a date or timestamp field into a JavaScript Date object. This is
281
+ * `@prismicio/helpers` {@link asDate} function.
282
+ */
283
+ asDate: typeof asDate;
284
+ /**
285
+ * Returns the URL of an Image field with optional image transformations (via
286
+ * Imgix URL parameters). This is `@prismicio/helpers` {@link asImageSrc}
287
+ * function.
288
+ */
289
+ asImageSrc: typeof asImageSrc;
290
+ /**
291
+ * Creates a width-based `srcset` from an Image field with optional image
292
+ * transformations (via Imgix URL parameters). This is `@prismicio/helpers`
293
+ * {@link asImageWidthSrcSet} function.
294
+ */
295
+ asImageWidthSrcSet: typeof asImageWidthSrcSet;
296
+ /**
297
+ * Creates a pixel-density-based `srcset` from an Image field with optional
298
+ * image transformations (via Imgix URL parameters). This is
299
+ * `@prismicio/helpers` {@link asImagePixelDensitySrcSet} function.
300
+ */
301
+ asImagePixelDensitySrcSet: typeof asImagePixelDensitySrcSet;
302
+ /**
303
+ * Converts a document into a link field. This is `@prismicio/helpers`
304
+ * {@link documentToLinkField} function.
305
+ *
306
+ * @internal
307
+ */
308
+ documentToLinkField: typeof documentToLinkField;
309
+ };
310
+ /**
311
+ * Methods and properties exposed by `@prismicio/vue` plugin and accessible
312
+ * through `this.$prismic` and `usePrismic()`.
313
+ */
314
+ export type PrismicPlugin = {
315
+ /**
316
+ * Options uses to initialize the plugin.
317
+ *
318
+ * @see `@prismicio/vue` plugin options {@link PrismicPluginOptions}
319
+ */
320
+ readonly options: PrismicPluginOptions;
321
+ /**
322
+ * `@prismicio/vue` plugin install function used by Vue.
323
+ *
324
+ * @internal
325
+ */
326
+ install: (app: App) => void;
327
+ } & PrismicPluginClient & PrismicPluginHelpers;
328
+ /**
329
+ * States of a `@prismicio/client` composable.
330
+ */
331
+ export declare const enum PrismicClientComposableState {
332
+ /**
333
+ * The composable has not started fetching.
334
+ */
335
+ Idle = "idle",
336
+ /**
337
+ * The composable is fetching data.
338
+ */
339
+ Pending = "pending",
340
+ /**
341
+ * The composable sucessfully fetched data.
342
+ */
343
+ Success = "success",
344
+ /**
345
+ * The composable failed to fetch data.
346
+ */
347
+ Error = "error"
348
+ }
349
+ /**
350
+ * Type to transform a static object into one that allows passing Refs as
351
+ * values.
352
+ *
353
+ * @internal
354
+ */
355
+ export type VueUseOptions<T> = {
356
+ [K in keyof T]: Ref<T[K]> | T[K];
357
+ };
358
+ /**
359
+ * Type to transform a static tuple into one that allows passing Refs as values.
360
+ *
361
+ * @internal
362
+ */
363
+ export type VueUseParameters<T> = {
364
+ [K in keyof T]: T extends number ? Ref<T[K]> | T[K] : T[K];
365
+ };
366
+ export {};