@prismicio/vue 3.0.0-alpha.2 → 3.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,315 @@
1
1
  import * as vue from 'vue';
2
- import { App, Ref, ConcreteComponent, AllowedComponentProps, ComponentCustomProps, VNodeProps, ComputedRef, PropType, DefineComponent, FunctionalComponent, InjectionKey } from 'vue';
2
+ import { PropType, DefineComponent, FunctionalComponent, VNodeProps, AllowedComponentProps, ComponentCustomProps, ConcreteComponent, App, Ref, ComputedRef, InjectionKey } from 'vue';
3
3
  import * as _prismicio_client from '@prismicio/client';
4
- import { Client, ClientConfig, predicate, cookie, PrismicError, ParsingError, ForbiddenError, Query } from '@prismicio/client';
5
- import { asText, asHTML, asLink, LinkResolverFunction, asDate, documentToLinkField, documentAsLink, HTMLFunctionSerializer, HTMLMapSerializer } from '@prismicio/helpers';
4
+ import { Client, ClientConfig, predicate, cookie, PrismicError, ParsingError, ForbiddenError } from '@prismicio/client';
5
+ import { asText, asHTML, asLink, LinkResolverFunction, asDate, documentToLinkField, HTMLFunctionSerializer, HTMLMapSerializer } from '@prismicio/helpers';
6
6
  import * as _prismicio_types from '@prismicio/types';
7
- import { EmbedField, ImageField, LinkField, PrismicDocument, RichTextField, Slice } from '@prismicio/types';
7
+ import { Slice, EmbedField, ImageField, LinkField, PrismicDocument, RichTextField, Query } from '@prismicio/types';
8
+
9
+ /**
10
+ * The minimum required properties to represent a Prismic Slice for the
11
+ * `<SliceZone />` component.
12
+ *
13
+ * If using Prismic's REST API, use the `Slice` export from `@prismicio/types`
14
+ * for a full interface.
15
+ *
16
+ * @typeParam TSliceType - Type name of the Slice
17
+ */
18
+ declare type SliceLike<TSliceType extends string = string> = Pick<Slice<TSliceType>, "slice_type">;
19
+ /**
20
+ * A looser version of the `SliceZone` type from `@prismicio/types` using `SliceLike`.
21
+ *
22
+ * If using Prismic's REST API, use the `SliceZone` export from
23
+ * `@prismicio/types` for the full type.
24
+ *
25
+ * @typeParam TSlice - The type(s) of slices in the Slice Zone
26
+ */
27
+ declare type SliceZoneLike<TSlice extends SliceLike> = readonly TSlice[];
28
+ /**
29
+ * Vue props for a component rendering content from a Prismic Slice using the
30
+ * `<SliceZone />` component.
31
+ *
32
+ * @typeParam TSlice - The type(s) of slices in the Slice Zone
33
+ * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made
34
+ * available to all Slice components
35
+ */
36
+ declare type SliceComponentProps<TSlice extends SliceLike = SliceLike, TContext = unknown> = {
37
+ /**
38
+ * Slice data for this component.
39
+ */
40
+ slice: TSlice;
41
+ /**
42
+ * The index of the Slice in the Slice Zone.
43
+ */
44
+ index: number;
45
+ /**
46
+ * All Slices from the Slice Zone to which the Slice belongs.
47
+ */
48
+ slices: SliceZoneLike<SliceLike>;
49
+ /**
50
+ * Arbitrary data passed to `<SliceZone />` and made available to all Slice components.
51
+ */
52
+ context: TContext;
53
+ };
54
+ /**
55
+ * Native Vue props for a component rendering content from a Prismic Slice using
56
+ * the `<SliceZone />` component.
57
+ *
58
+ * @typeParam TSlice - The type(s) of slices in the Slice Zone
59
+ * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made
60
+ * available to all Slice components
61
+ */
62
+ declare type DefineComponentSliceComponentProps<TSlice extends SliceLike = SliceLike, TContext = unknown> = {
63
+ slice: {
64
+ type: PropType<SliceComponentProps<TSlice, TContext>["slice"]>;
65
+ required: true;
66
+ };
67
+ index: {
68
+ type: PropType<SliceComponentProps<TSlice, TContext>["index"]>;
69
+ required: true;
70
+ };
71
+ slices: {
72
+ type: PropType<SliceComponentProps<TSlice, TContext>["slices"]>;
73
+ required: true;
74
+ };
75
+ context: {
76
+ type: PropType<SliceComponentProps<TSlice, TContext>["context"]>;
77
+ required: true;
78
+ };
79
+ };
80
+ /**
81
+ * Gets native Vue props for a component rendering content from a Prismic Slice
82
+ * using the `<SliceZone />` component. Props are: `["slice", "index", "slices",
83
+ * "context"]`
84
+ *
85
+ * @example Defining a new slice component:
86
+ *
87
+ * ```javascript
88
+ * import { getSliceComponentProps } from "@prismicio/vue";
89
+ *
90
+ * export default {
91
+ * props: getSliceComponentProps(),
92
+ * };
93
+ * ```
94
+ *
95
+ * @example Defining a new slice component with visual hint:
96
+ *
97
+ * ```javascript
98
+ * import { getSliceComponentProps } from "@prismicio/vue";
99
+ *
100
+ * export default {
101
+ * props: getSliceComponentProps(["slice", "index", "slices", "context"]),
102
+ * };
103
+ * ```
104
+ *
105
+ * @typeParam TSlice - The type(s) of slices in the Slice Zone
106
+ * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made
107
+ * available to all Slice components
108
+ * @param propsHint - An optional array of prop names used for the sole purpose
109
+ * of having a visual hint of which props are made available to the slice,
110
+ * this parameters doesn't have any effect
111
+ *
112
+ * @returns Props object to use with {@link defineComponent}
113
+ */
114
+ declare const getSliceComponentProps: <TSlice extends SliceLike<string> = SliceLike<string>, TContext = unknown>(propsHint?: string[] | undefined) => DefineComponentSliceComponentProps<TSlice, TContext>;
115
+ /**
116
+ * A Vue component to be rendered for each instance of its Slice.
117
+ *
118
+ * @typeParam TSlice - The type(s) of slices in the Slice Zone
119
+ * @typeParam TContext - Arbitrary data made available to all Slice components
120
+ */
121
+ declare type SliceComponentType<TSlice extends SliceLike = SliceLike, TContext = unknown> = DefineComponent<SliceComponentProps<TSlice, TContext>> | FunctionalComponent<SliceComponentProps<TSlice, TContext>>;
122
+ /**
123
+ * This Slice component can be used as a reminder to provide a proper implementation.
124
+ *
125
+ * This is also the default Vue component rendered when a component mapping
126
+ * cannot be found in `<SliceZone />`.
127
+ */
128
+ declare const TODOSliceComponent: FunctionalComponent<SliceComponentProps<SliceLike<string>, unknown>, {}> | DefineComponent<SliceComponentProps<SliceLike<string>, unknown>, {}, {}, vue.ComputedOptions, vue.MethodOptions, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<SliceComponentProps<SliceLike<string>, unknown>>, {}>;
129
+ /**
130
+ * A record of Slice types mapped to Vue components. Each components will be
131
+ * rendered for each instance of their Slice type.
132
+ *
133
+ * @typeParam TSlice - The type(s) of slices in the Slice Zone
134
+ * @typeParam TContext - Arbitrary data made available to all Slice components
135
+ */
136
+ declare type SliceZoneComponents<TSlice extends SliceLike = SliceLike, TContext = unknown> = {
137
+ [SliceType in keyof Record<TSlice["slice_type"], never>]: SliceComponentType<Extract<TSlice, SliceLike<SliceType>>, TContext> | string;
138
+ };
139
+ /**
140
+ * Gets an optimized record of Slice types mapped to Vue components. Each
141
+ * components will be rendered for each instance of their Slice type.
142
+ *
143
+ * @remarks
144
+ * This is essentially an helper function to ensure {@link markRaw} is correctly
145
+ * applied on each components, improving performances.
146
+ * @example Defining a slice components:
147
+ *
148
+ * ```javascript
149
+ * import { defineSliceZoneComponents } from "@prismicio/vue";
150
+ *
151
+ * export default {
152
+ * data() {
153
+ * components: defineSliceZoneComponents({
154
+ * foo: Foo,
155
+ * bar: defineAsyncComponent(
156
+ * () => new Promise((res) => res(Bar)),
157
+ * ),
158
+ * baz: "Baz",
159
+ * }),
160
+ * }
161
+ * };
162
+ * ```
163
+ *
164
+ * @typeParam TSlice - The type(s) of slices in the Slice Zone
165
+ * @typeParam TContext - Arbitrary data made available to all Slice components
166
+ * @param components - {@link SliceZoneComponents}
167
+ *
168
+ * @returns A new optimized record of {@link SliceZoneComponents}
169
+ */
170
+ declare const defineSliceZoneComponents: <TSlice extends SliceLike<string> = SliceLike<string>, TContext = unknown>(components: SliceZoneComponents<TSlice, TContext>) => SliceZoneComponents<TSlice, TContext>;
171
+ /**
172
+ * Arguments for a `<SliceZone>` `resolver` function.
173
+ */
174
+ declare type SliceZoneResolverArgs<TSlice extends SliceLike = SliceLike> = {
175
+ /**
176
+ * The Slice to resolve to a Vue component..
177
+ */
178
+ slice: TSlice;
179
+ /**
180
+ * The name of the Slice.
181
+ */
182
+ sliceName: TSlice["slice_type"];
183
+ /**
184
+ * The index of the Slice in the Slice Zone.
185
+ */
186
+ i: number;
187
+ };
188
+ /**
189
+ * A function that determines the rendered Vue component for each Slice in the
190
+ * Slice Zone. If a nullish value is returned, the component will fallback to
191
+ * the `components` or `defaultComponent` props to determine the rendered component.
192
+ *
193
+ * @deprecated Use the `components` prop instead.
194
+ * @param args - Arguments for the resolver function.
195
+ *
196
+ * @returns The Vue component to render for a Slice.
197
+ */
198
+ declare type SliceZoneResolver<TSlice extends SliceLike = SliceLike, TContext = unknown> = (args: SliceZoneResolverArgs<TSlice>) => SliceComponentType<TSlice, TContext> | string | undefined | null;
199
+ /**
200
+ * Props for `<SliceZone />`.
201
+ *
202
+ * @typeParam TSlice - The type(s) of slices in the Slice Zone
203
+ * @typeParam TContext - Arbitrary data made available to all Slice components
204
+ */
205
+ declare type SliceZoneProps<TSlice extends SliceLike = SliceLike, TContext = unknown> = {
206
+ /**
207
+ * List of Slice data from the Slice Zone.
208
+ */
209
+ slices: SliceZoneLike<TSlice>;
210
+ /**
211
+ * A record mapping Slice types to Vue components.
212
+ */
213
+ components?: SliceZoneComponents;
214
+ /**
215
+ * A function that determines the rendered Vue component for each Slice in the
216
+ * Slice Zone.
217
+ *
218
+ * @deprecated Use the `components` prop instead.
219
+ * @param args - Arguments for the resolver function.
220
+ *
221
+ * @returns The Vue component to render for a Slice.
222
+ */
223
+ resolver?: SliceZoneResolver<TSlice, TContext>;
224
+ /**
225
+ * Arbitrary data made available to all Slice components.
226
+ */
227
+ context?: TContext;
228
+ /**
229
+ * A component or a functional component rendered if a component mapping from
230
+ * the `components` prop cannot be found.
231
+ *
232
+ * @remarks
233
+ * Components will be rendered using the {@link SliceComponentProps} interface.
234
+ * @defaultValue The Slice Zone default component provided to `@prismicio/vue` plugin if configured, otherwise `null` when `process.env.NODE_ENV === "production"` else {@link TODOSliceComponent}.
235
+ */
236
+ defaultComponent?: SliceComponentType<TSlice, TContext>;
237
+ /**
238
+ * An HTML tag name, a component, or a functional component used to wrap the
239
+ * output. The Slice Zone is not wrapped by default.
240
+ */
241
+ wrapper?: string | ConcreteComponent;
242
+ };
243
+ /**
244
+ * `<SliceZone />` implementation.
245
+ *
246
+ * @internal
247
+ */
248
+ declare const SliceZoneImpl: DefineComponent<{
249
+ slices: {
250
+ type: PropType<SliceZoneLike<SliceLike<string>>>;
251
+ required: true;
252
+ };
253
+ components: {
254
+ type: PropType<SliceZoneComponents<SliceLike<string>, unknown>>;
255
+ default: undefined;
256
+ required: false;
257
+ };
258
+ resolver: {
259
+ type: PropType<SliceZoneResolver<SliceLike<string>, unknown>>;
260
+ default: undefined;
261
+ required: false;
262
+ };
263
+ context: {
264
+ type: null;
265
+ default: undefined;
266
+ required: false;
267
+ };
268
+ defaultComponent: {
269
+ type: PropType<SliceComponentType<SliceLike<string>, unknown>>;
270
+ default: undefined;
271
+ required: false;
272
+ };
273
+ wrapper: {
274
+ type: PropType<string | ConcreteComponent<{}, any, any, vue.ComputedOptions, vue.MethodOptions>>;
275
+ default: undefined;
276
+ required: false;
277
+ };
278
+ }, (() => null) | (() => vue.VNode<vue.RendererNode, vue.RendererElement, {
279
+ [key: string]: any;
280
+ }> | vue.VNode<vue.RendererNode, vue.RendererElement, {
281
+ [key: string]: any;
282
+ }>[]), unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{
283
+ slices?: unknown;
284
+ components?: unknown;
285
+ resolver?: unknown;
286
+ context?: unknown;
287
+ defaultComponent?: unknown;
288
+ wrapper?: unknown;
289
+ } & {
290
+ slices: SliceZoneLike<SliceLike<string>>;
291
+ } & {
292
+ wrapper?: string | ConcreteComponent<{}, any, any, vue.ComputedOptions, vue.MethodOptions> | undefined;
293
+ context?: any;
294
+ components?: SliceZoneComponents<SliceLike<string>, unknown> | undefined;
295
+ resolver?: SliceZoneResolver<SliceLike<string>, unknown> | undefined;
296
+ defaultComponent?: SliceComponentType<SliceLike<string>, unknown> | undefined;
297
+ }>, {
298
+ wrapper: string | ConcreteComponent<{}, any, any, vue.ComputedOptions, vue.MethodOptions>;
299
+ context: any;
300
+ components: SliceZoneComponents<SliceLike<string>, unknown>;
301
+ resolver: SliceZoneResolver<SliceLike<string>, unknown>;
302
+ defaultComponent: SliceComponentType<SliceLike<string>, unknown>;
303
+ }>;
304
+ /**
305
+ * Component to render a Prismic Slice Zone.
306
+ *
307
+ * @see Component props {@link SliceZoneProps}
308
+ * @see Templating Slice Zones {@link https://prismic.io/docs/technologies/vue-template-content#slices-and-groups}
309
+ */
310
+ declare const SliceZone: new () => {
311
+ $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & SliceZoneProps;
312
+ };
8
313
 
