@vuepress/client 2.0.0-rc.3 → 2.0.0-rc.31

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.
@@ -0,0 +1,112 @@
1
+ import { App, Component, ComputedRef, Ref } from "vue";
2
+ import { HeadConfig, PageData, PageFrontmatter, PageHeader, SiteData, SiteLocaleData } from "@vuepress/shared";
3
+ import { Router } from "vue-router";
4
+ //#region src/constants.d.ts
5
+ /**
6
+ * Name of the default layout
7
+ */
8
+ declare const LAYOUT_NAME_DEFAULT = "Layout";
9
+ /**
10
+ * Name of the 404 page layout
11
+ */
12
+ declare const LAYOUT_NAME_NOT_FOUND = "NotFound";
13
+ //#endregion
14
+ //#region src/types/routes.d.ts
15
+ interface PageChunk {
16
+ default: Component;
17
+ _pageData: PageData;
18
+ }
19
+ type RouteMeta = Record<string, unknown>;
20
+ interface Route<T extends RouteMeta = RouteMeta> {
21
+ loader: () => Promise<PageChunk>;
22
+ meta: T;
23
+ }
24
+ type Redirects = Record<string, string>;
25
+ type Routes = Record<string, Route>;
26
+ //#endregion
27
+ //#region src/types/clientData.d.ts
28
+ interface Layouts {
29
+ [LAYOUT_NAME_DEFAULT]: Component;
30
+ [LAYOUT_NAME_NOT_FOUND]: Component;
31
+ [key: string]: Component;
32
+ }
33
+ type PageComponent = Component;
34
+ type PageHead = HeadConfig[];
35
+ type PageHeadTitle = string;
36
+ type PageLang = string;
37
+ type PageLayout = Component;
38
+ type RoutePath = string;
39
+ type RouteLocale = string;
40
+ type LayoutsRef = ComputedRef<Layouts>;
41
+ type PageComponentRef = ComputedRef<PageComponent>;
42
+ type PageDataRef<T extends Record<string, unknown> = Record<string, unknown>> = ComputedRef<PageData<T>>;
43
+ type PageFrontmatterRef<T extends Record<string, unknown> = Record<string, unknown>> = ComputedRef<PageFrontmatter<T>>;
44
+ type PageHeadRef = ComputedRef<PageHead>;
45
+ type PageHeadTitleRef = ComputedRef<PageHeadTitle>;
46
+ type PageLangRef = ComputedRef<PageLang>;
47
+ type PageLayoutRef = ComputedRef<PageLayout>;
48
+ type RedirectsRef = Ref<Redirects>;
49
+ type RoutePathRef = ComputedRef<RoutePath>;
50
+ type RouteLocaleRef = ComputedRef<RouteLocale>;
51
+ type RoutesRef = Ref<Routes>;
52
+ type SiteDataRef = Ref<SiteData>;
53
+ type SiteLocaleDataRef = ComputedRef<SiteLocaleData>;
54
+ interface ClientData<Frontmatter extends Record<string, unknown> = Record<string, unknown>, Data extends Record<string, unknown> = Record<string, unknown>> {
55
+ layouts: LayoutsRef;
56
+ pageComponent: PageComponentRef;
57
+ pageData: PageDataRef<Data>;
58
+ pageFrontmatter: PageFrontmatterRef<Frontmatter>;
59
+ pageHead: PageHeadRef;
60
+ pageHeadTitle: PageHeadTitleRef;
61
+ pageLang: PageLangRef;
62
+ pageLayout: PageLayoutRef;
63
+ redirects: RedirectsRef;
64
+ routePath: RoutePathRef;
65
+ routeLocale: RouteLocaleRef;
66
+ routes: RoutesRef;
67
+ siteData: SiteDataRef;
68
+ siteLocaleData: SiteLocaleDataRef;
69
+ frontmatter: PageFrontmatterRef<Frontmatter>;
70
+ head: PageHeadRef;
71
+ headTitle: PageHeadTitleRef;
72
+ lang: PageLangRef;
73
+ page: PageDataRef<Data>;
74
+ site: SiteDataRef;
75
+ siteLocale: SiteLocaleDataRef;
76
+ }
77
+ //#endregion
78
+ //#region src/types/clientConfig.d.ts
79
+ /**
80
+ * Configure vuepress client
81
+ */
82
+ interface ClientConfig {
83
+ /**
84
+ * An enhance function to be called after vue app instance and
85
+ * vue-router instance has been created
86
+ */
87
+ enhance?: (context: {
88
+ app: App;
89
+ router: Router;
90
+ siteData: SiteDataRef;
91
+ }) => Promise<void> | void;
92
+ /**
93
+ * A function to be called inside the setup function of vue app
94
+ */
95
+ setup?: () => void;
96
+ /**
97
+ * Layout components
98
+ */
99
+ layouts?: Partial<Layouts>;
100
+ /**
101
+ * Components to be placed directly into the root node of vue app
102
+ */
103
+ rootComponents?: Component[];
104
+ }
105
+ //#endregion
106
+ //#region src/types/createVueAppFunction.d.ts
107
+ type CreateVueAppFunction = () => Promise<{
108
+ app: App;
109
+ router: Router;
110
+ }>;
111
+ //#endregion
112
+ export { SiteLocaleData as A, RouteLocale as C, RoutesRef as D, RoutePathRef as E, RouteMeta as F, Routes as I, PageChunk as M, Redirects as N, SiteData as O, Route as P, RedirectsRef as S, RoutePath as T, PageHeader as _, Layouts as a, PageLayout as b, PageComponentRef as c, PageFrontmatter as d, PageFrontmatterRef as f, PageHeadTitleRef as g, PageHeadTitle as h, HeadConfig as i, SiteLocaleDataRef as j, SiteDataRef as k, PageData as l, PageHeadRef as m, ClientConfig as n, LayoutsRef as o, PageHead as p, ClientData as r, PageComponent as s, CreateVueAppFunction as t, PageDataRef as u, PageLang as v, RouteLocaleRef as w, PageLayoutRef as x, PageLangRef as y };
package/dist/index.d.ts CHANGED
@@ -1,194 +1,220 @@
1
- import { PageData, PageFrontmatter, HeadConfig, SiteData } from '@vuepress/shared';
2
- export { PageData, PageFrontmatter, PageHeader, SiteData } from '@vuepress/shared';
3
- import * as vue from 'vue';
4
- import { ComputedRef, InjectionKey, Ref, Component, App, FunctionalComponent, VNode } from 'vue';
5
- import { Redirects, Routes, PageMetaDefault, Route } from '@internal/routes';
6
- export { PageChunk, PageMetaDefault, Redirects, Route, Routes } from '@internal/routes';
7
- import { Router } from 'vue-router';
8
- export { C as CreateVueAppFunction } from './createVueAppFunction-YNGNKfE3.js';
9
-
1
+ import { A as SiteLocaleData, C as RouteLocale, D as RoutesRef, E as RoutePathRef, F as RouteMeta, I as Routes, M as PageChunk, N as Redirects, O as SiteData, P as Route, S as RedirectsRef, T as RoutePath, _ as PageHeader, a as Layouts, b as PageLayout, c as PageComponentRef, d as PageFrontmatter, f as PageFrontmatterRef, g as PageHeadTitleRef, h as PageHeadTitle, i as HeadConfig, j as SiteLocaleDataRef, k as SiteDataRef, l as PageData, m as PageHeadRef, n as ClientConfig, o as LayoutsRef, p as PageHead, r as ClientData, s as PageComponent, t as CreateVueAppFunction, u as PageDataRef, v as PageLang, w as RouteLocaleRef, x as PageLayoutRef, y as PageLangRef } from "./index-wQR7Pl0s.js";
2
+ import { InjectionKey, PropType, SlotsType, VNode } from "vue";
3
+ import { RouteLocationNormalizedLoaded, Router, useRoute, useRouter } from "vue-router";
4
+ //#region src/types/onContentUpdated.d.ts
5
+ type ContentUpdatedReason = 'beforeUnmount' | 'mounted' | 'updated';
6
+ type ContentUpdatedCallback = (reason: ContentUpdatedReason) => unknown;
7
+ //#endregion
8
+ //#region src/components/AutoLink.d.ts
9
+ interface AutoLinkConfig {
10
+ /**
11
+ * Pattern to determine if the link should be active, which has higher priority than `exact`
12
+ */
13
+ activeMatch?: RegExp | string;
14
+ /**
15
+ * The `aria-label` attribute
16
+ */
17
+ ariaLabel?: string;
18
+ /**
19
+ * Whether the link should be active only if the url is an exact match
20
+ */
21
+ exact?: boolean;
22
+ /**
23
+ * URL of the auto link
24
+ */
25
+ link: string;
26
+ /**
27
+ * The `rel` attribute
28
+ */
29
+ rel?: string;
30
+ /**
31
+ * The `target` attribute
32
+ */
33
+ target?: string;
34
+ /**
35
+ * Text of the auto link
36
+ */
37
+ text: string;
38
+ }
10
39
  /**
11
- * Ref wrapper of `Layouts`
40
+ * Component to render a link automatically according to the link type
41
+ *
42
+ * - If the link is internal, it will be rendered as a `<RouteLink>`
43
+ * - If the link is external, it will be rendered as a normal `<a>` tag
44
+ */
45
+ declare const AutoLink: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
46
+ config: {
47
+ type: PropType<AutoLinkConfig>;
48
+ required: true;
49
+ };
50
+ }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
51
+ [key: string]: any;
52
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
53
+ config: {
54
+ type: PropType<AutoLinkConfig>;
55
+ required: true;
56
+ };
57
+ }>> & Readonly<{}>, {}, SlotsType<{
58
+ default?: (config: AutoLinkConfig) => VNode | VNode[];
59
+ before?: (config: AutoLinkConfig) => VNode | VNode[] | null;
60
+ after?: (config: AutoLinkConfig) => VNode | VNode[] | null;
61
+ }>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
62
+ //#endregion
63
+ //#region src/components/ClientOnly.d.ts
64
+ /**
65
+ * Wrapper component that only renders its content on the client side and skips server side rendering
66
+ *
67
+ * Since vue 3.5, you can try the new `data-allow-mismatch` attribute instead of `<ClientOnly>` component in some cases to avoid hydration mismatch.
68
+ *
69
+ * @see https://blog.vuejs.org/posts/vue-3-5#data-allow-mismatch
12
70
  */
