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

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.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  usePageLang,
21
21
  usePageLayout,
22
22
  withBase
23
- } from "./chunk-2SMBJWK6.js";
23
+ } from "./chunk-6BD5VZ74.js";
24
24
 
25
25
  // src/app.ts
26
26
  import { clientConfigs } from "@internal/clientConfigs";
package/dist/index.d.ts CHANGED
@@ -1,9 +1,7 @@
1
1
  import { PageData, PageFrontmatter, HeadConfig, SiteData } from '@vuepress/shared';
2
2
  export { PageData, PageFrontmatter, PageHeader, SiteData } from '@vuepress/shared';
3
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';
4
+ import { ComputedRef, InjectionKey, Ref, Component, App, ComponentOptions, FunctionalComponent, VNode } from 'vue';
7
5
  import { Router } from 'vue-router';
8
6
  export { C as CreateVueAppFunction } from './createVueAppFunction-YNGNKfE3.js';
9
7
 
@@ -127,29 +125,29 @@ declare const routeLocaleSymbol: InjectionKey<RouteLocaleRef>;
127
125
  */
128
126
  declare const useRouteLocale: () => RouteLocaleRef;
129
127
 
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> {
128
+ interface ResolvedRoute<T extends RouteMeta = RouteMeta> extends Route<T> {
140
129
  path: string;
141
130
  notFound: boolean;
142
131
  }
143
132
  /**
144
133
  * Resolve route with given path
145
134
  */
146
- declare const resolveRoute: <PageMeta extends PageMetaDefault = PageMetaDefault>(path: string) => ResolvedRoute<PageMeta>;
135
+ declare const resolveRoute: <T extends RouteMeta = RouteMeta>(path: string) => ResolvedRoute<T>;
147
136
 
148
137
  /**
149
138
  * Resolve route path with given raw path
150
139
  */
151
140
  declare const resolveRoutePath: (path: string) => string;
152
141
 
142
+ /**
143
+ * Global redirects ref
144
+ */
145
+ declare const redirects: Ref<Redirects>;
146
+ /**
147
+ * Global routes ref
148
+ */
149
+ declare const routes: Ref<Routes>;
150
+
153
151
  /**
154
152
  * Returns the ref of pages map
155
153
  */
@@ -231,6 +229,18 @@ interface ClientConfig {
231
229
  rootComponents?: Component[];
232
230
  }
233
231
 
232
+ interface PageChunk {
233
+ comp: ComponentOptions;
234
+ data: PageData;
235
+ }
236
+ type RouteMeta = Record<string, unknown>;
237
+ interface Route<T extends RouteMeta = RouteMeta> {
238
+ loader: () => Promise<PageChunk>;
239
+ meta: T;
240
+ }
241
+ type Redirects = Record<string, string>;
242
+ type Routes = Record<string, Route>;
243
+
234
244
  declare const ClientOnly: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
235
245
  [key: string]: any;
236
246
  }>[] | null | undefined, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{}>>, {}, {}>;
@@ -291,4 +301,4 @@ declare const resolvers: {
291
301
  resolveSiteLocaleData: (site: SiteData, routeLocale: RouteLocale) => SiteLocaleData;
292
302
  };
293
303
 
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 };
304
+ export { type ClientConfig, ClientOnly, Content, type Layouts, type LayoutsRef, type PageChunk, type PageDataRef, type PageFrontmatterRef, type PageHead, type PageHeadRef, type PageHeadTitle, type PageHeadTitleRef, type PageLang, type PageLangRef, type PageLayoutRef, type Redirects, type Route, type RouteLocale, type RouteLocaleRef, type RouteMeta, type Routes, 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 };
package/dist/index.js CHANGED
@@ -33,7 +33,7 @@ import {
33
33
  useSiteLocaleData,
34
34
  useUpdateHead,
35
35
  withBase
36
- } from "./chunk-2SMBJWK6.js";
36
+ } from "./chunk-6BD5VZ74.js";
37
37
  export {
38
38
  ClientOnly,
39
39
  Content,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/client",
3
- "version": "2.0.0-rc.3",
3
+ "version": "2.0.0-rc.4",
4
4
  "description": "Client package of VuePress",
5
5
  "keywords": [
6
6
  "vuepress",
@@ -37,7 +37,7 @@
37
37
  "@vueuse/core": "^10.7.2",
38
38
  "vue": "^3.4.15",
39
39
  "vue-router": "^4.2.5",
40
- "@vuepress/shared": "2.0.0-rc.3"
40
+ "@vuepress/shared": "2.0.0-rc.4"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -111,12 +111,12 @@ import { shallowRef } from "vue";
111
111
  var redirects = shallowRef(redirectsRaw);
112
112
  var routes = shallowRef(routesRaw);
113
113
  if (__VUEPRESS_DEV__ && (import.meta.webpackHot || import.meta.hot)) {
114
- __VUE_HMR_RUNTIME__.updateRoutes = (data) => {
115
- routes.value = data;
116
- };
117
114
  __VUE_HMR_RUNTIME__.updateRedirects = (data) => {
118
115
  redirects.value = data;
119
116
  };
117
+ __VUE_HMR_RUNTIME__.updateRoutes = (data) => {
118
+ routes.value = data;
119
+ };
120
120
  }
121
121
 
122
122
  // src/router/resolveRoutePath.ts