9
314
  /**
10
315
  * Options used by `@prismicio/vue` components.
@@ -17,48 +322,58 @@ declare type PrismicPluginComponentsOptions = {
17
322
  */
18
323
  linkBlankTargetRelAttribute?: string;
19
324
  /**
20
- * An HTML tag name, a component, or a functional component used to render internal links.
21
- *
22
- * @remarks HTML tag names will be rendered using the anchor tag interface (`href`, `target`, and `rel` attributes).
23
- *
24
- * @remarks Components will be rendered using Vue Router {@link RouterLink} interface (`to` props).
25
- *
325
+ * An HTML tag name, a component, or a functional component used to render
326
+ * internal links.
327
+ *
328
+ * @remarks
329
+ * HTML tag names will be rendered using the anchor tag interface (`href`,
330
+ * `target`, and `rel` attributes).
331
+ * @remarks
332
+ * Components will be rendered using Vue Router {@link RouterLink} interface
333
+ * (`to` props).
26
334
  * @defaultValue {@link RouterLink}
27
335
  */
28
336
  linkInternalComponent?: string | ConcreteComponent;
29
337
  /**
30
- * An HTML tag name, a component, or a functional component used to render external links.
31
- *
32
- * @remarks HTML tag names will be rendered using the anchor tag interface (`href`, `target`, and `rel` attributes).
33
- *
34
- * @remarks Components will be rendered using Vue Router {@link RouterLink} interface (`to` props).
35
- *
338
+ * An HTML tag name, a component, or a functional component used to render
339
+ * external links.
340
+ *
341
+ * @remarks
342
+ * HTML tag names will be rendered using the anchor tag interface (`href`,
343
+ * `target`, and `rel` attributes).
344
+ * @remarks
345
+ * Components will be rendered using Vue Router {@link RouterLink} interface
346
+ * (`to` props).
36
347
  * @defaultValue `"a"`
37
348
  */
38
349
  linkExternalComponent?: string | ConcreteComponent;
39
350
  /**
40
351
  * An HTML tag name, a component, or a functional component used to render images.
41
352
  *
42
- * @remarks HTML tag names and components will be rendered using the `img` tag interface (`src` and `alt` attribute). Components will also receive an additional `copyright` props.
43
- *
353
+ * @remarks
354
+ * HTML tag names and components will be rendered using the `img` tag
355
+ * interface (`src` and `alt` attribute). Components will also receive an
356
+ * additional `copyright` props.
44
357
  * @defaultValue `"img"`
45
358
  */
46
359
  imageComponent?: string | ConcreteComponent;
47
360
  /**
48
- * A component or a functional component rendered if a component mapping from the `components` prop cannot be found.
49
- *
50
- * @remarks Components will be rendered using the {@link SliceComponentProps} interface.
361
+ * A component or a functional component rendered if a component mapping from
362
+ * the `components` prop cannot be found.
51
363
  *
364
+ * @remarks
365
+ * Components will be rendered using the {@link SliceComponentProps} interface.
52
366
  * @defaultValue `null` when `process.env.NODE_ENV === "production"` else {@link TODOSliceComponent}
53
367
  */
54
- sliceZoneDefaultComponent?: string | ConcreteComponent;
368
+ sliceZoneDefaultComponent?: SliceComponentType;
55
369
  };
56
370
  /**
57
371
  * Common options supported by `@prismicio/vue` plugin.
58
372
  */