13
- type LayoutsRef = ComputedRef<Layouts>;
71
+ declare const ClientOnly: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
72
+ [key: string]: any;
73
+ }>[] | null | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
74
+ //#endregion
75
+ //#region src/components/Content.d.ts
14
76
  /**
15
- * Injection key for layouts
77
+ * Markdown rendered content
16
78
  */
17
- declare const layoutsSymbol: InjectionKey<LayoutsRef>;
79
+ declare const Content: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
80
+ path: {
81
+ type: StringConstructor;
82
+ required: false;
83
+ default: string;
84
+ };
85
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
86
+ [key: string]: any;
87
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
88
+ path: {
89
+ type: StringConstructor;
90
+ required: false;
91
+ default: string;
92
+ };
93
+ }>> & Readonly<{}>, {
94
+ path: string;
95
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
96
+ //#endregion
97
+ //#region src/components/RouteLink.d.ts
98
+ interface RouteLinkProps {
99
+ /**
100
+ * Whether the link is active to have an active class
101
+ *
102
+ * Notice that the active status is not automatically determined according to the current route.
103
+ *
104
+ * @default false
105
+ */
106
+ active?: boolean;
107
+ /**
108
+ * The class to add when the link is active
109
+ *
110
+ * @default 'route-link-active'
111
+ */
112
+ activeClass?: string;
113
+ /**
114
+ * The route path to link to
115
+ */
116
+ to: string;
117
+ }
18
118
  /**
19
- * Returns layouts component map
20
- */
119
+ * Component to render a link to another route.
120
+ *
121
+ * It's similar to `RouterLink` in `vue-router`, but more lightweight.
122
+ *
123
+ * It's recommended to use `RouteLink` in VuePress.
124
+ */
125
+ declare const RouteLink: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
126
+ /**
127
+ * The route path to link to
128
+ */
129
+ to: {
130
+ type: StringConstructor;
131
+ required: true;
132
+ };
133
+ /**
134
+ * Whether the link is active to have an active class
135
+ *
136
+ * Notice that the active status is not automatically determined according to the current route.
137
+ */
138
+ active: BooleanConstructor;
139
+ /**
140
+ * The class to add when the link is active
141
+ */
142
+ activeClass: {
143
+ type: StringConstructor;
144
+ default: string;
145
+ };
146
+ }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
147
+ [key: string]: any;
148
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
149
+ /**
150
+ * The route path to link to
151
+ */
152
+ to: {
153
+ type: StringConstructor;
154
+ required: true;
155
+ };
156
+ /**
157
+ * Whether the link is active to have an active class
158
+ *
159
+ * Notice that the active status is not automatically determined according to the current route.
160
+ */
161
+ active: BooleanConstructor;
162
+ /**
163
+ * The class to add when the link is active
164
+ */
165
+ activeClass: {
166
+ type: StringConstructor;
167
+ default: string;
168
+ };
169
+ }>> & Readonly<{}>, {
170
+ active: boolean;
171
+ activeClass: string;
172
+ }, SlotsType<{
173
+ default: () => (VNode | string)[] | VNode | string;
174
+ }>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
175
+ //#endregion
176
+ //#region src/composables/clientData.d.ts
177
+ /**
178
+ * The problem only occurs during hot updates in the development environment,
179
+ * It only needs to be processed in the development environment.
180
+ * (see vuepress/core#1715)
181
+ */
182
+ declare const clientDataSymbol: InjectionKey<ClientData>;
183
+ /**
184
+ * Returns client data
185
+ */
186
+ declare const useClientData: <Frontmatter extends Record<string, unknown> = Record<string, unknown>, Data extends Record<string, unknown> = Record<string, unknown>>() => ClientData<Frontmatter, Data>;
187
+ //#endregion
188
+ //#region src/composables/clientDataUtils.d.ts
21
189
  declare const useLayouts: () => LayoutsRef;
