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

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