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