22
-
23
- /**
24
- * Ref wrapper of `PageData`
25
- */
26
- type PageDataRef<T extends Record<any, any> = Record<never, never>> = Ref<PageData<T>>;
27
- /**
28
- * Injection key for page data
29
- */
30
- declare const pageDataSymbol: InjectionKey<PageDataRef>;
31
- /**
32
- * Returns the ref of the data of current page
33
- */
34
- declare const usePageData: <T extends Record<any, any> = Record<never, never>>() => PageDataRef<T>;
35
-
36
- /**
37
- * Ref wrapper of `PageFrontmatter`
38
- */
39
- type PageFrontmatterRef<T extends Record<any, any> = Record<string, unknown>> = ComputedRef<PageFrontmatter<T>>;
40
- /**
41
- * Injection key for page frontmatter
42
- */
43
- declare const pageFrontmatterSymbol: InjectionKey<PageFrontmatterRef>;
44
- /**
45
- * Returns the ref of the frontmatter of current page
46
- */
47
- declare const usePageFrontmatter: <T extends Record<any, any> = Record<string, unknown>>() => PageFrontmatterRef<T>;
48
-
49
- /**
50
- * Page head config, which would be used for generate html tags in `<head>`
51
- */
52
- type PageHead = HeadConfig[];
53
- /**
54
- * Ref wrapper of `PageHead`
55
- */
56
- type PageHeadRef = ComputedRef<PageHead>;
57
- /**
58
- * Injection key for page head
59
- */
60
- declare const pageHeadSymbol: InjectionKey<PageHeadRef>;
61
- /**
62
- * Returns the ref of the head config of current page
63
- */
190
+ declare const usePageComponent: () => PageComponentRef;
191
+ declare const usePageData: <T extends Record<string, unknown> = Record<string, unknown>>() => PageDataRef<T>;
192
+ declare const usePageFrontmatter: <T extends Record<string, unknown> = Record<string, unknown>>() => PageFrontmatterRef<T>;
64
193
  declare const usePageHead: () => PageHeadRef;
