@prismicio/vue 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +127 -92
- package/dist/index.js.map +1 -1
- package/package.json +23 -23
- package/src/components/PrismicEmbed.ts +2 -1
- package/src/components/PrismicImage.ts +6 -3
- package/src/components/PrismicLink.ts +4 -2
- package/src/components/PrismicRichText.ts +4 -2
- package/src/components/PrismicText.ts +6 -3
- package/src/components/SliceZone.ts +12 -7
- package/src/composables.ts +56 -46
- package/src/injectionSymbols.ts +2 -1
- package/src/types.ts +14 -7
- package/src/useStatefulPrismicClientMethod.ts +6 -3
package/dist/index.d.ts
CHANGED
|
@@ -44,7 +44,8 @@ declare type SliceLikeGraphQL<TSliceType extends string = string> = {
|
|
|
44
44
|
*/
|
|
45
45
|
declare type SliceLike<TSliceType extends string = string> = SliceLikeRestV2<TSliceType> | SliceLikeGraphQL<TSliceType>;
|
|
46
46
|
/**
|
|
47
|
-
* A looser version of the `SliceZone` type from `@prismicio/types` using
|
|
47
|
+
* A looser version of the `SliceZone` type from `@prismicio/types` using
|
|
48
|
+
* `SliceLike`.
|
|
48
49
|
*
|
|
49
50
|
* If using Prismic's REST API, use the `SliceZone` export from
|
|
50
51
|
* `@prismicio/types` for the full type.
|
|
@@ -74,7 +75,8 @@ declare type SliceComponentProps<TSlice extends SliceLike = any, TContext = unkn
|
|
|
74
75
|
*/
|
|
75
76
|
slices: SliceZoneLike<SliceLike>;
|
|
76
77
|
/**
|
|
77
|
-
* Arbitrary data passed to `<SliceZone />` and made available to all Slice
|
|
78
|
+
* Arbitrary data passed to `<SliceZone />` and made available to all Slice
|
|
79
|
+
* components.
|
|
78
80
|
*/
|
|
79
81
|
context: TContext;
|
|
80
82
|
};
|
|
@@ -82,7 +84,7 @@ declare type SliceComponentProps<TSlice extends SliceLike = any, TContext = unkn
|
|
|
82
84
|
* Native Vue props for a component rendering content from a Prismic Slice using
|
|
83
85
|
* the `<SliceZone />` component.
|
|
84
86
|
*
|
|
85
|
-
* @typeParam TSlice - The
|
|
87
|
+
* @typeParam TSlice - The Slice type
|
|
86
88
|
* @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made
|
|
87
89
|
* available to all Slice components
|
|
88
90
|
*/
|
|
@@ -129,7 +131,7 @@ declare type DefineComponentSliceComponentProps<TSlice extends SliceLike = any,
|
|
|
129
131
|
* };
|
|
130
132
|
* ```
|
|
131
133
|
*
|
|
132
|
-
* @typeParam TSlice - The
|
|
134
|
+
* @typeParam TSlice - The Slice type
|
|
133
135
|
* @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made
|
|
134
136
|
* available to all Slice components
|
|
135
137
|
* @param propsHint - An optional array of prop names used for the sole purpose
|
|
@@ -138,7 +140,7 @@ declare type DefineComponentSliceComponentProps<TSlice extends SliceLike = any,
|
|
|
138
140
|
*
|
|
139
141
|
* @returns Props object to use with {@link defineComponent}
|
|
140
142
|
*/
|
|
141
|
-
declare const getSliceComponentProps: <TSlice extends SliceLike<string> =
|
|
143
|
+
declare const getSliceComponentProps: <TSlice extends SliceLike<string> = any, TContext = unknown>(propsHint?: ["slice", "index", "slices", "context"]) => DefineComponentSliceComponentProps<TSlice, TContext>;
|
|
142
144
|
/**
|
|
143
145
|
* A Vue component to be rendered for each instance of its Slice.
|
|
144
146
|
*
|
|
@@ -147,7 +149,8 @@ declare const getSliceComponentProps: <TSlice extends SliceLike<string> = SliceL
|
|
|
147
149
|
*/
|
|
148
150
|
declare type SliceComponentType<TSlice extends SliceLike = any, TContext = unknown> = DefineComponent<SliceComponentProps<TSlice, TContext>> | FunctionalComponent<SliceComponentProps<TSlice, TContext>>;
|
|
149
151
|
/**
|
|
150
|
-
* This Slice component can be used as a reminder to provide a proper
|
|
152
|
+
* This Slice component can be used as a reminder to provide a proper
|
|
153
|
+
* implementation.
|
|
151
154
|
*
|
|
152
155
|
* This is also the default Vue component rendered when a component mapping
|
|
153
156
|
* cannot be found in `<SliceZone />`.
|
|
@@ -218,7 +221,8 @@ declare type SliceZoneResolverArgs<TSlice extends SliceLike = SliceLike> = {
|
|
|
218
221
|
/**
|
|
219
222
|
* A function that determines the rendered Vue component for each Slice in the
|
|
220
223
|
* Slice Zone. If a nullish value is returned, the component will fallback to
|
|
221
|
-
* the `components` or `defaultComponent` props to determine the rendered
|
|
224
|
+
* the `components` or `defaultComponent` props to determine the rendered
|
|
225
|
+
* component.
|
|
222
226
|
*
|
|
223
227
|
* @deprecated Use the `components` prop instead.
|
|
224
228
|
*
|
|
@@ -287,7 +291,8 @@ declare const SliceZone: new () => {
|
|
|
287
291
|
*/
|
|
288
292
|
declare type PrismicPluginComponentsOptions = {
|
|
289
293
|
/**
|
|
290
|
-
* Value of the `rel` attribute to use on links rendered with
|
|
294
|
+
* Value of the `rel` attribute to use on links rendered with
|
|
295
|
+
* `target="_blank"`
|
|
291
296
|
*
|
|
292
297
|
* @defaultValue `"noopener noreferrer"`
|
|
293
298
|
*/
|
|
@@ -319,7 +324,8 @@ declare type PrismicPluginComponentsOptions = {
|
|
|
319
324
|
*/
|
|
320
325
|
linkExternalComponent?: string | ConcreteComponent;
|
|
321
326
|
/**
|
|
322
|
-
* An HTML tag name, a component, or a functional component used to render
|
|
327
|
+
* An HTML tag name, a component, or a functional component used to render
|
|
328
|
+
* images.
|
|
323
329
|
*
|
|
324
330
|
* @remarks
|
|
325
331
|
* HTML tag names and components will be rendered using the `img` tag
|
|
@@ -362,13 +368,15 @@ declare type PrismicPluginComponentsOptions = {
|
|
|
362
368
|
declare type PrismicPluginOptionsBase = {
|
|
363
369
|
/**
|
|
364
370
|
* An optional link resolver function used to resolve links to Prismic
|
|
365
|
-
* documents when not using the route resolver parameter with
|
|
371
|
+
* documents when not using the route resolver parameter with
|
|
372
|
+
* `@prismicio/client`.
|
|
366
373
|
*
|
|
367
374
|
* @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
|
|
368
375
|
*/
|
|
369
376
|
linkResolver?: LinkResolverFunction;
|
|
370
377
|
/**
|
|
371
|
-
* An optional HTML serializer to customize the way rich text fields are
|
|
378
|
+
* An optional HTML serializer to customize the way rich text fields are
|
|
379
|
+
* rendered.
|
|
372
380
|
*
|
|
373
381
|
* @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}
|
|
374
382
|
*/
|
|
@@ -491,7 +499,8 @@ declare type PrismicPluginOptionsWithEndpoint = PrismicPluginOptionsBase & {
|
|
|
491
499
|
declare type PrismicPluginOptions = PrismicPluginOptionsWithClient | PrismicPluginOptionsWithEndpoint;
|
|
492
500
|
/**
|
|
493
501
|
* `@prismicio/client` related methods and properties exposed by
|
|
494
|
-
* `@prismicio/vue` plugin and accessible through `this.$prismic` and
|
|
502
|
+
* `@prismicio/vue` plugin and accessible through `this.$prismic` and
|
|
503
|
+
* `usePrismic()`.
|
|
495
504
|
*/
|
|
496
505
|
declare type PrismicPluginClient = {
|
|
497
506
|
/**
|
|
@@ -549,7 +558,8 @@ declare type PrismicPluginHelpers = {
|
|
|
549
558
|
asDate: typeof asDate;
|
|
550
559
|
/**
|
|
551
560
|
* Returns the URL of an Image field with optional image transformations (via
|
|
552
|
-
* Imgix URL parameters). This is `@prismicio/helpers` {@link asImageSrc}
|
|
561
|
+
* Imgix URL parameters). This is `@prismicio/helpers` {@link asImageSrc}
|
|
562
|
+
* function.
|
|
553
563
|
*/
|
|
554
564
|
asImageSrc: typeof asImageSrc;
|
|
555
565
|
/**
|
|
@@ -612,7 +622,8 @@ declare const enum PrismicClientComposableState {
|
|
|
612
622
|
Error = "error"
|
|
613
623
|
}
|
|
614
624
|
/**
|
|
615
|
-
* Type to transform a static object into one that allows passing Refs as
|
|
625
|
+
* Type to transform a static object into one that allows passing Refs as
|
|
626
|
+
* values.
|
|
616
627
|
*
|
|
617
628
|
* @internal
|
|
618
629
|
*/
|
|
@@ -662,7 +673,8 @@ declare type PrismicEmbedProps = {
|
|
|
662
673
|
*/
|
|
663
674
|
field: EmbedField;
|
|
664
675
|
/**
|
|
665
|
-
* An HTML tag name, a component, or a functional component used to wrap the
|
|
676
|
+
* An HTML tag name, a component, or a functional component used to wrap the
|
|
677
|
+
* output.
|
|
666
678
|
*
|
|
667
679
|
* @defaultValue `"div"`
|
|
668
680
|
*/
|
|
@@ -687,7 +699,8 @@ declare type PrismicImageProps = {
|
|
|
687
699
|
*/
|
|
688
700
|
field: ImageField;
|
|
689
701
|
/**
|
|
690
|
-
* An HTML tag name, a component, or a functional component used to render
|
|
702
|
+
* An HTML tag name, a component, or a functional component used to render
|
|
703
|
+
* images.
|
|
691
704
|
*
|
|
692
705
|
* @remarks
|
|
693
706
|
* HTML tag names and components will be rendered using the `img` tag
|
|
@@ -717,7 +730,8 @@ declare type PrismicImageProps = {
|
|
|
717
730
|
*/
|
|
718
731
|
widths?: NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"] | "thumbnails" | "defaults";
|
|
719
732
|
/**
|
|
720
|
-
* Adds an additional `srcset` attribute to the image following giving pixel
|
|
733
|
+
* Adds an additional `srcset` attribute to the image following giving pixel
|
|
734
|
+
* densities.
|
|
721
735
|
*
|
|
722
736
|
* @remarks
|
|
723
737
|
* A special value of `"defaults"` is accepted to automatically use image
|
|
@@ -754,7 +768,8 @@ declare type UsePrismicImageReturnType = {
|
|
|
754
768
|
copyright: ComputedRef<string | null>;
|
|
755
769
|
};
|
|
756
770
|
/**
|
|
757
|
-
* A low level composable that returns a resolved information about a Prismic
|
|
771
|
+
* A low level composable that returns a resolved information about a Prismic
|
|
772
|
+
* image field.
|
|
758
773
|
*
|
|
759
774
|
* @param props - {@link UsePrismicImageOptions}
|
|
760
775
|
*
|
|
@@ -797,7 +812,8 @@ declare type PrismicLinkProps = {
|
|
|
797
812
|
*/
|
|
798
813
|
rel?: string | null;
|
|
799
814
|
/**
|
|
800
|
-
* Value of the `rel` attribute to use on links rendered with
|
|
815
|
+
* Value of the `rel` attribute to use on links rendered with
|
|
816
|
+
* `target="_blank"`.
|
|
801
817
|
*
|
|
802
818
|
* @defaultValue The one provided to `@prismicio/vue` plugin if configured, `"noopener noreferrer"` otherwise.
|
|
803
819
|
*/
|
|
@@ -855,7 +871,8 @@ declare type UsePrismicLinkReturnType = {
|
|
|
855
871
|
rel: ComputedRef<string | null>;
|
|
856
872
|
};
|
|
857
873
|
/**
|
|
858
|
-
* A low level composable that returns resolved information about a Prismic link
|
|
874
|
+
* A low level composable that returns resolved information about a Prismic link
|
|
875
|
+
* field.
|
|
859
876
|
*
|
|
860
877
|
* @param props - {@link UsePrismicLinkOptions}
|
|
861
878
|
*
|
|
@@ -887,7 +904,8 @@ declare type PrismicTextProps = {
|
|
|
887
904
|
*/
|
|
888
905
|
separator?: string;
|
|
889
906
|
/**
|
|
890
|
-
* An HTML tag name, a component, or a functional component used to wrap the
|
|
907
|
+
* An HTML tag name, a component, or a functional component used to wrap the
|
|
908
|
+
* output.
|
|
891
909
|
*
|
|
892
910
|
* @defaultValue `"div"`
|
|
893
911
|
*/
|
|
@@ -912,11 +930,13 @@ declare type UsePrismicTextReturnType = {
|
|
|
912
930
|
text: ComputedRef<string>;
|
|
913
931
|
};
|
|
914
932
|
/**
|
|
915
|
-
* A low level composable that returns a serialized rich text field as plain
|
|
933
|
+
* A low level composable that returns a serialized rich text field as plain
|
|
934
|
+
* text.
|
|
916
935
|
*
|
|
917
936
|
* @param props - {@link UsePrismicTextOptions}
|
|
918
937
|
*
|
|
919
|
-
* @returns - Serialized rich text field as plain text
|
|
938
|
+
* @returns - Serialized rich text field as plain text
|
|
939
|
+
* {@link UsePrismicTextReturnType}
|
|
920
940
|
*/
|
|
921
941
|
declare const usePrismicText: (props: UsePrismicTextOptions) => UsePrismicTextReturnType;
|
|
922
942
|
/**
|
|
@@ -955,7 +975,8 @@ declare type PrismicRichTextProps = {
|
|
|
955
975
|
*/
|
|
956
976
|
htmlSerializer?: HTMLFunctionSerializer | HTMLMapSerializer;
|
|
957
977
|
/**
|
|
958
|
-
* An HTML tag name, a component, or a functional component used to wrap the
|
|
978
|
+
* An HTML tag name, a component, or a functional component used to wrap the
|
|
979
|
+
* output.
|
|
959
980
|
*
|
|
960
981
|
* @defaultValue `"div"`
|
|
961
982
|
*/
|
|
@@ -984,7 +1005,8 @@ declare type UsePrismicRichTextReturnType = {
|
|
|
984
1005
|
*
|
|
985
1006
|
* @param props - {@link UsePrismicRichTextOptions}
|
|
986
1007
|
*
|
|
987
|
-
* @returns - Serialized rich text field as HTML
|
|
1008
|
+
* @returns - Serialized rich text field as HTML
|
|
1009
|
+
* {@link UsePrismicRichTextReturnType}
|
|
988
1010
|
*/
|
|
989
1011
|
declare const usePrismicRichText: (props: UsePrismicRichTextOptions) => UsePrismicRichTextReturnType;
|
|
990
1012
|
/**
|
|
@@ -1007,7 +1029,8 @@ declare type ComposableOnlyParameters = {
|
|
|
1007
1029
|
/**
|
|
1008
1030
|
* The return type of a `@prismicio/client` Vue composable.
|
|
1009
1031
|
*
|
|
1010
|
-
* @typeParam TData - The expected format of the `data` property of the returned
|
|
1032
|
+
* @typeParam TData - The expected format of the `data` property of the returned
|
|
1033
|
+
* object
|
|
1011
1034
|
*/
|
|
1012
1035
|
declare type ClientComposableReturnType<TData = unknown> = {
|
|
1013
1036
|
/**
|
|
@@ -1019,7 +1042,8 @@ declare type ClientComposableReturnType<TData = unknown> = {
|
|
|
1019
1042
|
*/
|
|
1020
1043
|
data: Ref<TData | null>;
|
|
1021
1044
|
/**
|
|
1022
|
-
* Error returned by the composable's client method call if in an errror
|
|
1045
|
+
* Error returned by the composable's client method call if in an errror
|
|
1046
|
+
* state.
|
|
1023
1047
|
*/
|
|
1024
1048
|
error: Ref<ClientError | Error | null>;
|
|
1025
1049
|
/**
|
|
@@ -1032,8 +1056,8 @@ declare type ClientComposableReturnType<TData = unknown> = {
|
|
|
1032
1056
|
* A composable that queries content from the Prismic repository.
|
|
1033
1057
|
*
|
|
1034
1058
|
* @remarks
|
|
1035
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1036
|
-
*
|
|
1059
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1060
|
+
* `params.client`.
|
|
1037
1061
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1038
1062
|
*
|
|
1039
1063
|
* @param params - Parameters to filter, sort, and paginate results
|
|
@@ -1043,15 +1067,15 @@ declare type ClientComposableReturnType<TData = unknown> = {
|
|
|
1043
1067
|
* @see Underlying `@prismicio/client` method {@link Client.get}
|
|
1044
1068
|
*/
|
|
1045
1069
|
declare const usePrismicDocuments: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1046
|
-
signal?:
|
|
1070
|
+
signal?: any;
|
|
1047
1071
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1048
1072
|
/**
|
|
1049
1073
|
* A composable that queries content from the Prismic repository and returns
|
|
1050
1074
|
* only the first result, if any.
|
|
1051
1075
|
*
|
|
1052
1076
|
* @remarks
|
|
1053
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1054
|
-
*
|
|
1077
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1078
|
+
* `params.client`.
|
|
1055
1079
|
* @typeParam TDocument - Type of the Prismic document returned
|
|
1056
1080
|
*
|
|
1057
1081
|
* @param params - Parameters to filter, sort, and paginate results
|
|
@@ -1061,14 +1085,15 @@ declare const usePrismicDocuments: <TDocument extends PrismicDocument<Record<str
|
|
|
1061
1085
|
* @see Underlying `@prismicio/client` method {@link Client.getFirst}
|
|
1062
1086
|
*/
|
|
1063
1087
|
declare const useFirstPrismicDocument: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1064
|
-
signal?:
|
|
1088
|
+
signal?: any;
|
|
1065
1089
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument>;
|
|
1066
1090
|
/**
|
|
1067
|
-
* A composable that queries a document from the Prismic repository with a
|
|
1091
|
+
* A composable that queries a document from the Prismic repository with a
|
|
1092
|
+
* specific ID.
|
|
1068
1093
|
*
|
|
1069
1094
|
* @remarks
|
|
1070
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1071
|
-
*
|
|
1095
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1096
|
+
* `params.client`.
|
|
1072
1097
|
* @typeParam TDocument - Type of the Prismic document returned
|
|
1073
1098
|
*
|
|
1074
1099
|
* @param id - ID of the document
|
|
@@ -1079,14 +1104,15 @@ declare const useFirstPrismicDocument: <TDocument extends PrismicDocument<Record
|
|
|
1079
1104
|
* @see Underlying `@prismicio/client` method {@link Client.getByID}
|
|
1080
1105
|
*/
|
|
1081
1106
|
declare const usePrismicDocumentByID: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(id: string, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1082
|
-
signal?:
|
|
1107
|
+
signal?: any;
|
|
1083
1108
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument>;
|
|
1084
1109
|
/**
|
|
1085
|
-
* A composable that queries documents from the Prismic repository with specific
|
|
1110
|
+
* A composable that queries documents from the Prismic repository with specific
|
|
1111
|
+
* IDs.
|
|
1086
1112
|
*
|
|
1087
1113
|
* @remarks
|
|
1088
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1089
|
-
*
|
|
1114
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1115
|
+
* `params.client`.
|
|
1090
1116
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1091
1117
|
*
|
|
1092
1118
|
* @param ids - A list of document IDs
|
|
@@ -1097,14 +1123,15 @@ declare const usePrismicDocumentByID: <TDocument extends PrismicDocument<Record<
|
|
|
1097
1123
|
* @see Underlying `@prismicio/client` method {@link Client.getByIDs}
|
|
1098
1124
|
*/
|
|
1099
1125
|
declare const usePrismicDocumentsByIDs: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(ids: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1100
|
-
signal?:
|
|
1126
|
+
signal?: any;
|
|
1101
1127
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1102
1128
|
/**
|
|
1103
|
-
* A composable that queries all documents from the Prismic repository with
|
|
1129
|
+
* A composable that queries all documents from the Prismic repository with
|
|
1130
|
+
* specific IDs.
|
|
1104
1131
|
*
|
|
1105
1132
|
* @remarks
|
|
1106
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1107
|
-
*
|
|
1133
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1134
|
+
* `params.client`.
|
|
1108
1135
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1109
1136
|
*
|
|
1110
1137
|
* @param ids - A list of document IDs
|
|
@@ -1117,15 +1144,15 @@ declare const usePrismicDocumentsByIDs: <TDocument extends PrismicDocument<Recor
|
|
|
1117
1144
|
declare const useAllPrismicDocumentsByIDs: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(ids: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1118
1145
|
limit?: number | undefined;
|
|
1119
1146
|
} & {
|
|
1120
|
-
signal?:
|
|
1147
|
+
signal?: any;
|
|
1121
1148
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1122
1149
|
/**
|
|
1123
1150
|
* A composable that queries a document from the Prismic repository with a
|
|
1124
1151
|
* specific UID and Custom Type.
|
|
1125
1152
|
*
|
|
1126
1153
|
* @remarks
|
|
1127
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1128
|
-
*
|
|
1154
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1155
|
+
* `params.client`.
|
|
1129
1156
|
* @typeParam TDocument - Type of the Prismic document returned
|
|
1130
1157
|
*
|
|
1131
1158
|
* @param documentType - The API ID of the document's Custom Type
|
|
@@ -1137,14 +1164,15 @@ declare const useAllPrismicDocumentsByIDs: <TDocument extends PrismicDocument<Re
|
|
|
1137
1164
|
* @see Underlying `@prismicio/client` method {@link Client.getByUID}
|
|
1138
1165
|
*/
|
|
1139
1166
|
declare const usePrismicDocumentByUID: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(documentType: any, uid: string, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1140
|
-
signal?:
|
|
1167
|
+
signal?: any;
|
|
1141
1168
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument>;
|
|
1142
1169
|
/**
|
|
1143
|
-
* A composable that queries documents from the Prismic repository with specific
|
|
1170
|
+
* A composable that queries documents from the Prismic repository with specific
|
|
1171
|
+
* UIDs.
|
|
1144
1172
|
*
|
|
1145
1173
|
* @remarks
|
|
1146
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1147
|
-
*
|
|
1174
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1175
|
+
* `params.client`.
|
|
1148
1176
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1149
1177
|
*
|
|
1150
1178
|
* @param documentType - The API ID of the document's Custom Type
|
|
@@ -1156,14 +1184,15 @@ declare const usePrismicDocumentByUID: <TDocument extends PrismicDocument<Record
|
|
|
1156
1184
|
* @see Underlying `@prismicio/client` method {@link Client.getByIDs}
|
|
1157
1185
|
*/
|
|
1158
1186
|
declare const usePrismicDocumentsByUIDs: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(documentType: any, uids: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1159
|
-
signal?:
|
|
1187
|
+
signal?: any;
|
|
1160
1188
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1161
1189
|
/**
|
|
1162
|
-
* A composable that queries all documents from the Prismic repository with
|
|
1190
|
+
* A composable that queries all documents from the Prismic repository with
|
|
1191
|
+
* specific UIDs.
|
|
1163
1192
|
*
|
|
1164
1193
|
* @remarks
|
|
1165
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1166
|
-
*
|
|
1194
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1195
|
+
* `params.client`.
|
|
1167
1196
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1168
1197
|
*
|
|
1169
1198
|
* @param documentType - The API ID of the document's Custom Type
|
|
@@ -1177,15 +1206,15 @@ declare const usePrismicDocumentsByUIDs: <TDocument extends PrismicDocument<Reco
|
|
|
1177
1206
|
declare const useAllPrismicDocumentsByUIDs: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(documentType: any, ids: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1178
1207
|
limit?: number | undefined;
|
|
1179
1208
|
} & {
|
|
1180
|
-
signal?:
|
|
1209
|
+
signal?: any;
|
|
1181
1210
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1182
1211
|
/**
|
|
1183
1212
|
* A composable that queries a singleton document from the Prismic repository
|
|
1184
1213
|
* for a specific Custom Type.
|
|
1185
1214
|
*
|
|
1186
1215
|
* @remarks
|
|
1187
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1188
|
-
*
|
|
1216
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1217
|
+
* `params.client`.
|
|
1189
1218
|
* @typeParam TDocument - Type of the Prismic document returned
|
|
1190
1219
|
*
|
|
1191
1220
|
* @param documentType - The API ID of the singleton Custom Type
|
|
@@ -1196,15 +1225,15 @@ declare const useAllPrismicDocumentsByUIDs: <TDocument extends PrismicDocument<R
|
|
|
1196
1225
|
* @see Underlying `@prismicio/client` method {@link Client.getSingle}
|
|
1197
1226
|
*/
|
|
1198
1227
|
declare const useSinglePrismicDocument: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(documentType: any, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1199
|
-
signal?:
|
|
1228
|
+
signal?: any;
|
|
1200
1229
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument>;
|
|
1201
1230
|
/**
|
|
1202
1231
|
* A composable that queries documents from the Prismic repository for a
|
|
1203
1232
|
* specific Custom Type.
|
|
1204
1233
|
*
|
|
1205
1234
|
* @remarks
|
|
1206
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1207
|
-
*
|
|
1235
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1236
|
+
* `params.client`.
|
|
1208
1237
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1209
1238
|
*
|
|
1210
1239
|
* @param documentType - The API ID of the Custom Type
|
|
@@ -1215,15 +1244,15 @@ declare const useSinglePrismicDocument: <TDocument extends PrismicDocument<Recor
|
|
|
1215
1244
|
* @see Underlying `@prismicio/client` method {@link Client.getByType}
|
|
1216
1245
|
*/
|
|
1217
1246
|
declare const usePrismicDocumentsByType: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(documentType: any, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1218
|
-
signal?:
|
|
1247
|
+
signal?: any;
|
|
1219
1248
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1220
1249
|
/**
|
|
1221
1250
|
* A composable that queries all documents from the Prismic repository for a
|
|
1222
1251
|
* specific Custom Type.
|
|
1223
1252
|
*
|
|
1224
1253
|
* @remarks
|
|
1225
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1226
|
-
*
|
|
1254
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1255
|
+
* `params.client`.
|
|
1227
1256
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1228
1257
|
*
|
|
1229
1258
|
* @param documentType - The API ID of the Custom Type
|
|
@@ -1236,14 +1265,15 @@ declare const usePrismicDocumentsByType: <TDocument extends PrismicDocument<Reco
|
|
|
1236
1265
|
declare const useAllPrismicDocumentsByType: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(documentType: any, params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & {
|
|
1237
1266
|
limit?: number | undefined;
|
|
1238
1267
|
} & {
|
|
1239
|
-
signal?:
|
|
1268
|
+
signal?: any;
|
|
1240
1269
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1241
1270
|
/**
|
|
1242
|
-
* A composable that queries documents from the Prismic repository with a
|
|
1271
|
+
* A composable that queries documents from the Prismic repository with a
|
|
1272
|
+
* specific tag.
|
|
1243
1273
|
*
|
|
1244
1274
|
* @remarks
|
|
1245
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1246
|
-
*
|
|
1275
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1276
|
+
* `params.client`.
|
|
1247
1277
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1248
1278
|
*
|
|
1249
1279
|
* @param tag - The tag that must be included on a document
|
|
@@ -1254,15 +1284,15 @@ declare const useAllPrismicDocumentsByType: <TDocument extends PrismicDocument<R
|
|
|
1254
1284
|
* @see Underlying `@prismicio/client` method {@link Client.getByTag}
|
|
1255
1285
|
*/
|
|
1256
1286
|
declare const usePrismicDocumentsByTag: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(tag: string, params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1257
|
-
signal?:
|
|
1287
|
+
signal?: any;
|
|
1258
1288
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1259
1289
|
/**
|
|
1260
1290
|
* A composable that queries all documents from the Prismic repository with a
|
|
1261
1291
|
* specific tag.
|
|
1262
1292
|
*
|
|
1263
1293
|
* @remarks
|
|
1264
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1265
|
-
*
|
|
1294
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1295
|
+
* `params.client`.
|
|
1266
1296
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1267
1297
|
*
|
|
1268
1298
|
* @param tag - The tag that must be included on a document
|
|
@@ -1275,15 +1305,15 @@ declare const usePrismicDocumentsByTag: <TDocument extends PrismicDocument<Recor
|
|
|
1275
1305
|
declare const useAllPrismicDocumentsByTag: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(tag: string, params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & {
|
|
1276
1306
|
limit?: number | undefined;
|
|
1277
1307
|
} & {
|
|
1278
|
-
signal?:
|
|
1308
|
+
signal?: any;
|
|
1279
1309
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1280
1310
|
/**
|
|
1281
1311
|
* A composable that queries documents from the Prismic repository with specific
|
|
1282
1312
|
* tags. A document must be tagged with all of the queried tags to be included.
|
|
1283
1313
|
*
|
|
1284
1314
|
* @remarks
|
|
1285
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1286
|
-
*
|
|
1315
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1316
|
+
* `params.client`.
|
|
1287
1317
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1288
1318
|
*
|
|
1289
1319
|
* @param tags - A list of tags that must be included on a document
|
|
@@ -1294,15 +1324,16 @@ declare const useAllPrismicDocumentsByTag: <TDocument extends PrismicDocument<Re
|
|
|
1294
1324
|
* @see Underlying `@prismicio/client` method {@link Client.getByTags}
|
|
1295
1325
|
*/
|
|
1296
1326
|
declare const usePrismicDocumentsByEveryTag: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(tags: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1297
|
-
signal?:
|
|
1327
|
+
signal?: any;
|
|
1298
1328
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1299
1329
|
/**
|
|
1300
1330
|
* A composable that queries all documents from the Prismic repository with
|
|
1301
|
-
* specific tags. A document must be tagged with all of the queried tags to be
|
|
1331
|
+
* specific tags. A document must be tagged with all of the queried tags to be
|
|
1332
|
+
* included.
|
|
1302
1333
|
*
|
|
1303
1334
|
* @remarks
|
|
1304
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1305
|
-
*
|
|
1335
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1336
|
+
* `params.client`.
|
|
1306
1337
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1307
1338
|
*
|
|
1308
1339
|
* @param tags - A list of tags that must be included on a document
|
|
@@ -1315,15 +1346,16 @@ declare const usePrismicDocumentsByEveryTag: <TDocument extends PrismicDocument<
|
|
|
1315
1346
|
declare const useAllPrismicDocumentsByEveryTag: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(tags: string[], params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & {
|
|
1316
1347
|
limit?: number | undefined;
|
|
1317
1348
|
} & {
|
|
1318
|
-
signal?:
|
|
1349
|
+
signal?: any;
|
|
1319
1350
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1320
1351
|
/**
|
|
1321
1352
|
* A composable that queries documents from the Prismic repository with specific
|
|
1322
|
-
* tags. A document must be tagged with at least one of the queried tags to be
|
|
1353
|
+
* tags. A document must be tagged with at least one of the queried tags to be
|
|
1354
|
+
* included.
|
|
1323
1355
|
*
|
|
1324
1356
|
* @remarks
|
|
1325
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1326
|
-
*
|
|
1357
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1358
|
+
* `params.client`.
|
|
1327
1359
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1328
1360
|
*
|
|
1329
1361
|
* @param tags - A list of tags that must be included on a document
|
|
@@ -1334,7 +1366,7 @@ declare const useAllPrismicDocumentsByEveryTag: <TDocument extends PrismicDocume
|
|
|
1334
1366
|
* @see Underlying `@prismicio/client` method {@link Client.getByTags}
|
|
1335
1367
|
*/
|
|
1336
1368
|
declare const usePrismicDocumentsBySomeTags: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(tags: string[], params?: (Partial<_prismicio_client.BuildQueryURLArgs> & {
|
|
1337
|
-
signal?:
|
|
1369
|
+
signal?: any;
|
|
1338
1370
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<Query<TDocument>>;
|
|
1339
1371
|
/**
|
|
1340
1372
|
* A composable that queries all documents from the Prismic repository with
|
|
@@ -1342,8 +1374,8 @@ declare const usePrismicDocumentsBySomeTags: <TDocument extends PrismicDocument<
|
|
|
1342
1374
|
* tags to be included.
|
|
1343
1375
|
*
|
|
1344
1376
|
* @remarks
|
|
1345
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1346
|
-
*
|
|
1377
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1378
|
+
* `params.client`.
|
|
1347
1379
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1348
1380
|
*
|
|
1349
1381
|
* @param tags - A list of tags that must be included on a document
|
|
@@ -1356,19 +1388,21 @@ declare const usePrismicDocumentsBySomeTags: <TDocument extends PrismicDocument<
|
|
|
1356
1388
|
declare const useAllPrismicDocumentsBySomeTags: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(tags: string[], params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & {
|
|
1357
1389
|
limit?: number | undefined;
|
|
1358
1390
|
} & {
|
|
1359
|
-
signal?:
|
|
1391
|
+
signal?: any;
|
|
1360
1392
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1361
1393
|
/**
|
|
1362
1394
|
* **IMPORTANT**: Avoid using `dangerouslyUseAllPrismicDocuments` as it may be
|
|
1363
1395
|
* slower and require more resources than other composables. Prefer using other
|
|
1364
|
-
* composables that filter by predicates such as
|
|
1396
|
+
* composables that filter by predicates such as
|
|
1397
|
+
* `useAllPrismicDocumentsByType`.
|
|
1365
1398
|
*
|
|
1366
1399
|
* A composable that queries content from the Prismic repository and returns all
|
|
1367
|
-
* matching content. If no predicates are provided, all documents will be
|
|
1400
|
+
* matching content. If no predicates are provided, all documents will be
|
|
1401
|
+
* fetched.
|
|
1368
1402
|
*
|
|
1369
1403
|
* @remarks
|
|
1370
|
-
* An additional `@prismicio/client` instance can be provided at
|
|
1371
|
-
*
|
|
1404
|
+
* An additional `@prismicio/client` instance can be provided at
|
|
1405
|
+
* `params.client`.
|
|
1372
1406
|
* @typeParam TDocument - Type of Prismic documents returned
|
|
1373
1407
|
*
|
|
1374
1408
|
* @param params - Parameters to filter and sort results
|
|
@@ -1380,11 +1414,12 @@ declare const useAllPrismicDocumentsBySomeTags: <TDocument extends PrismicDocume
|
|
|
1380
1414
|
declare const dangerouslyUseAllPrismicDocuments: <TDocument extends PrismicDocument<Record<string, any>, string, string>>(params?: (Partial<Omit<_prismicio_client.BuildQueryURLArgs, "page">> & {
|
|
1381
1415
|
limit?: number | undefined;
|
|
1382
1416
|
} & {
|
|
1383
|
-
signal?:
|
|
1417
|
+
signal?: any;
|
|
1384
1418
|
} & ComposableOnlyParameters) | undefined) => ClientComposableReturnType<TDocument[]>;
|
|
1385
1419
|
|
|
1386
1420
|
/**
|
|
1387
|
-
* `@prismicio/vue` plugin interface interface location used for
|
|
1421
|
+
* `@prismicio/vue` plugin interface interface location used for
|
|
1422
|
+
* {@link usePrismic}.
|
|
1388
1423
|
*
|
|
1389
1424
|
* @internal
|
|
1390
1425
|
*/
|