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