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