@vuepress/client 2.0.0-rc.26 → 2.0.0-rc.28

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 };