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