65
-
66
- /**
67
- * Page head title, which would be used as the content of `head > title` tag
68
- */
69
- type PageHeadTitle = string;
70
- /**
71
- * Ref wrapper of `PageHeadTitle`
72
- */
73
- type PageHeadTitleRef = ComputedRef<PageHeadTitle>;
74
- /**
75
- * Injection key for page head title
76
- */
77
- declare const pageHeadTitleSymbol: InjectionKey<PageHeadTitleRef>;
78
- /**
79
- * Returns the ref of the head title of current page
80
- */
81
- declare const usePageHeadTitle: () => PageHeadTitleRef;
82
-
83
- /**
84
- * Page language
85
- */
86
- type PageLang = string;
87
- /**
88
- * Ref wrapper of `PageLang`
89
- */
90
- type PageLangRef = ComputedRef<PageLang>;
91
- /**
92
- * Injection key for page language
93
- */
94
- declare const pageLangSymbol: InjectionKey<PageLangRef>;
95
- /**
96
- * Returns the ref of the language of current page
97
- */
98
194
  declare const usePageLang: () => PageLangRef;
99
-
100
- /**
101
- * Ref wrapper of `PageLayout`
102
- */
103
- type PageLayoutRef = ComputedRef<Component>;
104
- /**
105
- * Injection key for page layout
106
- */
107
- declare const pageLayoutSymbol: InjectionKey<PageLayoutRef>;
108
- /**
109
- * Returns layout component of current page
110
- */
111
- declare const usePageLayout: () => ComputedRef<Component>;
112
-
113
- /**
114
- * Route locale path
115
- */
116
- type RouteLocale = string;
117
- /**
118
- * Ref wrapper of `RouteLocale`
119
- */
120
- type RouteLocaleRef = Readonly<Ref<RouteLocale>>;
121
- /**
122
- * Injection key for page route locale path
123
- */
124
- declare const routeLocaleSymbol: InjectionKey<RouteLocaleRef>;
125
- /**
126
- * Returns the ref of the route locale path of current page
127
- */
195
+ declare const usePageLayout: () => PageLayoutRef;
196
+ declare const useRedirects: () => RedirectsRef;
128
197
  declare const useRouteLocale: () => RouteLocaleRef;
