@vuepress/client 2.0.0-rc.1 → 2.0.0-rc.10
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/app.d.ts +1 -1
- package/dist/app.js +85 -120
- package/dist/chunk-GA5RAHE7.js +432 -0
- package/dist/index.d.ts +347 -203
- package/dist/index.js +25 -29
- package/dist/{setupDevtools-X4YFRK4B.js → setupDevtools-H6KAGBNI.js} +16 -16
- package/package.json +6 -10
- package/dist/chunk-PEQEPZ75.js +0 -339
- /package/dist/{createVueAppFunction-YNGNKfE3.d.ts → createVueAppFunction-onJTVJru.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,198 +1,74 @@
|
|
|
1
|
-
import { PageData, PageFrontmatter, HeadConfig, SiteData } from '@vuepress/shared';
|
|
2
|
-
export { PageData, PageFrontmatter, PageHeader, SiteData } from '@vuepress/shared';
|
|
3
1
|
import * as vue from 'vue';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
2
|
+
import { Component, ComputedRef, Ref, App, VNode, SlotsType, InjectionKey } from 'vue';
|
|
3
|
+
import { PageData, HeadConfig, PageFrontmatter, SiteData, SiteLocaleData } from '@vuepress/shared';
|
|
4
|
+
export { HeadConfig, PageData, PageFrontmatter, PageHeader, SiteData, SiteLocaleData } from '@vuepress/shared';
|
|
5
|
+
import { Router } from 'vue-router';
|
|
6
|
+
export { RouteLocationNormalizedLoaded, Router, useRoute, useRouter } from 'vue-router';
|
|
7
|
+
export { C as CreateVueAppFunction } from './createVueAppFunction-onJTVJru.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
+
* Name of the default layout
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Injection key for layouts
|
|
14
|
-
*/
|
|
15
|
-
declare const layoutsSymbol: InjectionKey<LayoutsRef>;
|
|
16
|
-
/**
|
|
17
|
-
* Returns layouts component map
|
|
18
|
-
*/
|
|
19
|
-
declare const useLayouts: () => LayoutsRef;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Ref wrapper of `PageData`
|
|
23
|
-
*/
|
|
24
|
-
type PageDataRef<T extends Record<any, any> = Record<never, never>> = Ref<PageData<T>>;
|
|
12
|
+
declare const LAYOUT_NAME_DEFAULT = "Layout";
|
|
25
13
|
/**
|
|
26
|
-
*
|
|
14
|
+
* Name of the 404 page layout
|
|
27
15
|
*/
|
|
28
|
-
declare const
|
|
29
|
-
/**
|
|
30
|
-
* Empty page data to be used as the fallback value
|
|
31
|
-
*/
|
|
32
|
-
declare const pageDataEmpty: PageData;
|
|
33
|
-
/**
|
|
34
|
-
* Returns the ref of the data of current page
|
|
35
|
-
*/
|
|
36
|
-
declare const usePageData: <T extends Record<any, any> = Record<never, never>>() => PageDataRef<T>;
|
|
16
|
+
declare const LAYOUT_NAME_NOT_FOUND = "NotFound";
|
|
37
17
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
declare const usePageFrontmatter: <T extends Record<any, any> = Record<string, unknown>>() => PageFrontmatterRef<T>;
|
|
18
|
+
interface PageChunk {
|
|
19
|
+
comp: Component;
|
|
20
|
+
data: PageData;
|
|
21
|
+
}
|
|
22
|
+
type RouteMeta = Record<string, unknown>;
|
|
23
|
+
interface Route<T extends RouteMeta = RouteMeta> {
|
|
24
|
+
loader: () => Promise<PageChunk>;
|
|
25
|
+
meta: T;
|
|
26
|
+
}
|
|
27
|
+
type Redirects = Record<string, string>;
|
|
28
|
+
type Routes = Record<string, Route>;
|
|
50
29
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
30
|
+
interface Layouts {
|
|
31
|
+
[LAYOUT_NAME_DEFAULT]: Component;
|
|
32
|
+
[LAYOUT_NAME_NOT_FOUND]: Component;
|
|
33
|
+
[key: string]: Component;
|
|
34
|
+
}
|
|
35
|
+
type PageComponent = Component;
|
|
54
36
|
type PageHead = HeadConfig[];
|
|
55
|
-
/**
|
|
56
|
-
* Ref wrapper of `PageHead`
|
|
57
|
-
*/
|
|
58
|
-
type PageHeadRef = ComputedRef<PageHead>;
|
|
59
|
-
/**
|
|
60
|
-
* Injection key for page head
|
|
61
|
-
*/
|
|
62
|
-
declare const pageHeadSymbol: InjectionKey<PageHeadRef>;
|
|
63
|
-
/**
|
|
64
|
-
* Returns the ref of the head config of current page
|
|
65
|
-
*/
|
|
66
|
-
declare const usePageHead: () => PageHeadRef;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Page head title, which would be used as the content of `head > title` tag
|
|
70
|
-
*/
|
|
71
37
|
type PageHeadTitle = string;
|
|
72
|
-
/**
|
|
73
|
-
* Ref wrapper of `PageHeadTitle`
|
|
74
|
-
*/
|
|
75
|
-
type PageHeadTitleRef = ComputedRef<PageHeadTitle>;
|
|
76
|
-
/**
|
|
77
|
-
* Injection key for page head title
|
|
78
|
-
*/
|
|
79
|
-
declare const pageHeadTitleSymbol: InjectionKey<PageHeadTitleRef>;
|
|
80
|
-
/**
|
|
81
|
-
* Returns the ref of the head title of current page
|
|
82
|
-
*/
|
|
83
|
-
declare const usePageHeadTitle: () => PageHeadTitleRef;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Page language
|
|
87
|
-
*/
|
|
88
38
|
type PageLang = string;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
*/
|
|
92
|
-
type PageLangRef = ComputedRef<PageLang>;
|
|
93
|
-
/**
|
|
94
|
-
* Injection key for page language
|
|
95
|
-
*/
|
|
96
|
-
declare const pageLangSymbol: InjectionKey<PageLangRef>;
|
|
97
|
-
/**
|
|
98
|
-
* Returns the ref of the language of current page
|
|
99
|
-
*/
|
|
100
|
-
declare const usePageLang: () => PageLangRef;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Ref wrapper of `PageLayout`
|
|
104
|
-
*/
|
|
105
|
-
type PageLayoutRef = ComputedRef<Component>;
|
|
106
|
-
/**
|
|
107
|
-
* Injection key for page layout
|
|
108
|
-
*/
|
|
109
|
-
declare const pageLayoutSymbol: InjectionKey<PageLayoutRef>;
|
|
110
|
-
/**
|
|
111
|
-
* Returns layout component of current page
|
|
112
|
-
*/
|
|
113
|
-
declare const usePageLayout: () => ComputedRef<Component>;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Data resolvers of all pages
|
|
117
|
-
*
|
|
118
|
-
* The key is page key, and the value is an async function that
|
|
119
|
-
* returns the page data
|
|
120
|
-
*/
|
|
121
|
-
type PagesData = Record<string, (() => Promise<PageData>) | undefined>;
|
|
122
|
-
/**
|
|
123
|
-
* Ref wrapper of `PagesData`
|
|
124
|
-
*/
|
|
125
|
-
type PagesDataRef = Ref<PagesData>;
|
|
126
|
-
/**
|
|
127
|
-
* Global pages data ref
|
|
128
|
-
*/
|
|
129
|
-
declare const pagesData: PagesDataRef;
|
|
130
|
-
/**
|
|
131
|
-
* Returns the ref of data resolvers of all pages
|
|
132
|
-
*/
|
|
133
|
-
declare const usePagesData: () => PagesDataRef;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Route locale path
|
|
137
|
-
*/
|
|
39
|
+
type PageLayout = Component;
|
|
40
|
+
type RoutePath = string;
|
|
138
41
|
type RouteLocale = string;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
type
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Ref wrapper of `SiteData`
|
|
154
|
-
*/
|
|
42
|
+
type LayoutsRef = ComputedRef<Layouts>;
|
|
43
|
+
type PageComponentRef = ComputedRef<PageComponent>;
|
|
44
|
+
type PageDataRef<T extends Record<any, any> = Record<never, never>> = ComputedRef<PageData<T>>;
|
|
45
|
+
type PageFrontmatterRef<T extends Record<any, any> = Record<never, never>> = ComputedRef<PageFrontmatter<T>>;
|
|
46
|
+
type PageHeadRef = ComputedRef<PageHead>;
|
|
47
|
+
type PageHeadTitleRef = ComputedRef<PageHeadTitle>;
|
|
48
|
+
type PageLangRef = ComputedRef<PageLang>;
|
|
49
|
+
type PageLayoutRef = ComputedRef<PageLayout>;
|
|
50
|
+
type RedirectsRef = Ref<Redirects>;
|
|
51
|
+
type RoutePathRef = ComputedRef<RoutePath>;
|
|
52
|
+
type RouteLocaleRef = ComputedRef<RouteLocale>;
|
|
53
|
+
type RoutesRef = Ref<Routes>;
|
|
155
54
|
type SiteDataRef = Ref<SiteData>;
|
|
156
|
-
/**
|
|
157
|
-
* Global site data ref
|
|
158
|
-
*/
|
|
159
|
-
declare const siteData: SiteDataRef;
|
|
160
|
-
/**
|
|
161
|
-
* Returns the ref of the site data
|
|
162
|
-
*/
|
|
163
|
-
declare const useSiteData: () => SiteDataRef;
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Site data of current locale
|
|
167
|
-
*/
|
|
168
|
-
type SiteLocaleData = SiteData;
|
|
169
|
-
/**
|
|
170
|
-
* Ref wrapper of `SiteLocaleData`
|
|
171
|
-
*/
|
|
172
55
|
type SiteLocaleDataRef = ComputedRef<SiteLocaleData>;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
declare const updateHeadSymbol: InjectionKey<UpdateHead>;
|
|
190
|
-
/**
|
|
191
|
-
* Returns the `updateHead` util
|
|
192
|
-
*/
|
|
193
|
-
declare const useUpdateHead: () => UpdateHead;
|
|
194
|
-
|
|
195
|
-
type Layouts = Record<string, Component>;
|
|
56
|
+
interface ClientData {
|
|
57
|
+
layouts: LayoutsRef;
|
|
58
|
+
pageComponent: PageComponentRef;
|
|
59
|
+
pageData: PageDataRef;
|
|
60
|
+
pageFrontmatter: PageFrontmatterRef;
|
|
61
|
+
pageHead: PageHeadRef;
|
|
62
|
+
pageHeadTitle: PageHeadTitleRef;
|
|
63
|
+
pageLang: PageLangRef;
|
|
64
|
+
pageLayout: PageLayoutRef;
|
|
65
|
+
redirects: RedirectsRef;
|
|
66
|
+
routePath: RoutePathRef;
|
|
67
|
+
routeLocale: RouteLocaleRef;
|
|
68
|
+
routes: RoutesRef;
|
|
69
|
+
siteData: SiteDataRef;
|
|
70
|
+
siteLocaleData: SiteLocaleDataRef;
|
|
71
|
+
}
|
|
196
72
|
|
|
197
73
|
/**
|
|
198
74
|
* Configure vuepress client
|
|
@@ -214,20 +90,160 @@ interface ClientConfig {
|
|
|
214
90
|
/**
|
|
215
91
|
* Layout components
|
|
216
92
|
*/
|
|
217
|
-
layouts?: Layouts
|
|
93
|
+
layouts?: Partial<Layouts>;
|
|
218
94
|
/**
|
|
219
95
|
* Components to be placed directly into the root node of vue app
|
|
220
96
|
*/
|
|
221
97
|
rootComponents?: Component[];
|
|
222
98
|
}
|
|
223
99
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
100
|
+
interface AutoLinkProps {
|
|
101
|
+
/**
|
|
102
|
+
* Pattern to determine if the link should be active, which has higher priority than `exact`
|
|
103
|
+
*/
|
|
104
|
+
activeMatch?: string | RegExp;
|
|
105
|
+
/**
|
|
106
|
+
* The `aria-label` attribute
|
|
107
|
+
*/
|
|
108
|
+
ariaLabel?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Whether the link should be active only if the url is an exact match
|
|
111
|
+
*/
|
|
112
|
+
exact?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* URL of the auto link
|
|
115
|
+
*/
|
|
116
|
+
link: string;
|
|
117
|
+
/**
|
|
118
|
+
* The `rel` attribute
|
|
119
|
+
*/
|
|
120
|
+
rel?: string;
|
|
121
|
+
/**
|
|
122
|
+
* The `target` attribute
|
|
123
|
+
*/
|
|
124
|
+
target?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Text of the auto link
|
|
127
|
+
*/
|
|
128
|
+
text: string;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Component to render a link automatically according to the link type
|
|
132
|
+
*
|
|
133
|
+
* - If the link is internal, it will be rendered as a `<RouteLink>`
|
|
134
|
+
* - If the link is external, it will be rendered as a normal `<a>` tag
|
|
135
|
+
*/
|
|
136
|
+
declare const AutoLink: vue.DefineComponent<{
|
|
137
|
+
/**
|
|
138
|
+
* Pattern to determine if the link should be active, which has higher priority than `exact`
|
|
139
|
+
*/
|
|
140
|
+
activeMatch: {
|
|
141
|
+
type: (StringConstructor | RegExpConstructor)[];
|
|
142
|
+
default: string;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* The `aria-label` attribute
|
|
146
|
+
*/
|
|
147
|
+
ariaLabel: {
|
|
148
|
+
type: StringConstructor;
|
|
149
|
+
default: string;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Whether the link should be active only if the url is an exact match
|
|
153
|
+
*/
|
|
154
|
+
exact: BooleanConstructor;
|
|
155
|
+
/**
|
|
156
|
+
* URL of the auto link
|
|
157
|
+
*/
|
|
158
|
+
link: {
|
|
159
|
+
type: StringConstructor;
|
|
160
|
+
required: true;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* The `rel` attribute
|
|
164
|
+
*/
|
|
165
|
+
rel: {
|
|
166
|
+
type: StringConstructor;
|
|
167
|
+
default: string;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* The `target` attribute
|
|
171
|
+
*/
|
|
172
|
+
target: {
|
|
173
|
+
type: StringConstructor;
|
|
174
|
+
default: string;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Text of the auto link
|
|
178
|
+
*/
|
|
179
|
+
text: {
|
|
180
|
+
type: StringConstructor;
|
|
181
|
+
required: true;
|
|
182
|
+
};
|
|
183
|
+
}, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
184
|
+
[key: string]: any;
|
|
185
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
186
|
+
/**
|
|
187
|
+
* Pattern to determine if the link should be active, which has higher priority than `exact`
|
|
188
|
+
*/
|
|
189
|
+
activeMatch: {
|
|
190
|
+
type: (StringConstructor | RegExpConstructor)[];
|
|
191
|
+
default: string;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* The `aria-label` attribute
|
|
195
|
+
*/
|
|
196
|
+
ariaLabel: {
|
|
197
|
+
type: StringConstructor;
|
|
198
|
+
default: string;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Whether the link should be active only if the url is an exact match
|
|
202
|
+
*/
|
|
203
|
+
exact: BooleanConstructor;
|
|
204
|
+
/**
|
|
205
|
+
* URL of the auto link
|
|
206
|
+
*/
|
|
207
|
+
link: {
|
|
208
|
+
type: StringConstructor;
|
|
209
|
+
required: true;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* The `rel` attribute
|
|
213
|
+
*/
|
|
214
|
+
rel: {
|
|
215
|
+
type: StringConstructor;
|
|
216
|
+
default: string;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* The `target` attribute
|
|
220
|
+
*/
|
|
221
|
+
target: {
|
|
222
|
+
type: StringConstructor;
|
|
223
|
+
default: string;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Text of the auto link
|
|
227
|
+
*/
|
|
228
|
+
text: {
|
|
229
|
+
type: StringConstructor;
|
|
230
|
+
required: true;
|
|
231
|
+
};
|
|
232
|
+
}>>, {
|
|
233
|
+
target: string;
|
|
234
|
+
activeMatch: string | RegExp;
|
|
235
|
+
ariaLabel: string;
|
|
236
|
+
exact: boolean;
|
|
237
|
+
rel: string;
|
|
238
|
+
}, SlotsType<{
|
|
239
|
+
default?: (() => VNode[] | VNode) | undefined;
|
|
240
|
+
before?: (() => VNode[] | VNode | null) | undefined;
|
|
241
|
+
after?: (() => VNode[] | VNode | null) | undefined;
|
|
242
|
+
}>>;
|
|
230
243
|
|
|
244
|
+
/**
|
|
245
|
+
* Wrapper component that only renders its content on the client side and skips server side rendering
|
|
246
|
+
*/
|
|
231
247
|
declare const ClientOnly: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
232
248
|
[key: string]: any;
|
|
233
249
|
}>[] | null | undefined, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{}>>, {}, {}>;
|
|
@@ -236,7 +252,7 @@ declare const ClientOnly: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNo
|
|
|
236
252
|
* Markdown rendered content
|
|
237
253
|
*/
|
|
238
254
|
declare const Content: vue.DefineComponent<{
|
|
239
|
-
|
|
255
|
+
path: {
|
|
240
256
|
type: StringConstructor;
|
|
241
257
|
required: false;
|
|
242
258
|
default: string;
|
|
@@ -244,40 +260,168 @@ declare const Content: vue.DefineComponent<{
|
|
|
244
260
|
}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
245
261
|
[key: string]: any;
|
|
246
262
|
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
247
|
-
|
|
263
|
+
path: {
|
|
248
264
|
type: StringConstructor;
|
|
249
265
|
required: false;
|
|
250
266
|
default: string;
|
|
251
267
|
};
|
|
252
268
|
}>>, {
|
|
253
|
-
|
|
269
|
+
path: string;
|
|
254
270
|
}, {}>;
|
|
255
271
|
|
|
272
|
+
interface RouteLinkProps {
|
|
273
|
+
/**
|
|
274
|
+
* Whether the link is active to have an active class
|
|
275
|
+
*
|
|
276
|
+
* Notice that the active status is not automatically determined according to the current route.
|
|
277
|
+
*
|
|
278
|
+
* @default false
|
|
279
|
+
*/
|
|
280
|
+
active?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* The class to add when the link is active
|
|
283
|
+
*
|
|
284
|
+
* @default 'route-link-active'
|
|
285
|
+
*/
|
|
286
|
+
activeClass?: string;
|
|
287
|
+
/**
|
|
288
|
+
* The route path to link to
|
|
289
|
+
*/
|
|
290
|
+
to: string;
|
|
291
|
+
}
|
|
256
292
|
/**
|
|
257
|
-
*
|
|
293
|
+
* Component to render a link to another route.
|
|
294
|
+
*
|
|
295
|
+
* It's similar to `RouterLink` in `vue-router`, but more lightweight.
|
|
296
|
+
*
|
|
297
|
+
* It's recommended to use `RouteLink` in VuePress.
|
|
258
298
|
*/
|
|
259
|
-
declare const
|
|
299
|
+
declare const RouteLink: vue.DefineComponent<{
|
|
300
|
+
/**
|
|
301
|
+
* The route path to link to
|
|
302
|
+
*/
|
|
303
|
+
to: {
|
|
304
|
+
type: StringConstructor;
|
|
305
|
+
required: true;
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* Whether the link is active to have an active class
|
|
309
|
+
*
|
|
310
|
+
* Notice that the active status is not automatically determined according to the current route.
|
|
311
|
+
*/
|
|
312
|
+
active: BooleanConstructor;
|
|
313
|
+
/**
|
|
314
|
+
* The class to add when the link is active
|
|
315
|
+
*/
|
|
316
|
+
activeClass: {
|
|
317
|
+
type: StringConstructor;
|
|
318
|
+
default: string;
|
|
319
|
+
};
|
|
320
|
+
}, () => VNode<vue.RendererNode, vue.RendererElement, {
|
|
321
|
+
[key: string]: any;
|
|
322
|
+
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
323
|
+
/**
|
|
324
|
+
* The route path to link to
|
|
325
|
+
*/
|
|
326
|
+
to: {
|
|
327
|
+
type: StringConstructor;
|
|
328
|
+
required: true;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Whether the link is active to have an active class
|
|
332
|
+
*
|
|
333
|
+
* Notice that the active status is not automatically determined according to the current route.
|
|
334
|
+
*/
|
|
335
|
+
active: BooleanConstructor;
|
|
336
|
+
/**
|
|
337
|
+
* The class to add when the link is active
|
|
338
|
+
*/
|
|
339
|
+
activeClass: {
|
|
340
|
+
type: StringConstructor;
|
|
341
|
+
default: string;
|
|
342
|
+
};
|
|
343
|
+
}>>, {
|
|
344
|
+
active: boolean;
|
|
345
|
+
activeClass: string;
|
|
346
|
+
}, SlotsType<{
|
|
347
|
+
default: () => string | VNode | (string | VNode)[];
|
|
348
|
+
}>>;
|
|
260
349
|
|
|
261
350
|
/**
|
|
262
|
-
*
|
|
351
|
+
* Injection key for client data
|
|
263
352
|
*/
|
|
264
|
-
declare const
|
|
353
|
+
declare const clientDataSymbol: InjectionKey<ClientData>;
|
|
354
|
+
/**
|
|
355
|
+
* Returns client data
|
|
356
|
+
*/
|
|
357
|
+
declare const useClientData: () => ClientData;
|
|
358
|
+
|
|
359
|
+
declare const useLayouts: () => LayoutsRef;
|
|
360
|
+
declare const usePageComponent: () => PageComponentRef;
|
|
361
|
+
declare const usePageData: <T extends Record<any, any> = Record<never, never>>() => PageDataRef<T>;
|
|
362
|
+
declare const usePageFrontmatter: <T extends Record<any, any> = Record<string, unknown>>() => PageFrontmatterRef<T>;
|
|
363
|
+
declare const usePageHead: () => PageHeadRef;
|
|
364
|
+
declare const usePageLang: () => PageLangRef;
|
|
365
|
+
declare const usePageLayout: () => PageLayoutRef;
|
|
366
|
+
declare const useRedirects: () => RedirectsRef;
|
|
367
|
+
declare const useRouteLocale: () => RouteLocaleRef;
|
|
368
|
+
declare const useRoutePath: () => RoutePathRef;
|
|
369
|
+
declare const useRoutes: () => RoutesRef;
|
|
370
|
+
declare const useSiteData: () => SiteDataRef;
|
|
371
|
+
declare const useSiteLocaleData: () => SiteLocaleDataRef;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* A util function to force update `<head>` of current page
|
|
375
|
+
*/
|
|
376
|
+
type UpdateHead = () => void;
|
|
377
|
+
/**
|
|
378
|
+
* Injection key for `updateHead` util
|
|
379
|
+
*/
|
|
380
|
+
declare const updateHeadSymbol: InjectionKey<UpdateHead>;
|
|
381
|
+
/**
|
|
382
|
+
* Returns the `updateHead` util
|
|
383
|
+
*/
|
|
384
|
+
declare const useUpdateHead: () => UpdateHead;
|
|
385
|
+
|
|
386
|
+
interface ResolvedRoute<T extends RouteMeta = RouteMeta> extends Route<T> {
|
|
387
|
+
path: string;
|
|
388
|
+
notFound: boolean;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Resolve route with given path
|
|
392
|
+
*/
|
|
393
|
+
declare const resolveRoute: <T extends RouteMeta = RouteMeta>(path: string, currentPath?: string) => ResolvedRoute<T>;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Resolve route path with given raw path
|
|
397
|
+
*/
|
|
398
|
+
declare const resolveRoutePath: (path: string, currentPath?: string) => string;
|
|
265
399
|
|
|
266
400
|
/**
|
|
267
401
|
* Resolver methods to get global computed
|
|
268
402
|
*
|
|
269
403
|
* Users can override corresponding method for advanced customization
|
|
404
|
+
*
|
|
405
|
+
* @experimental - This is an experimental API and may be changed in minor versions
|
|
270
406
|
*/
|
|
271
407
|
declare const resolvers: {
|
|
272
408
|
resolveLayouts: (clientConfigs: ClientConfig[]) => Layouts;
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
resolvePageLang: (page: PageData, siteLocale: SiteLocaleData) => PageLang;
|
|
278
|
-
resolvePageLayout: (page: PageData, layouts: Layouts) => Component;
|
|
409
|
+
resolvePageHead: (pageHeadTitle: PageHeadTitle, pageFrontmatter: PageFrontmatter, siteLocaleDate: SiteLocaleData) => PageHead;
|
|
410
|
+
resolvePageHeadTitle: (pageData: PageData, siteLocaleDate: SiteLocaleData) => PageHeadTitle;
|
|
411
|
+
resolvePageLang: (pageData: PageData, siteLocaleData: SiteLocaleData) => PageLang;
|
|
412
|
+
resolvePageLayout: (pageData: PageData, layouts: Layouts) => PageLayout;
|
|
279
413
|
resolveRouteLocale: (locales: SiteData['locales'], routePath: string) => RouteLocale;
|
|
280
|
-
resolveSiteLocaleData: (
|
|
414
|
+
resolveSiteLocaleData: ({ base, locales, ...siteData }: SiteData, routeLocale: RouteLocale) => SiteLocaleData;
|
|
281
415
|
};
|
|
282
416
|
|
|
283
|
-
|
|
417
|
+
/**
|
|
418
|
+
* A helper function to help you define vuepress client config file
|
|
419
|
+
*/
|
|
420
|
+
declare const defineClientConfig: (clientConfig?: ClientConfig) => ClientConfig;
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Prefix url with site base
|
|
424
|
+
*/
|
|
425
|
+
declare const withBase: (url: string) => string;
|
|
426
|
+
|
|
427
|
+
export { AutoLink, type AutoLinkProps, type ClientConfig, type ClientData, ClientOnly, Content, type Layouts, type LayoutsRef, type PageChunk, type PageComponent, type PageComponentRef, type PageDataRef, type PageFrontmatterRef, type PageHead, type PageHeadRef, type PageHeadTitle, type PageHeadTitleRef, type PageLang, type PageLangRef, type PageLayout, type PageLayoutRef, type Redirects, type RedirectsRef, type ResolvedRoute, type Route, RouteLink, type RouteLinkProps, type RouteLocale, type RouteLocaleRef, type RouteMeta, type RoutePath, type RoutePathRef, type Routes, type RoutesRef, type SiteDataRef, type SiteLocaleDataRef, type UpdateHead, clientDataSymbol, defineClientConfig, resolveRoute, resolveRoutePath, resolvers, updateHeadSymbol, useClientData, useLayouts, usePageComponent, usePageData, usePageFrontmatter, usePageHead, usePageLang, usePageLayout, useRedirects, useRouteLocale, useRoutePath, useRoutes, useSiteData, useSiteLocaleData, useUpdateHead, withBase };
|
package/dist/index.js
CHANGED
|
@@ -1,62 +1,58 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AutoLink,
|
|
2
3
|
ClientOnly,
|
|
3
4
|
Content,
|
|
5
|
+
RouteLink,
|
|
6
|
+
clientDataSymbol,
|
|
4
7
|
defineClientConfig,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
pageDataSymbol,
|
|
8
|
-
pageFrontmatterSymbol,
|
|
9
|
-
pageHeadSymbol,
|
|
10
|
-
pageHeadTitleSymbol,
|
|
11
|
-
pageLangSymbol,
|
|
12
|
-
pageLayoutSymbol,
|
|
13
|
-
pagesData,
|
|
8
|
+
resolveRoute,
|
|
9
|
+
resolveRoutePath,
|
|
14
10
|
resolvers,
|
|
15
|
-
routeLocaleSymbol,
|
|
16
|
-
siteData,
|
|
17
|
-
siteLocaleDataSymbol,
|
|
18
11
|
updateHeadSymbol,
|
|
12
|
+
useClientData,
|
|
19
13
|
useLayouts,
|
|
14
|
+
usePageComponent,
|
|
20
15
|
usePageData,
|
|
21
16
|
usePageFrontmatter,
|
|
22
17
|
usePageHead,
|
|
23
|
-
usePageHeadTitle,
|
|
24
18
|
usePageLang,
|
|
25
19
|
usePageLayout,
|
|
26
|
-
|
|
20
|
+
useRedirects,
|
|
21
|
+
useRoute,
|
|
27
22
|
useRouteLocale,
|
|
23
|
+
useRoutePath,
|
|
24
|
+
useRouter,
|
|
25
|
+
useRoutes,
|
|
28
26
|
useSiteData,
|
|
29
27
|
useSiteLocaleData,
|
|
30
28
|
useUpdateHead,
|
|
31
29
|
withBase
|
|
32
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-GA5RAHE7.js";
|
|
33
31
|
export {
|
|
32
|
+
AutoLink,
|
|
34
33
|
ClientOnly,
|
|
35
34
|
Content,
|
|
35
|
+
RouteLink,
|
|
36
|
+
clientDataSymbol,
|
|
36
37
|
defineClientConfig,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
pageDataSymbol,
|
|
40
|
-
pageFrontmatterSymbol,
|
|
41
|
-
pageHeadSymbol,
|
|
42
|
-
pageHeadTitleSymbol,
|
|
43
|
-
pageLangSymbol,
|
|
44
|
-
pageLayoutSymbol,
|
|
45
|
-
pagesData,
|
|
38
|
+
resolveRoute,
|
|
39
|
+
resolveRoutePath,
|
|
46
40
|
resolvers,
|
|
47
|
-
routeLocaleSymbol,
|
|
48
|
-
siteData,
|
|
49
|
-
siteLocaleDataSymbol,
|
|
50
41
|
updateHeadSymbol,
|
|
42
|
+
useClientData,
|
|
51
43
|
useLayouts,
|
|
44
|
+
usePageComponent,
|
|
52
45
|
usePageData,
|
|
53
46
|
usePageFrontmatter,
|
|
54
47
|
usePageHead,
|
|
55
|
-
usePageHeadTitle,
|
|
56
48
|
usePageLang,
|
|
57
49
|
usePageLayout,
|
|
58
|
-
|
|
50
|
+
useRedirects,
|
|
51
|
+
useRoute,
|
|
59
52
|
useRouteLocale,
|
|
53
|
+
useRoutePath,
|
|
54
|
+
useRouter,
|
|
55
|
+
useRoutes,
|
|
60
56
|
useSiteData,
|
|
61
57
|
useSiteLocaleData,
|
|
62
58
|
useUpdateHead,
|