@prismicio/vue 4.1.0 → 4.2.0

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.
@@ -1,190 +1,190 @@
1
- import { LinkField, LinkResolverFunction, PrismicDocument } from "@prismicio/client";
2
- import { AllowedComponentProps, ComponentCustomProps, ComputedRef, ConcreteComponent, DefineComponent, PropType, Raw, VNodeProps } from "vue";
3
- import { VueUseOptions } from "../types";
4
- /**
5
- * Props for `<PrismicLink />`.
6
- */
7
- export type PrismicLinkProps = {
8
- /**
9
- * The Prismic link field or document to render.
10
- */
11
- field: LinkField | PrismicDocument;
12
- /**
13
- * A link resolver function used to resolve links when not using the route
14
- * resolver parameter with `@prismicio/client`.
15
- *
16
- * @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.
17
- *
18
- * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
19
- */
20
- linkResolver?: LinkResolverFunction;
21
- /**
22
- * An explicit `target` attribute to apply to the rendered link.
23
- */
24
- target?: string | null;
25
- /**
26
- * An explicit `rel` attribute to apply to the rendered link.
27
- */
28
- rel?: string | null;
29
- /**
30
- * Value of the `rel` attribute to use on links rendered with
31
- * `target="_blank"`.
32
- *
33
- * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `"noopener noreferrer"` otherwise.
34
- */
35
- blankTargetRelAttribute?: string | null;
36
- /**
37
- * An HTML tag name, a component, or a functional component used to render
38
- * internal links.
39
- *
40
- * @remarks
41
- * HTML tag names will be rendered using the anchor tag interface (`href`,
42
- * `target`, and `rel` attributes).
43
- * @remarks
44
- * Components will be rendered using Vue Router {@link RouterLink} interface
45
- * (`to` props).
46
- * @defaultValue The one provided to `@prismicio/vue` plugin if configured, {@link RouterLink} otherwise.
47
- */
48
- internalComponent?: string | ConcreteComponent | Raw<DefineComponent>;
49
- /**
50
- * An HTML tag name, a component, or a functional component used to render
51
- * external links.
52
- *
53
- * @remarks
54
- * HTML tag names will be rendered using the anchor tag interface (`href`,
55
- * `target`, and `rel` attributes).
56
- * @remarks
57
- * Components will be rendered using Vue Router {@link RouterLink} interface
58
- * (`to` props).
59
- * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `"a"` otherwise.
60
- */
61
- externalComponent?: string | ConcreteComponent | Raw<DefineComponent>;
62
- };
63
- /**
64
- * Options for {@link usePrismicLink}.
65
- */
66
- export type UsePrismicLinkOptions = VueUseOptions<PrismicLinkProps>;
67
- /**
68
- * Return type of {@link usePrismicLink}.
69
- */
70
- export type UsePrismicLinkReturnType = {
71
- /**
72
- * Suggested component to render for provided link field.
73
- */
74
- type: ComputedRef<string | ConcreteComponent | Raw<DefineComponent>>;
75
- /**
76
- * Resolved anchor `href` value.
77
- */
78
- href: ComputedRef<string>;
79
- /**
80
- * Resolved anchor `target` value.
81
- */
82
- target: ComputedRef<string | null>;
83
- /**
84
- * Resolved anchor `rel` value.
85
- */
86
- rel: ComputedRef<string | null>;
87
- };
88
- /**
89
- * A low level composable that returns resolved information about a Prismic link
90
- * field.
91
- *
92
- * @param props - {@link UsePrismicLinkOptions}
93
- *
94
- * @returns - Resolved link information {@link UsePrismicLinkReturnType}
95
- */
96
- export declare const usePrismicLink: (props: UsePrismicLinkOptions) => UsePrismicLinkReturnType;
97
- /**
98
- * `<PrismicLink />` implementation.
99
- *
100
- * @internal
101
- */
102
- export declare const PrismicLinkImpl: DefineComponent<{
103
- field: {
104
- type: PropType<PrismicDocument<Record<string, any>, string, string> | LinkField>;
105
- required: true;
106
- };
107
- linkResolver: {
108
- type: PropType<LinkResolverFunction>;
109
- default: undefined;
110
- required: false;
111
- };
112
- target: {
113
- type: PropType<string | null>;
114
- default: undefined;
115
- required: false;
116
- };
117
- rel: {
118
- type: PropType<string | null>;
119
- default: undefined;
120
- required: false;
121
- };
122
- blankTargetRelAttribute: {
123
- type: PropType<string | null>;
124
- default: undefined;
125
- required: false;
126
- };
127
- internalComponent: {
128
- type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
129
- default: undefined;
130
- required: false;
131
- };
132
- externalComponent: {
133
- type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
134
- default: undefined;
135
- required: false;
136
- };
137
- }, (() => null) | (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
138
- [key: string]: any;
139
- }>), unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
140
- field: {
141
- type: PropType<PrismicDocument<Record<string, any>, string, string> | LinkField>;
142
- required: true;
143
- };
144
- linkResolver: {
145
- type: PropType<LinkResolverFunction>;
146
- default: undefined;
147
- required: false;
148
- };
149
- target: {
150
- type: PropType<string | null>;
151
- default: undefined;
152
- required: false;
153
- };
154
- rel: {
155
- type: PropType<string | null>;
156
- default: undefined;
157
- required: false;
158
- };
159
- blankTargetRelAttribute: {
160
- type: PropType<string | null>;
161
- default: undefined;
162
- required: false;
163
- };
164
- internalComponent: {
165
- type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
166
- default: undefined;
167
- required: false;
168
- };
169
- externalComponent: {
170
- type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
171
- default: undefined;
172
- required: false;
173
- };
174
- }>>, {
175
- target: string | null;
176
- linkResolver: LinkResolverFunction;
177
- rel: string | null;
178
- blankTargetRelAttribute: string | null;
179
- internalComponent: string | ConcreteComponent | Raw<DefineComponent>;
180
- externalComponent: string | ConcreteComponent | Raw<DefineComponent>;
181
- }, {}>;
182
- /**
183
- * Component to render a Prismic link field.
184
- *
185
- * @see Component props {@link PrismicLinkProps}
186
- * @see Templating link fields {@link https://prismic.io/docs/technologies/vue-template-content#links-and-content-relationships}
187
- */
188
- export declare const PrismicLink: new () => {
189
- $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicLinkProps;
190
- };
1
+ import { LinkField, LinkResolverFunction, PrismicDocument } from "@prismicio/client";
2
+ import { AllowedComponentProps, ComponentCustomProps, ComputedRef, ConcreteComponent, DefineComponent, PropType, Raw, VNodeProps } from "vue";
3
+ import { VueUseOptions } from "../types";
4
+ /**
5
+ * Props for `<PrismicLink />`.
6
+ */
7
+ export declare type PrismicLinkProps = {
8
+ /**
9
+ * The Prismic link field or document to render.
10
+ */
11
+ field: LinkField | PrismicDocument;
12
+ /**
13
+ * A link resolver function used to resolve links when not using the route
14
+ * resolver parameter with `@prismicio/client`.
15
+ *
16
+ * @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.
17
+ *
18
+ * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
19
+ */
20
+ linkResolver?: LinkResolverFunction;
21
+ /**
22
+ * An explicit `target` attribute to apply to the rendered link.
23
+ */
24
+ target?: string | null;
25
+ /**
26
+ * An explicit `rel` attribute to apply to the rendered link.
27
+ */
28
+ rel?: string | null;
29
+ /**
30
+ * Value of the `rel` attribute to use on links rendered with
31
+ * `target="_blank"`.
32
+ *
33
+ * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `"noopener noreferrer"` otherwise.
34
+ */
35
+ blankTargetRelAttribute?: string | null;
36
+ /**
37
+ * An HTML tag name, a component, or a functional component used to render
38
+ * internal links.
39
+ *
40
+ * @remarks
41
+ * HTML tag names will be rendered using the anchor tag interface (`href`,
42
+ * `target`, and `rel` attributes).
43
+ * @remarks
44
+ * Components will be rendered using Vue Router {@link RouterLink} interface
45
+ * (`to` props).
46
+ * @defaultValue The one provided to `@prismicio/vue` plugin if configured, {@link RouterLink} otherwise.
47
+ */
48
+ internalComponent?: string | ConcreteComponent | Raw<DefineComponent>;
49
+ /**
50
+ * An HTML tag name, a component, or a functional component used to render
51
+ * external links.
52
+ *
53
+ * @remarks
54
+ * HTML tag names will be rendered using the anchor tag interface (`href`,
55
+ * `target`, and `rel` attributes).
56
+ * @remarks
57
+ * Components will be rendered using Vue Router {@link RouterLink} interface
58
+ * (`to` props).
59
+ * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `"a"` otherwise.
60
+ */
61
+ externalComponent?: string | ConcreteComponent | Raw<DefineComponent>;
62
+ };
63
+ /**
64
+ * Options for {@link usePrismicLink}.
65
+ */
66
+ export declare type UsePrismicLinkOptions = VueUseOptions<PrismicLinkProps>;
67
+ /**
68
+ * Return type of {@link usePrismicLink}.
69
+ */
70
+ export declare type UsePrismicLinkReturnType = {
71
+ /**
72
+ * Suggested component to render for provided link field.
73
+ */
74
+ type: ComputedRef<string | ConcreteComponent | Raw<DefineComponent>>;
75
+ /**
76
+ * Resolved anchor `href` value.
77
+ */
78
+ href: ComputedRef<string>;
79
+ /**
80
+ * Resolved anchor `target` value.
81
+ */
82
+ target: ComputedRef<string | null>;
83
+ /**
84
+ * Resolved anchor `rel` value.
85
+ */
86
+ rel: ComputedRef<string | null>;
87
+ };
88
+ /**
89
+ * A low level composable that returns resolved information about a Prismic link
90
+ * field.
91
+ *
92
+ * @param props - {@link UsePrismicLinkOptions}
93
+ *
94
+ * @returns - Resolved link information {@link UsePrismicLinkReturnType}
95
+ */
96
+ export declare const usePrismicLink: (props: UsePrismicLinkOptions) => UsePrismicLinkReturnType;
97
+ /**
98
+ * `<PrismicLink />` implementation.
99
+ *
100
+ * @internal
101
+ */
102
+ export declare const PrismicLinkImpl: DefineComponent<{
103
+ field: {
104
+ type: PropType<PrismicDocument<Record<string, any>, string, string> | import("@prismicio/client").FilledContentRelationshipField<string, string, unknown> | import("@prismicio/client").EmptyLinkField<"Any"> | import("@prismicio/client").FilledLinkToWebField | import("@prismicio/client").FilledLinkToMediaField>;
105
+ required: true;
106
+ };
107
+ linkResolver: {
108
+ type: PropType<LinkResolverFunction<string | null | undefined>>;
109
+ default: undefined;
110
+ required: false;
111
+ };
112
+ target: {
113
+ type: PropType<string | null>;
114
+ default: undefined;
115
+ required: false;
116
+ };
117
+ rel: {
118
+ type: PropType<string | null>;
119
+ default: undefined;
120
+ required: false;
121
+ };
122
+ blankTargetRelAttribute: {
123
+ type: PropType<string | null>;
124
+ default: undefined;
125
+ required: false;
126
+ };
127
+ internalComponent: {
128
+ type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>>;
129
+ default: undefined;
130
+ required: false;
131
+ };
132
+ externalComponent: {
133
+ type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>>;
134
+ default: undefined;
135
+ required: false;
136
+ };
137
+ }, (() => null) | (() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
138
+ [key: string]: any;
139
+ }>), unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
140
+ field: {
141
+ type: PropType<PrismicDocument<Record<string, any>, string, string> | import("@prismicio/client").FilledContentRelationshipField<string, string, unknown> | import("@prismicio/client").EmptyLinkField<"Any"> | import("@prismicio/client").FilledLinkToWebField | import("@prismicio/client").FilledLinkToMediaField>;
142
+ required: true;
143
+ };
144
+ linkResolver: {
145
+ type: PropType<LinkResolverFunction<string | null | undefined>>;
146
+ default: undefined;
147
+ required: false;
148
+ };
149
+ target: {
150
+ type: PropType<string | null>;
151
+ default: undefined;
152
+ required: false;
153
+ };
154
+ rel: {
155
+ type: PropType<string | null>;
156
+ default: undefined;
157
+ required: false;
158
+ };
159
+ blankTargetRelAttribute: {
160
+ type: PropType<string | null>;
161
+ default: undefined;
162
+ required: false;
163
+ };
164
+ internalComponent: {
165
+ type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>>;
166
+ default: undefined;
167
+ required: false;
168
+ };
169
+ externalComponent: {
170
+ type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>>;
171
+ default: undefined;
172
+ required: false;
173
+ };
174
+ }>>, {
175
+ target: string | null;
176
+ linkResolver: LinkResolverFunction<string | null | undefined>;
177
+ rel: string | null;
178
+ blankTargetRelAttribute: string | null;
179
+ internalComponent: string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>;
180
+ externalComponent: string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>;
181
+ }, {}>;
182
+ /**
183
+ * Component to render a Prismic link field.
184
+ *
185
+ * @see Component props {@link PrismicLinkProps}
186
+ * @see Templating link fields {@link https://prismic.io/docs/technologies/vue-template-content#links-and-content-relationships}
187
+ */
188
+ export declare const PrismicLink: new () => {
189
+ $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicLinkProps;
190
+ };