129
-
130
- /**
131
- * Global redirects ref
132
- */
133
- declare const redirects: Ref<Redirects>;
134
- /**
135
- * Global routes ref
136
- */
137
- declare const routes: Ref<Routes>;
138
-
139
- interface ResolvedRoute<PageMeta extends PageMetaDefault = PageMetaDefault> extends Route<PageMeta> {
140
- path: string;
141
- notFound: boolean;
142
- }
143
- /**
144
- * Resolve route with given path
145
- */
146
- declare const resolveRoute: <PageMeta extends PageMetaDefault = PageMetaDefault>(path: string) => ResolvedRoute<PageMeta>;
147
-
148
- /**
149
- * Resolve route path with given raw path
150
- */
151
- declare const resolveRoutePath: (path: string) => string;
152
-
153
- /**
154
- * Returns the ref of pages map
155
- */
156
- declare const useRedirects: () => typeof redirects;
157
- /**
158
- * Returns the ref of routes map
159
- */
160
- declare const useRoutes: () => typeof routes;
161
-
162
- /**
163
- * Ref wrapper of `SiteData`
164
- */
165
- type SiteDataRef = Ref<SiteData>;
166
- /**
167
- * Global site data ref
168
- */
169
- declare const siteData: SiteDataRef;
170
- /**
171
- * Returns the ref of the site data
172
- */
198
+ declare const useRoutePath: () => RoutePathRef;
199
+ declare const useRoutes: () => RoutesRef;
173
200
  declare const useSiteData: () => SiteDataRef;