59
373
  declare type PrismicPluginOptionsBase = {
60
374
  /**
61
- * An optional link resolver function used to resolve links to Prismic documents when not using the route resolver parameter with `@prismicio/client`.
375
+ * An optional link resolver function used to resolve links to Prismic
376
+ * documents when not using the route resolver parameter with `@prismicio/client`.
62
377
  *
63
378
  * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
64
379
  */
@@ -89,10 +404,13 @@ declare type PrismicPluginOptionsBase = {
89
404
  */
90
405
  declare type PrismicPluginOptionsWithClient = PrismicPluginOptionsBase & {
91
406
  /**
92
- * A `@prismicio/client` instance used to fetch content from a Prismic repository to configure the plugin with.
93
- *
94
- * @remarks The client will be used by `@prismicio/vue` composables, such as {@link usePrismicDocuments} and exposed through `this.$prismic.client` and `usePrismic().client`.
407
+ * A `@prismicio/client` instance used to fetch content from a Prismic
408
+ * repository to configure the plugin with.
95
409
  *
410
+ * @remarks
411
+ * The client will be used by `@prismicio/vue` composables, such as
412
+ * {@link usePrismicDocuments} and exposed through `this.$prismic.client` and
413
+ * `usePrismic().client`.
96
414
  * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
97
415
  */
98
416
  client: Client;
@@ -116,61 +434,56 @@ declare type PrismicPluginOptionsWithClient = PrismicPluginOptionsBase & {
116
434
  */
117
435
  declare type PrismicPluginOptionsWithEndpoint = PrismicPluginOptionsBase & {
118
436
  /**
119
- * A Prismic repository endpoint to init the plugin's `@prismicio/client` instance used to fetch content from a Prismic repository with.
120
- *
121
- * @remarks Said client will be used by `@prismicio/vue` composables, such as {@link usePrismicDocuments} and exposed through `this.$prismic.client` and `usePrismic().client`.
437
+ * A Prismic repository endpoint to init the plugin's `@prismicio/client`
438
+ * instance used to fetch content from a Prismic repository with.
122
439
  *
123
- * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
440
+ * @remarks
441
+ * Said client will be used by `@prismicio/vue` composables, such as
442
+ * {@link usePrismicDocuments} and exposed through `this.$prismic.client` and
443
+ * `usePrismic().client`.
444
+ * @example A repository ID:
124
445
  *
125
- * @example
126
- * A repository ID:
446
+ * "my-repo";
127
447
  *
128
- * ```
129
- * "my-repo"
130
- * ```
448
+ * @example A full repository endpoint:
131
449
  *
132
- * @example
133
- * A full repository endpoint:
450
+ * "https://my-repo.cdn.prismic.io/api/v2";
134
451
  *
135
- * ```
136
- * "https://my-repo.cdn.prismic.io/api/v2"
137
- * ```
452
+ * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
138
453
  */
139
454
  endpoint: string;
140
455
  /**
141
456
  * An optional object to configure `@prismicio/client` instance further.
142
457
  *
143
- * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
144
- * @see Route resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#route-resolver}
145
- *
146
- * @example
147
- * Accessing a private private repository:
458
+ * @example Accessing a private private repository:
148
459
  *
149
- * ```
460
+ * ```javascript
150
461
  * {
151
- * accessToken: "abc",
462
+ * "accessToken": "abc"
152
463
  * }
153
464
  * ```
154
465
  *
155
- * @example
156
- * Using a route resolver:
466
+ * @example Using a route resolver:
157
467
  *
158
- * ```
468
+ * ```javascript
159
469
  * {
160
- * defaultParams: {
161
- * routes: [
162
- * {
163
- * type: "page",
164
- * path: "/:uid"
165
- * },
166
- * {
167
- * type: "post",
168
- * path: "/blog/:uid"
169
- * }
170
- * ]
171
- * }
470
+ * "defaultParams": {
471
+ * "routes": [
472
+ * {
473
+ * "type": "page",
474
+ * "path": "/:uid"
475
+ * },
476
+ * {
477
+ * "type": "post",
478
+ * "path": "/blog/:uid"
479
+ * }
480
+ * ]
481
+ * }
172
482
  * }
173
483
  * ```
484
+ *
485
+ * @see Prismic client documentation {@link https://prismic.io/docs/technologies/javascript}
486
+ * @see Route resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#route-resolver}
174
487
  */
175
488
  clientConfig?: ClientConfig;
176
489
  /**
@@ -188,63 +501,74 @@ declare type PrismicPluginOptionsWithEndpoint = PrismicPluginOptionsBase & {
188
501
  */
189
502
  declare type PrismicPluginOptions = PrismicPluginOptionsWithClient | PrismicPluginOptionsWithEndpoint;
190
503
  /**
191
- * `@prismicio/client` related methods and properties exposed by `@prismicio/vue` plugin and accessible through `this.$prismic` and `usePrismic()`.
504
+ * `@prismicio/client` related methods and properties exposed by
505
+ * `@prismicio/vue` plugin and accessible through `this.$prismic` and `usePrismic()`.
192
506
  */
193
507
  declare type PrismicPluginClient = {
194
- /** A `@prismicio/client` instance. */
508
+ /**
509
+ * A `@prismicio/client` instance.
510
+ */
195
511
  client: Client;
196
- /** Query predicates from `@prismicio/client`. */
512
+ /**
513
+ * Query predicates from `@prismicio/client`.
514
+ */
197
515
  predicate: typeof predicate;
198
- /** Prismic cookies from `@prismicio/client`. */
516
+ /**
517
+ * Prismic cookies from `@prismicio/client`.
518
+ */
199
519
  cookie: typeof cookie;
200
520
  };
201
521
  /**
202
- * `@prismicio/helpers` related methods exposed by `@prismicio/vue` plugin and accessible through `this.$prismic` and `usePrismic()`.
522
+ * `@prismicio/helpers` related methods exposed by `@prismicio/vue` plugin and
523
+ * accessible through `this.$prismic` and `usePrismic()`.
203
524
  */
204
525
  declare type PrismicPluginHelpers = {
205
526
  /**
206
- * Serializes a rich text or title field to a plain text string. This is `@prismicio/helpers` {@link asText} function.
527
+ * Serializes a rich text or title field to a plain text string. This is
528
+ * `@prismicio/helpers` {@link asText} function.
207
529
  *
208
530
  * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
209
531
  */
210
532
  asText: typeof asText;
211
533
  /**
212
- * Serializes a rich text or title field to an HTML string. This is `@prismicio/helpers` {@link asHTML} function.
213
- *
214
- * @remarks If no `linkResolver` is provided the function will use the one provided to the plugin at {@link PrismicPluginOptions.linkResolver} if available.
215
- *
216
- * @remarks If no `htmlSerializer` is provided the function will use the one provided to the plugin at {@link PrismicPluginOptions.htmlSerializer} if available.
217
- *
534
+ * Serializes a rich text or title field to an HTML string. This is
535
+ * `@prismicio/helpers` {@link asHTML} function.
536
+ *
537
+ * @remarks
538
+ * If no `linkResolver` is provided the function will use the one provided to
539
+ * the plugin at {@link PrismicPluginOptions.linkResolver} if available.
540
+ * @remarks
541
+ * If no `htmlSerializer` is provided the function will use the one provided
542
+ * to the plugin at {@link PrismicPluginOptions.htmlSerializer} if available.
218
543
  * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
219
544
  */
220
545
  asHTML: typeof asHTML;
221
546
  /**
222
- * Resolves any type of link field to a URL. This is `@prismicio/helpers` {@link asLink} function.
223
- *
224
- * @remarks If no `linkResolver` is provided the function will use the one provided to the plugin at {@link PrismicPluginOptions.linkResolver} if available.
547
+ * Resolves any type of link field or document to a URL. This is
548
+ * `@prismicio/helpers` {@link asLink} function.
225
549
  *
550
+ * @remarks
551
+ * If no `linkResolver` is provided the function will use the one provided to
552
+ * the plugin at {@link PrismicPluginOptions.linkResolver} if available.
226
553
  * @see Templating link fields {@link https://prismic.io/docs/technologies/vue-template-content#links-and-content-relationships}
227
554
  */
228
555
  asLink: (linkField: Parameters<typeof asLink>[0], linkResolver?: LinkResolverFunction) => string | null;
229
556
  /**
230
- * Transforms a date or timestamp field into a JavaScript Date object. This is `@prismicio/helpers` {@link asDate} function.
557
+ * Transforms a date or timestamp field into a JavaScript Date object. This is
558
+ * `@prismicio/helpers` {@link asDate} function.
231
559
  */
232
560
  asDate: typeof asDate;
233
561
  /**
234
- * Converts a document into a link field. This is `@prismicio/helpers` {@link documentToLinkField} function.
235
- */
236
- documentToLinkField: typeof documentToLinkField;
237
- /**
238
- * Resolves a document to a URL. This is `@prismicio/helpers` {@link documentAsLink} function.
239
- *
240
- * @remarks If no `linkResolver` is provided the function will use the one provided to the plugin at {@link PrismicPluginOptions.linkResolver} if available.
562
+ * Converts a document into a link field. This is `@prismicio/helpers`
563
+ * {@link documentToLinkField} function.
241
564
  *
242
- * @see Templating link fields {@link https://prismic.io/docs/technologies/vue-template-content#links-and-content-relationships}
565
+ * @internal
243
566
  */
244
- documentAsLink: (prismicDocument: Parameters<typeof documentAsLink>[0], linkResolver?: LinkResolverFunction) => string | null;
567
+ documentToLinkField: typeof documentToLinkField;
245
568
  };
246
569
  /**
247
- * Methods and properties exposed by `@prismicio/vue` plugin and accessible through `this.$prismic` and `usePrismic()`.
570
+ * Methods and properties exposed by `@prismicio/vue` plugin and accessible
571
+ * through `this.$prismic` and `usePrismic()`.
248
572
  */
249
573
  declare type PrismicPlugin = {
250
574
  /**
@@ -264,18 +588,25 @@ declare type PrismicPlugin = {
264
588
  * States of a `@prismicio/client` composable.
265
589
  */
266
590
  declare const enum PrismicClientComposableState {
267
- /** The composable has not started fetching. */
591
+ /**
592
+ * The composable has not started fetching.
593
+ */
268
594
  Idle = "idle",
269
- /** The composable is fetching data. */
595
+ /**
596
+ * The composable is fetching data.
597
+ */
270
598
  Pending = "pending",
271
- /** The composable sucessfully fetched data. */
599
+ /**
600
+ * The composable sucessfully fetched data.
601
+ */
272
602
  Success = "success",
273
- /** The composable failed to fetch data. */
603
+ /**
604
+ * The composable failed to fetch data.
605
+ */
274
606
  Error = "error"
275
607
  }
276
608
  /**
277
- * Type to transform a static object into one that allows passing Refs as
278
- * values.
609
+ * Type to transform a static object into one that allows passing Refs as values.
279
610
  *
280
611
  * @internal
281
612
  */
@@ -289,7 +620,6 @@ declare type VueUseOptions<T> = {
289
620
  * @param options - {@link PrismicPluginOptions}
290
621
  *
291
622
  * @returns `@prismicio/vue` plugin instance {@link PrismicPlugin}
292
- *
293
623
  * @see Prismic Official Vue.js documentation: {@link https://prismic.io/docs/technologies/vuejs}
294
624
  * @see Plugin repository: {@link https://github.com/prismicio/prismic-vue}
295
625
  */
@@ -298,22 +628,21 @@ declare const createPrismic: (options: PrismicPluginOptions) => PrismicPlugin;
298
628
  /**
299
629
  * Accesses `@prismicio/vue` plugin interface.
300
630
  *
301
- * @returns The interface {@link PrismicPlugin}
302
- *
303
- * @example
304
- * With the composition API:
631
+ * @example With the composition API:
305
632
  *
306
- * ```
633
+ * ```javascript
307
634
  * import { usePrismic } from "@prismicio/vue";
308
635
  *
309
636
  * export default {
310
- * setup() {
311
- * const prismic = usePrismic();
637
+ * setup() {
638
+ * const prismic = usePrismic();
312
639
  *
313
- * return {}
314
- * },
640
+ * return {};
641
+ * },
315
642
  * };
316
643
  * ```
644
+ *
645
+ * @returns The interface {@link PrismicPlugin}
317
646
  */
318
647
  declare const usePrismic: () => PrismicPlugin;
319
648
 
@@ -321,7 +650,9 @@ declare const usePrismic: () => PrismicPlugin;
321
650
  * Props for `<PrismicEmbed />`.
322
651
  */
323
652
  declare type PrismicEmbedProps = {
324
- /** The Prismic embed field to render. */
653
+ /**
654
+ * The Prismic embed field to render.
655
+ */
325
656
  field: EmbedField;
326
657
  /**
327
658
  * An HTML tag name, a component, or a functional component used to wrap the output.
@@ -344,33 +675,23 @@ declare const PrismicEmbed: new () => {
344
675
  * Props for `<PrismicImage />`.
345
676
  */
346
677
  declare type PrismicImageProps = {
347
- /** The Prismic image field to render. */
348
- field: ImageField;
349
- /**
350
- * Ensures type union is a strict or.
351
- *
352
- * @internal
353
- */
354
- imageComponent?: never;
355
678
  /**
356
- * Ensures type union is a strict or.
357
- *
358
- * @internal
679
+ * The Prismic image field to render.
359
680
  */
360
- imageComponentAdditionalProps?: never;
361
- } | {
362
- /** The Prismic image field to render. */
363
681
  field: ImageField;
364
682
  /**
365
683
  * An HTML tag name, a component, or a functional component used to render images.
366
684
  *
367
- * @remarks HTML tag names and components will be rendered using the `img` tag interface (`src` and `alt` attribute). Components will also receive an additional `copyright` props.
368
- *
685
+ * @remarks
686
+ * HTML tag names and components will be rendered using the `img` tag
687
+ * interface (`src` and `alt` attribute). Components will also receive an
688
+ * additional `copyright` props.
369
689
  * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `"img"` otherwise.
370
690
  */
371
- imageComponent: string | ConcreteComponent;
691
+ imageComponent?: string | ConcreteComponent;
372
692
  /**
373
- * A map of additional props to pass to the component used to render images when using one.
693
+ * A map of additional props to pass to the component used to render images
694
+ * when using one.
374
695
  */
375
696
  imageComponentAdditionalProps?: Record<string, unknown>;
376
697
  };
@@ -388,47 +709,55 @@ declare const PrismicImage: new () => {
388
709
  * Props for `<PrismicLink />`.
389
710
  */
390
711
  declare type PrismicLinkProps = {
391
- /** The Prismic link field or document to render. */
712
+ /**
713
+ * The Prismic link field or document to render.
714
+ */
392
715
  field: LinkField | PrismicDocument;
393
716
  /**
394
- * A link resolver function used to resolve links when not using the route resolver parameter with `@prismicio/client`.
717
+ * A link resolver function used to resolve links when not using the route
718
+ * resolver parameter with `@prismicio/client`.
395
719
  *
396
720
  * @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.
397
- *
398
721
  * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
399
722
  */
400
723
  linkResolver?: LinkResolverFunction;
401
724
  /**
402
725
  * An explicit `target` attribute to apply to the rendered link.
403
726
  */
404
- target?: string;
727
+ target?: string | null;
405
728
  /**
406
729
  * An explicit `rel` attribute to apply to the rendered link.
407
730
  */
408
- rel?: string;
731
+ rel?: string | null;
409
732
  /**
410
733
  * Value of the `rel` attribute to use on links rendered with `target="_blank"`.
411
734
  *
412
735
  * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `"noopener noreferrer"` otherwise.
413
736
  */
414
- blankTargetRelAttribute?: string;
737
+ blankTargetRelAttribute?: string | null;
415
738
  /**
416
- * An HTML tag name, a component, or a functional component used to render internal links.
417
- *
418
- * @remarks HTML tag names will be rendered using the anchor tag interface (`href`, `target`, and `rel` attributes).
419
- *
420
- * @remarks Components will be rendered using Vue Router {@link RouterLink} interface (`to` props).
421
- *
739
+ * An HTML tag name, a component, or a functional component used to render
740
+ * internal links.
741
+ *
742
+ * @remarks
743
+ * HTML tag names will be rendered using the anchor tag interface (`href`,
744
+ * `target`, and `rel` attributes).
745
+ * @remarks
746
+ * Components will be rendered using Vue Router {@link RouterLink} interface
747
+ * (`to` props).
422
748
  * @defaultValue The one provided to `@prismicio/vue` plugin if configured, {@link RouterLink} otherwise.
423
749
  */
424
750
  internalComponent?: string | ConcreteComponent;
425
751
  /**
426
- * An HTML tag name, a component, or a functional component used to render external links.
427
- *
428
- * @remarks HTML tag names will be rendered using the anchor tag interface (`href`, `target`, and `rel` attributes).
429
- *
430
- * @remarks Components will be rendered using Vue Router {@link RouterLink} interface (`to` props).
431
- *
752
+ * An HTML tag name, a component, or a functional component used to render
753
+ * external links.
754
+ *
755
+ * @remarks
756
+ * HTML tag names will be rendered using the anchor tag interface (`href`,
757
+ * `target`, and `rel` attributes).
758
+ * @remarks
759
+ * Components will be rendered using Vue Router {@link RouterLink} interface
760
+ * (`to` props).
432
761
  * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `"a"` otherwise.
433
762
  */
434
763
  externalComponent?: string | ConcreteComponent;
@@ -441,13 +770,21 @@ declare type UsePrismicLinkOptions = VueUseOptions<PrismicLinkProps>;
441
770
  * Return type of {@link usePrismicLink}.
442
771
  */
443
772
  declare type UsePrismicLinkReturnType = {
444
- /** Suggested component to render for provided link field. */
773
+ /**
774
+ * Suggested component to render for provided link field.
775
+ */
445
776
  type: ComputedRef<string | ConcreteComponent>;
446
- /** Resolved anchor `href` value. */
777
+ /**
778
+ * Resolved anchor `href` value.
779
+ */
447
780
  href: ComputedRef<string>;
448
- /** Resolved anchor `target` value. */
781
+ /**
782
+ * Resolved anchor `target` value.
783
+ */
449
784
  target: ComputedRef<string | null>;
450
- /** Resolved anchor `rel` value. */
785
+ /**
786
+ * Resolved anchor `rel` value.
787
+ */
451
788
  rel: ComputedRef<string | null>;
452
789
  };
453
790
  /**
@@ -472,7 +809,9 @@ declare const PrismicLink: new () => {
472
809
  * Props for `<PrismicText />`.
473
810
  */
474
811
  declare type PrismicTextProps = {
475
- /** The Prismic rich text or title field to render. */
812
+ /**
813
+ * The Prismic rich text or title field to render.
814
+ */
476
815
  field: RichTextField;
477
816
  /**
478
817
  * Separator used to join each element.
@@ -493,329 +832,96 @@ declare type PrismicTextProps = {
493
832
  declare type UsePrismicTextOptions = VueUseOptions<Omit<PrismicTextProps, "wrapper">>;
494
833
  /**
495
834
  * Return type of {@link usePrismicText}.
496
- */
497
- declare type UsePrismicTextReturnType = {
498
- /** Serialized rich text field as plain text. */
499
- text: ComputedRef<string>;
500
- };
501
- /**
502
- * A low level composable that returns a serialized rich text field as plain text.
503
- *
504
- * @param props - {@link UsePrismicTextOptions}
505
- *
506
- * @returns - Serialized rich text field as plain text {@link UsePrismicTextReturnType}
507
- */
508
- declare const usePrismicText: (props: UsePrismicTextOptions) => UsePrismicTextReturnType;
509
- /**
510
- * Component to render a Prismic rich text field as plain text.
511
- *
512
- * @see Component props {@link PrismicTextProps}
513
- * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
514
- */
515
- declare const PrismicText: new () => {
516
- $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicTextProps;
517
- };
518
-
519
- /**
520
- * Props for `<PrismicRichText />`.
521
- */
522
- declare type PrismicRichTextProps = {
523
- /** The Prismic rich text or title field to render. */
524
- field: RichTextField;
525
- /**
526
- * A link resolver function used to resolve link when not using the route resolver parameter with `@prismicio/client`.
527
- *
528
- * @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.
529
- *
530
- * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
531
- */
532
- linkResolver?: LinkResolverFunction;
533
- /**
534
- * An HTML serializer to customize the way rich text fields are rendered.
535
- *
536
- * @defaultValue The HTML serializer provided to `@prismicio/vue` plugin if configured.
537
- *
538
- * @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}
539
- */
540
- htmlSerializer?: HTMLFunctionSerializer | HTMLMapSerializer;
541
- /**
542
- * An HTML tag name, a component, or a functional component used to wrap the output.
543
- *
544
- * @defaultValue `"div"`
545
- */
546
- wrapper?: string | ConcreteComponent;
547
- };
548
- /**
549
- * Options for {@link usePrismicRichText}.
550
- */
551
- declare type UsePrismicRichTextOptions = VueUseOptions<Omit<PrismicRichTextProps, "wrapper">>;
552
- /**
553
- * Return type of {@link usePrismicRichText}.
554
- */
555
- declare type UsePrismicRichTextReturnType = {
556
- /** Serialized rich text field as HTML. */
557
- html: ComputedRef<string>;
558
- };
559
- /**
560
- * A low level composable that returns a serialized rich text field as HTML.
561
- *
562
- * @param props - {@link UsePrismicRichTextOptions}
563
- *
564
- * @returns - Serialized rich text field as HTML {@link UsePrismicRichTextReturnType}
565
- */
566
- declare const usePrismicRichText: (props: UsePrismicRichTextOptions) => UsePrismicRichTextReturnType;
567
- /**
568
- * Component to render a Prismic rich text field as HTML.
569
- *
570
- * @see Component props {@link PrismicRichTextProps}
571
- * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
572
- */
573
- declare const PrismicRichText: new () => {
574
- $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicRichTextProps;
575
- };
576
-
577
- /**
578
- * The minimum required properties to represent a Prismic Slice for the `<SliceZone />` component.
579
- *
580
- * If using Prismic's REST API, use the `Slice` export from `@prismicio/types` for a full interface.
581
- *
582
- * @typeParam TSliceType - Type name of the Slice
583
- */
584
- declare type SliceLike<TSliceType extends string = string> = Pick<Slice<TSliceType>, "slice_type">;
585
- /**
586
- * A looser version of the `SliceZone` type from `@prismicio/types` using `SliceLike`.
587
- *
588
- * If using Prismic's REST API, use the `SliceZone` export from `@prismicio/types` for the full type.
589
- *
590
- * @typeParam TSlice - The type(s) of slices in the Slice Zone
591
- */
592
- declare type SliceZoneLike<TSlice extends SliceLike> = readonly TSlice[];
593
- /**
594
- * Vue props for a component rendering content from a Prismic Slice using the `<SliceZone />` component.
595
- *
596
- * @typeParam TSlice - The type(s) of slices in the Slice Zone
597
- * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made available to all Slice components
598
- */
599
- declare type SliceComponentProps<TSlice extends SliceLike = SliceLike, TContext = unknown> = {
600
- /** Slice data for this component. */
601
- slice: TSlice;
602
- /** The index of the Slice in the Slice Zone. */
603
- index: number;
604
- /** All Slices from the Slice Zone to which the Slice belongs. */
605
- slices: SliceZoneLike<SliceLike>;
606
- /** Arbitrary data passed to `<SliceZone />` and made available to all Slice components. */
607
- context: TContext;
608
- };
609
- /**
610
- * Native Vue props for a component rendering content from a Prismic Slice using the `<SliceZone />` component.
611
- *
612
- * @typeParam TSlice - The type(s) of slices in the Slice Zone
613
- * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made available to all Slice components
614
- */
615
- declare type DefineComponentSliceComponentProps<TSlice extends SliceLike = SliceLike, TContext = unknown> = {
616
- slice: {
617
- type: PropType<SliceComponentProps<TSlice, TContext>["slice"]>;
618
- required: true;
619
- };
620
- index: {
621
- type: PropType<SliceComponentProps<TSlice, TContext>["index"]>;
622
- required: true;
623
- };
624
- slices: {
625
- type: PropType<SliceComponentProps<TSlice, TContext>["slices"]>;
626
- required: true;
627
- };
628
- context: {
629
- type: PropType<SliceComponentProps<TSlice, TContext>["context"]>;
630
- required: true;
631
- };
632
- };
633
- /**
634
- * Gets native Vue props for a component rendering content from a Prismic Slice using the `<SliceZone />` component. Props are: `["slice", "index", "slices", "context"]`
635
- *
636
- * @param propsHint - An optional array of prop names used for the sole purpose of having a visual hint of which props are made available to the slice, this parameters doesn't have any effect
637
- *
638
- * @returns Props object to use with {@link defineComponent}
639
- *
640
- * @typeParam TSlice - The type(s) of slices in the Slice Zone
641
- * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made available to all Slice components
642
- *
643
- * @example
644
- * Defining a new slice component:
645
- *
646
- * ```
647
- * import { getSliceComponentProps } from "@prismicio/vue";
648
- *
649
- * export default {
650
- * props: getSliceComponentProps(),
651
- * };
652
- * ```
653
- *
654
- * @example
655
- * Defining a new slice component with visual hint:
656
- *
657
- * ```
658
- * import { getSliceComponentProps } from "@prismicio/vue";
659
- *
660
- * export default {
661
- * props: getSliceComponentProps(["slice", "index", "slices", "context"]),
662
- * };
663
- * ```
664
- */
665
- declare const getSliceComponentProps: <TSlice extends SliceLike<string> = SliceLike<string>, TContext = unknown>(propsHint?: string[] | undefined) => DefineComponentSliceComponentProps<TSlice, TContext>;
666
- /**
667
- * A Vue component to be rendered for each instance of its Slice.
668
- *
669
- * @typeParam TSlice - The type(s) of slices in the Slice Zone
670
- * @typeParam TContext - Arbitrary data made available to all Slice components
671
- */
672
- declare type SliceComponentType<TSlice extends SliceLike = SliceLike, TContext = unknown> = DefineComponent<SliceComponentProps<TSlice, TContext>> | FunctionalComponent<SliceComponentProps<TSlice, TContext>>;
673
- /**
674
- * This Slice component can be used as a reminder to provide a proper implementation.
675
- *
676
- * This is also the default Vue component rendered when a component mapping cannot be found in `<SliceZone />`.
677
- */
678
- declare const TODOSliceComponent: FunctionalComponent<SliceComponentProps<SliceLike<string>, unknown>, {}> | DefineComponent<SliceComponentProps<SliceLike<string>, unknown>, {}, {}, vue.ComputedOptions, vue.MethodOptions, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{
679
- slice?: unknown;
680
- index?: unknown;
681
- slices?: unknown;
682
- context?: unknown;
683
- } & {} & {
684
- slice?: SliceLike<string> | undefined;
685
- index?: number | undefined;
686
- slices?: SliceZoneLike<SliceLike<string>> | undefined;
687
- context?: unknown;
688
- }> & {}, {}>;
689
- /**
690
- * A record of Slice types mapped to Vue components. Each components will be rendered for each instance of their Slice type.
691
- *
692
- * @typeParam TSlice - The type(s) of slices in the Slice Zone
693
- * @typeParam TContext - Arbitrary data made available to all Slice components
694
- */
695
- declare type SliceZoneComponents<TSlice extends SliceLike = SliceLike, TContext = unknown> = {
696
- [SliceType in keyof Record<TSlice["slice_type"], never>]: SliceComponentType<Extract<TSlice, SliceLike<SliceType>>, TContext> | string;
835
+ */
836
+ declare type UsePrismicTextReturnType = {
837
+ /**
838
+ * Serialized rich text field as plain text.
839
+ */
840
+ text: ComputedRef<string>;
697
841
  };
698
842
  /**
699
- * Gets an optimized record of Slice types mapped to Vue components. Each components will be rendered for each instance of their Slice type.
700
- *
701
- * @param components - {@link SliceZoneComponents}
702
- *
703
- * @returns A new optimized record of {@link SliceZoneComponents}
704
- *
705
- * @typeParam TSlice - The type(s) of slices in the Slice Zone
706
- * @typeParam TContext - Arbitrary data made available to all Slice components
707
- *
708
- * @remarks This is essentially an helper function to ensure {@link markRaw} is correctly applied on each components, improving performances.
709
- *
710
- * @example
711
- * Defining a slice components:
843
+ * A low level composable that returns a serialized rich text field as plain text.
712
844
  *
713
- * ```
714
- * import { getSliceZoneComponents } from "@prismicio/vue";
845
+ * @param props - {@link UsePrismicTextOptions}
715
846
  *
716
- * export default {
717
- * data() {
718
- * components: getSliceZoneComponents({
719
- * foo: Foo,
720
- * bar: defineAsyncComponent(
721
- * () => new Promise((res) => res(Bar)),
722
- * ),
723
- * baz: "Baz",
724
- * }),
725
- * }
726
- * };
727
- * ```
847
+ * @returns - Serialized rich text field as plain text {@link UsePrismicTextReturnType}
728
848
  */
729
- declare const getSliceZoneComponents: <TSlice extends SliceLike<string> = SliceLike<string>, TContext = unknown>(components: SliceZoneComponents<TSlice, TContext>) => SliceZoneComponents<TSlice, TContext>;
849
+ declare const usePrismicText: (props: UsePrismicTextOptions) => UsePrismicTextReturnType;
730
850
  /**
731
- * Props for `<SliceZone />`.
851
+ * Component to render a Prismic rich text field as plain text.
732
852
  *
733
- * @typeParam TSlice - The type(s) of slices in the Slice Zone
734
- * @typeParam TContext - Arbitrary data made available to all Slice components
853
+ * @see Component props {@link PrismicTextProps}
854
+ * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
735
855
  */
736
- declare type SliceZoneProps<TSlice extends SliceLike = SliceLike, TContext = unknown> = {
737
- /** List of Slice data from the Slice Zone. */
738
- slices: SliceZoneLike<TSlice>;
739
- /** A record mapping Slice types to Vue components. */
740
- components: SliceZoneComponents;
741
- /** Arbitrary data made available to all Slice components. */
742
- context?: TContext;
856
+ declare const PrismicText: new () => {
857
+ $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicTextProps;
858
+ };
859
+
860
+ /**
861
+ * Props for `<PrismicRichText />`.
862
+ */
863
+ declare type PrismicRichTextProps = {
864
+ /**
865
+ * The Prismic rich text or title field to render.
866
+ */
867
+ field: RichTextField;
743
868
  /**
744
- * A component or a functional component rendered if a component mapping from the `components` prop cannot be found.
869
+ * A link resolver function used to resolve link when not using the route
870
+ * resolver parameter with `@prismicio/client`.
745
871
  *
746
- * @remarks Components will be rendered using the {@link SliceComponentProps} interface.
872
+ * @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.
873
+ * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
874
+ */
875
+ linkResolver?: LinkResolverFunction;
876
+ /**
877
+ * An HTML serializer to customize the way rich text fields are rendered.
747
878
  *
748
- * @defaultValue The Slice Zone default component provided to `@prismicio/vue` plugin if configured, otherwise `null` when `process.env.NODE_ENV === "production"` else {@link TODOSliceComponent}.
879
+ * @defaultValue The HTML serializer provided to `@prismicio/vue` plugin if configured.
880
+ * @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}
749
881
  */
750
- defaultComponent?: SliceComponentType<TSlice, TContext>;
882
+ htmlSerializer?: HTMLFunctionSerializer | HTMLMapSerializer;
751
883
  /**
752
- * An HTML tag name, a component, or a functional component used to wrap the output. The Slice Zone is not wrapped by default.
884
+ * An HTML tag name, a component, or a functional component used to wrap the output.
885
+ *
886
+ * @defaultValue `"div"`
753
887
  */
754
888
  wrapper?: string | ConcreteComponent;
755
889
  };
756
890
  /**
757
- * `<SliceZone />` implementation.
891
+ * Options for {@link usePrismicRichText}.
892
+ */
893
+ declare type UsePrismicRichTextOptions = VueUseOptions<Omit<PrismicRichTextProps, "wrapper">>;
894
+ /**
895
+ * Return type of {@link usePrismicRichText}.
896
+ */
897
+ declare type UsePrismicRichTextReturnType = {
898
+ /**
899
+ * Serialized rich text field as HTML.
900
+ */
901
+ html: ComputedRef<string>;
902
+ };
903
+ /**
904
+ * A low level composable that returns a serialized rich text field as HTML.
758
905
  *
759
- * @internal
906
+ * @param props - {@link UsePrismicRichTextOptions}
907
+ *
908
+ * @returns - Serialized rich text field as HTML {@link UsePrismicRichTextReturnType}
760
909
  */
761
- declare const SliceZoneImpl: DefineComponent<{
762
- slices: {
763
- type: PropType<SliceZoneLike<SliceLike<string>>>;
764
- required: true;
765
- };
766
- components: {
767
- type: PropType<SliceZoneComponents<SliceLike<string>, unknown>>;
768
- required: true;
769
- };
770
- context: {
771
- type: null;
772
- default: undefined;
773
- required: false;
774
- };
775
- defaultComponent: {
776
- type: PropType<SliceComponentType<SliceLike<string>, unknown>>;
777
- default: undefined;
778
- required: false;
779
- };
780
- wrapper: {
781
- type: PropType<string | ConcreteComponent<{}, any, any, vue.ComputedOptions, vue.MethodOptions>>;
782
- default: undefined;
783
- required: false;
784
- };
785
- }, (() => null) | (() => vue.VNode<vue.RendererNode, vue.RendererElement, {
786
- [key: string]: any;
787
- }> | vue.VNode<vue.RendererNode, vue.RendererElement, {
788
- [key: string]: any;
789
- }>[]), unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{
790
- slices?: unknown;
791
- components?: unknown;
792
- context?: unknown;
793
- defaultComponent?: unknown;
794
- wrapper?: unknown;
795
- } & {
796
- slices: SliceZoneLike<SliceLike<string>>;
797
- components: SliceZoneComponents<SliceLike<string>, unknown>;
798
- } & {
799
- wrapper?: string | ConcreteComponent<{}, any, any, vue.ComputedOptions, vue.MethodOptions> | undefined;
800
- context?: any;
801
- defaultComponent?: SliceComponentType<SliceLike<string>, unknown> | undefined;
802
- }> & {}, {
803
- wrapper: string | ConcreteComponent<{}, any, any, vue.ComputedOptions, vue.MethodOptions>;
804
- context: any;
805
- defaultComponent: SliceComponentType<SliceLike<string>, unknown>;
806
- }>;
910
+ declare const usePrismicRichText: (props: UsePrismicRichTextOptions) => UsePrismicRichTextReturnType;
807
911
  /**
808
- * Component to render a Prismic Slice Zone.
912
+ * Component to render a Prismic rich text field as HTML.
809
913
  *
810
- * @see Component props {@link SliceZoneProps}
811
- * @see Templating Slice Zones {@link https://prismic.io/docs/technologies/vue-template-content#slices-and-groups}
914
+ * @see Component props {@link PrismicRichTextProps}
915
+ * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
812
916
  */
813
- declare const SliceZone: new () => {
814
- $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & SliceZoneProps;
917
+ declare const PrismicRichText: new () => {
918
+ $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicRichTextProps;
815
919
  };
816
920
 
817
- declare type ClientError = PrismicError | ParsingError | ForbiddenError;
818
- /** @internal */
921
+ declare type ClientError = PrismicError<unknown> | ParsingError | ForbiddenError;
922
+ /**
923
+ * @internal
924
+ */
819
925
  declare type ComposableOnlyParameters = {
820
926
  client?: Ref<Client> | Client;
821
927
  };
@@ -825,226 +931,276 @@ declare type ComposableOnlyParameters = {
825
931
  * @typeParam TData - The expected format of the `data` property of the returned object
826
932
  */
827
933
  declare type ClientComposableReturnType<TData = unknown> = {
828
- /** The current state of the composable's client method call. */
934
+ /**
935
+ * The current state of the composable's client method call.
936
+ */
829
937
  state: Ref<PrismicClientComposableState>;
830
- /** Data returned by the client. */
938
+ /**
939
+ * Data returned by the client.
940
+ */
831
941
  data: Ref<TData | null>;
832
- /** Error returned by the composable's client method call if in an errror state. */
833
- error: Ref<ClientError | null>;
834
- /** Perform the composable's client method call again. */
942
+ /**
943
+ * Error returned by the composable's client method call if in an errror state.
944
+ */
945
+ error: Ref<ClientError | Error | null>;
946
+ /**
947
+ * Perform the composable's client method call again.
948
+ */
835
949
  refresh: () => Promise<void>;
836
950
  };
837
951
 
838
952
  /**
839
953
  * A composable that queries content from the Prismic repository.
840
954
  *
955
+ * @remarks
956
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
957
+ * @typeParam TDocument - Type of Prismic documents returned
841
958
  * @param params - Parameters to filter, sort, and paginate results
842
959
  *
843
960
  * @returns The composable payload {@link ClientComposableReturnType}
844
- *
845
- * @typeParam TDocument - Type of Prismic documents returned
846
- *
847
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
848
- *
849
961
  * @see Underlying `@prismicio/client` method {@link Client.get}
850
962
  */
851
963
  declare const usePrismicDocuments: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
852
964
  /**
853
- * A composable that queries content from the Prismic repository and returns only the first result, if any.
965
+ * A composable that queries content from the Prismic repository and returns
966
+ * only the first result, if any.
854
967
  *
968
+ * @remarks
969
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
970
+ * @typeParam TDocument - Type of the Prismic document returned
855
971
  * @param params - Parameters to filter, sort, and paginate results
856
972
  *
857
973
  * @returns The composable payload {@link ClientComposableReturnType}
858
- *
859
- * @typeParam TDocument - Type of the Prismic document returned
860
- *
861
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
862
- *
863
974
  * @see Underlying `@prismicio/client` method {@link Client.getFirst}
864
975
  */
865
976
  declare const useFirstPrismicDocument: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument>;
866
- /**
867
- * A composable that queries content from the Prismic repository and returns all matching content. If no predicates are provided, all documents will be fetched.
868
- *
869
- * @param params - Parameters to filter and sort results
870
- *
871
- * @returns The composable payload {@link ClientComposableReturnType}
872
- *
873
- * @typeParam TDocument - Type of Prismic documents returned
874
- *
875
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
876
- *
877
- * @see Underlying `@prismicio/client` method {@link Client.getAll}
878
- */
879
- declare const useAllPrismicDocuments: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & {
880
- limit?: number | undefined;
881
- } & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
882
977
  /**
883
978
  * A composable that queries a document from the Prismic repository with a specific ID.
884
979
  *
980
+ * @remarks
981
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
982
+ * @typeParam TDocument - Type of the Prismic document returned
885
983
  * @param id - ID of the document
886
984
  * @param params - Parameters to filter, sort, and paginate results
887
985
  *
888
986
  * @returns The composable payload {@link ClientComposableReturnType}
889
- *
890
- * @typeParam TDocument - Type of the Prismic document returned
891
- *
892
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
893
- *
894
987
  * @see Underlying `@prismicio/client` method {@link Client.getByID}
895
988
  */
896
989
  declare const usePrismicDocumentByID: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(id: string, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument>;
897
990
  /**
898
991
  * A composable that queries documents from the Prismic repository with specific IDs.
899
992
  *
993
+ * @remarks
994
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
995
+ * @typeParam TDocument - Type of Prismic documents returned
900
996
  * @param ids - A list of document IDs
901
997
  * @param params - Parameters to filter, sort, and paginate results
902
998
  *
903
999
  * @returns The composable payload {@link ClientComposableReturnType}
904
- *
905
- * @typeParam TDocument - Type of Prismic documents returned
906
- *
907
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
908
- *
909
1000
  * @see Underlying `@prismicio/client` method {@link Client.getByIDs}
910
1001
  */
911
1002
  declare const usePrismicDocumentsByIDs: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(ids: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
912
1003
  /**
913
1004
  * A composable that queries all documents from the Prismic repository with specific IDs.
914
1005
  *
1006
+ * @remarks
1007
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1008
+ * @typeParam TDocument - Type of Prismic documents returned
915
1009
  * @param ids - A list of document IDs
916
1010
  * @param params - Parameters to filter and sort results
917
1011
  *
918
1012
  * @returns The composable payload {@link ClientComposableReturnType}
919
- *
920
- * @typeParam TDocument - Type of Prismic documents returned
921
- *
922
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
923
- *
924
1013
  * @see Underlying `@prismicio/client` method {@link Client.getAllByIDs}
925
1014
  */
926
1015
  declare const useAllPrismicDocumentsByIDs: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(ids: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
927
1016
  /**
928
- * A composable that queries a document from the Prismic repository with a specific UID and Custom Type.
1017
+ * A composable that queries a document from the Prismic repository with a
1018
+ * specific UID and Custom Type.
929
1019
  *
1020
+ * @remarks
1021
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1022
+ * @typeParam TDocument - Type of the Prismic document returned
930
1023
  * @param documentType - The API ID of the document's Custom Type
931
1024
  * @param uid - UID of the document
932
1025
  * @param params - Parameters to filter, sort, and paginate results
933
1026
  *
934
1027
  * @returns The composable payload {@link ClientComposableReturnType}
935
- *
936
- * @typeParam TDocument - Type of the Prismic document returned
937
- *
938
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
939
- *
940
1028
  * @see Underlying `@prismicio/client` method {@link Client.getByUID}
941
1029
  */
942
1030
  declare const usePrismicDocumentByUID: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(documentType: string, uid: string, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument>;
943
1031
  /**
944
- * A composable that queries a singleton document from the Prismic repository for a specific Custom Type.
1032
+ * A composable that queries documents from the Prismic repository with specific UIDs.
945
1033
  *
946
- * @param documentType - The API ID of the singleton Custom Type
1034
+ * @remarks
1035
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1036
+ * @typeParam TDocument - Type of Prismic documents returned
1037
+ * @param documentType - The API ID of the document's Custom Type
1038
+ * @param uids - A list of document UIDs
947
1039
  * @param params - Parameters to filter, sort, and paginate results
948
1040
  *
949
1041
  * @returns The composable payload {@link ClientComposableReturnType}
1042
+ * @see Underlying `@prismicio/client` method {@link Client.getByIDs}
1043
+ */
1044
+ declare const usePrismicDocumentsByUIDs: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(documentType: string, uids: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
1045
+ /**
1046
+ * A composable that queries all documents from the Prismic repository with specific UIDs.
950
1047
  *
951
- * @typeParam TDocument - Type of the Prismic document returned
1048
+ * @remarks
1049
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1050
+ * @typeParam TDocument - Type of Prismic documents returned
1051
+ * @param documentType - The API ID of the document's Custom Type
1052
+ * @param uids - A list of document UIDs
1053
+ * @param params - Parameters to filter and sort results
1054
+ *
1055
+ * @returns The composable payload {@link ClientComposableReturnType}
1056
+ * @see Underlying `@prismicio/client` method {@link Client.getAllByIDs}
1057
+ */
1058
+ declare const useAllPrismicDocumentsByUIDs: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(documentType: string, ids: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
1059
+ /**
1060
+ * A composable that queries a singleton document from the Prismic repository
1061
+ * for a specific Custom Type.
952
1062
  *
953
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
1063
+ * @remarks
1064
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1065
+ * @typeParam TDocument - Type of the Prismic document returned
1066
+ * @param documentType - The API ID of the singleton Custom Type
1067
+ * @param params - Parameters to filter, sort, and paginate results
954
1068
  *
1069
+ * @returns The composable payload {@link ClientComposableReturnType}
955
1070
  * @see Underlying `@prismicio/client` method {@link Client.getSingle}
956
1071
  */
957
1072
  declare const useSinglePrismicDocument: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(documentType: string, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument>;
958
1073
  /**
959
- * A composable that queries documents from the Prismic repository for a specific Custom Type.
1074
+ * A composable that queries documents from the Prismic repository for a
1075
+ * specific Custom Type.
960
1076
  *
1077
+ * @remarks
1078
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1079
+ * @typeParam TDocument - Type of Prismic documents returned
961
1080
  * @param documentType - The API ID of the Custom Type
962
1081
  * @param params - Parameters to filter, sort, and paginate results
963
1082
  *
964
1083
  * @returns The composable payload {@link ClientComposableReturnType}
965
- *
966
- * @typeParam TDocument - Type of Prismic documents returned
967
- *
968
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
969
- *
970
1084
  * @see Underlying `@prismicio/client` method {@link Client.getByType}
971
1085
  */
972
1086
  declare const usePrismicDocumentsByType: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(documentType: string, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
973
1087
  /**
974
- * A composable that queries all documents from the Prismic repository for a specific Custom Type.
1088
+ * A composable that queries all documents from the Prismic repository for a
1089
+ * specific Custom Type.
975
1090
  *
1091
+ * @remarks
1092
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1093
+ * @typeParam TDocument - Type of Prismic documents returned
976
1094
  * @param documentType - The API ID of the Custom Type
977
1095
  * @param params - Parameters to filter and sort results
978
1096
  *
979
1097
  * @returns The composable payload {@link ClientComposableReturnType}
980
- *
981
- * @typeParam TDocument - Type of Prismic documents returned
982
- *
983
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
984
- *
985
1098
  * @see Underlying `@prismicio/client` method {@link Client.getAllByType}
986
1099
  */
987
1100
  declare const useAllPrismicDocumentsByType: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(documentType: string, params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
988
1101
  /**
989
1102
  * A composable that queries documents from the Prismic repository with a specific tag.
990
1103
  *
1104
+ * @remarks
1105
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1106
+ * @typeParam TDocument - Type of Prismic documents returned
991
1107
  * @param tag - The tag that must be included on a document
992
1108
  * @param params - Parameters to filter, sort, and paginate results
993
1109
  *
994
1110
  * @returns The composable payload {@link ClientComposableReturnType}
995
- *
996
- * @typeParam TDocument - Type of Prismic documents returned
997
- *
998
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
999
- *
1000
1111
  * @see Underlying `@prismicio/client` method {@link Client.getByTag}
1001
1112
  */
1002
1113
  declare const usePrismicDocumentsByTag: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(tag: string, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
1003
1114
  /**
1004
- * A composable that queries all documents from the Prismic repository with a specific tag.
1115
+ * A composable that queries all documents from the Prismic repository with a
1116
+ * specific tag.
1005
1117
  *
1118
+ * @remarks
1119
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1120
+ * @typeParam TDocument - Type of Prismic documents returned
1006
1121
  * @param tag - The tag that must be included on a document
1007
1122
  * @param params - Parameters to filter and sort results
1008
1123
  *
1009
1124
  * @returns The composable payload {@link ClientComposableReturnType}
1010
- *
1011
- * @typeParam TDocument - Type of Prismic documents returned
1012
- *
1013
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
1014
- *
1015
1125
  * @see Underlying `@prismicio/client` method {@link Client.getAllByTag}
1016
1126
  */
1017
1127
  declare const useAllPrismicDocumentsByTag: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(tag: string, params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
1018
1128
  /**
1019
- * A composable that queries documents from the Prismic repository with specific tags.
1129
+ * A composable that queries documents from the Prismic repository with specific
1130
+ * tags. A document must be tagged with all of the queried tags to be included.
1020
1131
  *
1132
+ * @remarks
1133
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1134
+ * @typeParam TDocument - Type of Prismic documents returned
1021
1135
  * @param tags - A list of tags that must be included on a document
1022
1136
  * @param params - Parameters to filter, sort, and paginate results
1023
1137
  *
1024
1138
  * @returns The composable payload {@link ClientComposableReturnType}
1139
+ * @see Underlying `@prismicio/client` method {@link Client.getByTags}
1140
+ */
1141
+ declare const usePrismicDocumentsByEveryTag: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(tags: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
1142
+ /**
1143
+ * A composable that queries all documents from the Prismic repository with
1144
+ * specific tags. A document must be tagged with all of the queried tags to be included.
1025
1145
  *
1146
+ * @remarks
1147
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1026
1148
  * @typeParam TDocument - Type of Prismic documents returned
1149
+ * @param tags - A list of tags that must be included on a document
1150
+ * @param params - Parameters to filter and sort results
1151
+ *
1152
+ * @returns The composable payload {@link ClientComposableReturnType}
1153
+ * @see Underlying `@prismicio/client` method {@link Client.getAllByTags}
1154
+ */
1155
+ declare const useAllPrismicDocumentsByEveryTag: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(tags: string[], params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
1156
+ /**
1157
+ * A composable that queries documents from the Prismic repository with specific
1158
+ * tags. A document must be tagged with at least one of the queried tags to be included.
1027
1159
  *
1028
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
1160
+ * @remarks
1161
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1162
+ * @typeParam TDocument - Type of Prismic documents returned
1163
+ * @param tags - A list of tags that must be included on a document
1164
+ * @param params - Parameters to filter, sort, and paginate results
1029
1165
  *
1166
+ * @returns The composable payload {@link ClientComposableReturnType}
1030
1167
  * @see Underlying `@prismicio/client` method {@link Client.getByTags}
1031
1168
  */
1032
- declare const usePrismicDocumentsByTags: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(tags: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
1169
+ declare const usePrismicDocumentsBySomeTags: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(tags: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
1033
1170
  /**
1034
- * A composable that queries all documents from the Prismic repository with specific tags.
1171
+ * A composable that queries all documents from the Prismic repository with
1172
+ * specific tags. A document must be tagged with at least one of the queried
1173
+ * tags to be included.
1035
1174
  *
1175
+ * @remarks
1176
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1177
+ * @typeParam TDocument - Type of Prismic documents returned
1036
1178
  * @param tags - A list of tags that must be included on a document
1037
1179
  * @param params - Parameters to filter and sort results
1038
1180
  *
1039
1181
  * @returns The composable payload {@link ClientComposableReturnType}
1182
+ * @see Underlying `@prismicio/client` method {@link Client.getAllByTags}
1183
+ */
1184
+ declare const useAllPrismicDocumentsBySomeTags: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(tags: string[], params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
1185
+ /**
1186
+ * **IMPORTANT**: Avoid using `dangerouslyUseAllPrismicDocuments` as it may be
1187
+ * slower and require more resources than other composables. Prefer using other
1188
+ * composables that filter by predicates such as `useAllPrismicDocumentsByType`.
1040
1189
  *
1041
- * @typeParam TDocument - Type of Prismic documents returned
1190
+ * A composable that queries content from the Prismic repository and returns all
1191
+ * matching content. If no predicates are provided, all documents will be fetched.
1042
1192
  *
1043
- * @remarks An additional `@prismicio/client` instance can be provided at `params.client`.
1193
+ * @remarks
1194
+ * An additional `@prismicio/client` instance can be provided at `params.client`.
1195
+ * @typeParam TDocument - Type of Prismic documents returned
1196
+ * @param params - Parameters to filter and sort results
1044
1197
  *
1045
- * @see Underlying `@prismicio/client` method {@link Client.getAllByTags}
1198
+ * @returns The composable payload {@link ClientComposableReturnType}
1199
+ * @see Underlying `@prismicio/client` method {@link Client.getAll}
1046
1200
  */
1047
- declare const useAllPrismicDocumentsByTags: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(tags: string[], params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
1201
+ declare const dangerouslyUseAllPrismicDocuments: <TDocument extends PrismicDocument<Record<string, _prismicio_types.AnyRegularField | _prismicio_types.GroupField<Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SliceZone<_prismicio_types.Slice<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>> | _prismicio_types.SharedSlice<string, _prismicio_types.SharedSliceVariation<string, Record<string, _prismicio_types.AnyRegularField>, Record<string, _prismicio_types.AnyRegularField>>>>>, string, string>>(params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & {
1202
+ limit?: number | undefined;
1203
+ } & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
1048
1204
 
1049
1205
  /**
1050
1206
  * `@prismicio/vue` plugin interface interface location used for {@link usePrismic}.
@@ -1064,4 +1220,4 @@ declare module "@vue/runtime-core" {
1064
1220
  }
1065
1221
  }
1066
1222
 
1067
- export { ClientComposableReturnType, DefineComponentSliceComponentProps, PrismicClientComposableState, PrismicEmbed, PrismicEmbedProps, PrismicImage, PrismicImageProps, PrismicLink, PrismicLinkProps, PrismicPlugin, PrismicPluginOptions, PrismicRichText, PrismicRichTextProps, PrismicText, PrismicTextProps, SliceComponentProps, SliceComponentType, SliceLike, SliceZone, SliceZoneComponents, SliceZoneImpl, SliceZoneLike, SliceZoneProps, TODOSliceComponent, UsePrismicLinkOptions, UsePrismicRichTextOptions, UsePrismicTextOptions, createPrismic, getSliceComponentProps, getSliceZoneComponents, prismicKey, useAllPrismicDocuments, useAllPrismicDocumentsByIDs, useAllPrismicDocumentsByTag, useAllPrismicDocumentsByTags, useAllPrismicDocumentsByType, useFirstPrismicDocument, usePrismic, usePrismicDocumentByID, usePrismicDocumentByUID, usePrismicDocuments, usePrismicDocumentsByIDs, usePrismicDocumentsByTag, usePrismicDocumentsByTags, usePrismicDocumentsByType, usePrismicLink, usePrismicRichText, usePrismicText, useSinglePrismicDocument };
1223
+ export { ClientComposableReturnType, DefineComponentSliceComponentProps, PrismicClientComposableState, PrismicEmbed, PrismicEmbedProps, PrismicImage, PrismicImageProps, PrismicLink, PrismicLinkProps, PrismicPlugin, PrismicPluginOptions, PrismicRichText, PrismicRichTextProps, PrismicText, PrismicTextProps, SliceComponentProps, SliceComponentType, SliceLike, SliceZone, SliceZoneComponents, SliceZoneImpl, SliceZoneLike, SliceZoneProps, SliceZoneResolver, TODOSliceComponent, UsePrismicLinkOptions, UsePrismicRichTextOptions, UsePrismicTextOptions, createPrismic, dangerouslyUseAllPrismicDocuments, defineSliceZoneComponents, getSliceComponentProps, prismicKey, useAllPrismicDocumentsByEveryTag, useAllPrismicDocumentsByIDs, useAllPrismicDocumentsBySomeTags, useAllPrismicDocumentsByTag, useAllPrismicDocumentsByType, useAllPrismicDocumentsByUIDs, useFirstPrismicDocument, usePrismic, usePrismicDocumentByID, usePrismicDocumentByUID, usePrismicDocuments, usePrismicDocumentsByEveryTag, usePrismicDocumentsByIDs, usePrismicDocumentsBySomeTags, usePrismicDocumentsByTag, usePrismicDocumentsByType, usePrismicDocumentsByUIDs, usePrismicLink, usePrismicRichText, usePrismicText, useSinglePrismicDocument };