@prismicio/vue 3.1.0 → 3.1.2

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