174
-
175
- /**
176
- * Site data of current locale
177
- */
178
- type SiteLocaleData = SiteData;
179
- /**
180
- * Ref wrapper of `SiteLocaleData`
181
- */
182
- type SiteLocaleDataRef = ComputedRef<SiteLocaleData>;
183
- /**
184
- * Injection key for site locale data
185
- */
186
- declare const siteLocaleDataSymbol: InjectionKey<SiteLocaleDataRef>;
187
- /**
188
- * Returns the ref of the site data of current locale
189
- */
190
201
  declare const useSiteLocaleData: () => SiteLocaleDataRef;
191
-
202
+ declare const useData: <Frontmatter extends Record<string, unknown> = Record<string, unknown>, Data extends Record<string, unknown> = Record<string, unknown>>() => ClientData<Frontmatter, Data>;
203
+ declare const useFrontmatter: <T extends Record<string, unknown> = Record<string, unknown>>() => PageFrontmatterRef<T>;
204
+ declare const useHead: () => PageHeadRef;
205
+ declare const useLang: () => PageLangRef;
206
+ declare const usePage: <T extends Record<string, unknown> = Record<string, unknown>>() => PageDataRef<T>;
207
+ declare const useSite: () => SiteDataRef;
208
+ declare const useSiteLocale: () => SiteLocaleDataRef;
209
+ //#endregion
210
+ //#region src/composables/onContentUpdated.d.ts
211
+ /**
212
+ * Register callback that is called every time the markdown content is updated
213
+ * in the DOM.
214
+ */
215
+ declare const onContentUpdated: (fn: ContentUpdatedCallback) => void;
216
+ //#endregion
217
+ //#region src/composables/updateHead.d.ts
192
218
  /**
193
219
  * A util function to force update `<head>` of current page
194
220
  */
@@ -201,78 +227,61 @@ declare const updateHeadSymbol: InjectionKey<UpdateHead>;
201
227
  * Returns the `updateHead` util
202
228
  */
203
229
  declare const useUpdateHead: () => UpdateHead;
204
-
205
- type Layouts = Record<string, Component>;
206
-
207
- /**
208
- * Configure vuepress client
209
- */
210
- interface ClientConfig {
211
- /**
212
- * An enhance function to be called after vue app instance and
213
- * vue-router instance has been created
214
- */
215
- enhance?: (context: {
216
- app: App;
217
- router: Router;
218
- siteData: SiteDataRef;
219
- }) => void | Promise<void>;
220
- /**
221
- * A function to be called inside the setup function of vue app
222
- */
223
- setup?: () => void;
224
- /**
225
- * Layout components
226
- */
227
- layouts?: Layouts;
228
- /**
229
- * Components to be placed directly into the root node of vue app
230
- */
231
- rootComponents?: Component[];
230
+ declare namespace constants_d_exports {
231
+ export { COMPONENT_STATE_TYPE, INSPECTOR_ID, INSPECTOR_LABEL, INSPECTOR_NODES, INSPECTOR_STATE_SECTION_NAME, PLUGIN_ID, PLUGIN_LABEL };
232
+ }
233
+ declare const PLUGIN_ID = "org.vuejs.vuepress";
234
+ declare const PLUGIN_LABEL = "VuePress";
235
+ declare const COMPONENT_STATE_TYPE = "VuePress";
236
+ declare const INSPECTOR_ID = "org.vuejs.vuepress";
237
+ declare const INSPECTOR_LABEL = "VuePress";
238
+ declare const INSPECTOR_NODES: {
239
+ INTERNAL: {
240
+ readonly id: "INTERNAL";
241
+ readonly label: "Internal";
242
+ readonly keys: ["layouts", "routes", "redirects"];
243
+ };
244
+ SITE: {
245
+ readonly id: "SITE";
246
+ readonly label: "Site";
247
+ readonly keys: ["siteData", "siteLocaleData"];
248
+ };
249
+ ROUTE: {
250
+ readonly id: "ROUTE";
251
+ readonly label: "Route";
252
+ readonly keys: ["routePath", "routeLocale"];
253
+ };
254
+ PAGE: {
255
+ readonly id: "PAGE";
256
+ readonly label: "Page";
257
+ readonly keys: ["pageData", "pageFrontmatter", "pageLang", "pageHead", "pageHeadTitle", "pageLayout", "pageComponent"];
258
+ };
259
+ };
260
+ declare const INSPECTOR_STATE_SECTION_NAME = "State";
261
+ //#endregion
262
+ //#region src/router/resolveRoute.d.ts
263
+ interface ResolvedRoute<T extends RouteMeta = RouteMeta> extends Route<T> {
264
+ path: string;
265
+ notFound: boolean;
232
266
  }
233
-
234
- declare const ClientOnly: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
235
- [key: string]: any;
236
- }>[] | null | undefined, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{}>>, {}, {}>;
237
-
238
267
  /**
239
- * Markdown rendered content
268
+ * Resolve route with given path
240
269
  */
241
- declare const Content: vue.DefineComponent<{
242
- path: {
243
- type: StringConstructor;
244
- required: false;
245
- default: string;
246
- };
247
- }, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
248
- [key: string]: any;
249
- }>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
250
- path: {
251
- type: StringConstructor;
252
- required: false;
253
- default: string;
254
- };
255
- }>>, {
256
- path: string;
257
- }, {}>;
258
-
259
- interface VPLinkProps {
260
- to: string;
261
- }
262
- declare const VPLink: FunctionalComponent<VPLinkProps, Record<never, never>, {
263
- default: () => string | VNode | (string | VNode)[];
264
- }>;
265
-
270
+ declare const resolveRoute: <T extends RouteMeta = RouteMeta>(path: string, currentPath?: string) => ResolvedRoute<T>;
271
+ //#endregion
272
+ //#region src/router/resolveRouteFullPath.d.ts
266
273
  /**
267
- * A helper function to help you define vuepress client config file
274
+ * Resolve route full path with given raw path
268
275
  */
269
- declare const defineClientConfig: (clientConfig?: ClientConfig) => ClientConfig;
270
-
276
+ declare const resolveRouteFullPath: (path: string, currentPath?: string) => string;
277
+ //#endregion
278
+ //#region src/router/resolveRoutePath.d.ts
271
279
  /**
272
- * Prefix url with site base
280
+ * Resolve route path with given raw path
273
281
  */
274
- declare const withBase: (url: string) => string;
275
-
282
+ declare const resolveRoutePath: (pathname: string, currentPath?: string) => string;
283
+ //#endregion
284
+ //#region src/resolvers.d.ts
276
285
  /**
277
286
  * Resolver methods to get global computed
278
287
  *
@@ -281,14 +290,25 @@ declare const withBase: (url: string) => string;
281
290
  * @experimental - This is an experimental API and may be changed in minor versions
282
291
  */
283
292
  declare const resolvers: {
284
- resolveLayouts: (clientConfigs: ClientConfig[]) => Layouts;
285
- resolvePageFrontmatter: (pageData: PageData) => PageFrontmatter;
286
- resolvePageHead: (headTitle: PageHeadTitle, frontmatter: PageFrontmatter, siteLocale: SiteLocaleData) => PageHead;
287
- resolvePageHeadTitle: (page: PageData, siteLocale: SiteLocaleData) => PageHeadTitle;
288
- resolvePageLang: (page: PageData, siteLocale: SiteLocaleData) => PageLang;
289
- resolvePageLayout: (page: PageData, layouts: Layouts) => Component;
290
- resolveRouteLocale: (locales: SiteData['locales'], routePath: string) => RouteLocale;
291
- resolveSiteLocaleData: (site: SiteData, routeLocale: RouteLocale) => SiteLocaleData;
293
+ resolveLayouts: (clientConfigs: ClientConfig[]) => Layouts;
294
+ resolvePageHead: (pageHeadTitle: PageHeadTitle, pageFrontmatter: PageFrontmatter, siteLocaleDate: SiteLocaleData) => PageHead;
295
+ resolvePageHeadTitle: (pageData: PageData, siteLocaleDate: SiteLocaleData) => PageHeadTitle;
296
+ resolvePageLang: (pageData: PageData, siteLocaleData: SiteLocaleData) => PageLang;
297
+ resolvePageLayout: (pageData: PageData, layouts: Layouts) => PageLayout;
298
+ resolveRouteLocale: (locales: SiteData["locales"], routePath: string) => RouteLocale;
299
+ resolveSiteLocaleData: ({ base, locales, ...siteData }: SiteData, routeLocale: RouteLocale) => SiteLocaleData;
292
300
  };
293
-
294
- export { type ClientConfig, ClientOnly, Content, type Layouts, type LayoutsRef, type PageDataRef, type PageFrontmatterRef, type PageHead, type PageHeadRef, type PageHeadTitle, type PageHeadTitleRef, type PageLang, type PageLangRef, type PageLayoutRef, type RouteLocale, type RouteLocaleRef, type SiteDataRef, type SiteLocaleData, type SiteLocaleDataRef, type UpdateHead, VPLink, type VPLinkProps, defineClientConfig, layoutsSymbol, pageDataSymbol, pageFrontmatterSymbol, pageHeadSymbol, pageHeadTitleSymbol, pageLangSymbol, pageLayoutSymbol, redirects, resolveRoute, resolveRoutePath, resolvers, routeLocaleSymbol, routes, siteData, siteLocaleDataSymbol, updateHeadSymbol, useLayouts, usePageData, usePageFrontmatter, usePageHead, usePageHeadTitle, usePageLang, usePageLayout, useRedirects, useRouteLocale, useRoutes, useSiteData, useSiteLocaleData, useUpdateHead, withBase };
301
+ //#endregion
302
+ //#region src/utils/defineClientConfig.d.ts
303
+ /**
304
+ * A helper function to help you define vuepress client config file
305
+ */
306
+ declare const defineClientConfig: (clientConfig?: ClientConfig) => ClientConfig;
307
+ //#endregion
308
+ //#region src/utils/withBase.d.ts
309
+ /**
310
+ * Prefix url with site base
311
+ */
312
+ declare const withBase: (url: string) => string;
313
+ //#endregion
314
+ export { AutoLink, AutoLinkConfig, type ClientConfig, type ClientData, ClientOnly, Content, type ContentUpdatedCallback, type ContentUpdatedReason, type CreateVueAppFunction, constants_d_exports as DEVTOOLS, type HeadConfig, type Layouts, type LayoutsRef, type PageChunk, type PageComponent, type PageComponentRef, type PageData, type PageDataRef, type PageFrontmatter, type PageFrontmatterRef, type PageHead, type PageHeadRef, type PageHeadTitle, type PageHeadTitleRef, type PageHeader, type PageLang, type PageLangRef, type PageLayout, type PageLayoutRef, type Redirects, type RedirectsRef, ResolvedRoute, type Route, RouteLink, RouteLinkProps, type RouteLocale, type RouteLocaleRef, type RouteLocationNormalizedLoaded, type RouteMeta, type RoutePath, type RoutePathRef, type Router, type Routes, type RoutesRef, type SiteData, type SiteDataRef, type SiteLocaleData, type SiteLocaleDataRef, UpdateHead, clientDataSymbol, defineClientConfig, onContentUpdated, resolveRoute, resolveRouteFullPath, resolveRoutePath, resolvers, updateHeadSymbol, useClientData, useData, useFrontmatter, useHead, useLang, useLayouts, usePage, usePageComponent, usePageData, usePageFrontmatter, usePageHead, usePageLang, usePageLayout, useRedirects, useRoute, useRouteLocale, useRoutePath, useRouter, useRoutes, useSite, useSiteData, useSiteLocale, useSiteLocaleData, useUpdateHead, withBase };