vitepress 0.20.3 → 0.20.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/client/index.d.ts +64 -100
- package/dist/node/index.d.ts +163 -0
- package/package.json +1 -1
package/dist/client/index.d.ts
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export declare
|
|
1
|
+
import { AllowedComponentProps } from 'vue';
|
|
2
|
+
import { App } from 'vue';
|
|
3
|
+
import { Component } from 'vue';
|
|
4
|
+
import { ComponentCustomProps } from 'vue';
|
|
5
|
+
import { ComponentOptions } from 'vue';
|
|
6
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
7
|
+
import { DefineComponent } from 'vue';
|
|
8
|
+
import { EmitsOptions } from 'vue';
|
|
9
|
+
import { Ref } from 'vue';
|
|
10
|
+
import { RendererElement } from 'vue';
|
|
11
|
+
import { RendererNode } from 'vue';
|
|
12
|
+
import { VNode } from 'vue';
|
|
13
|
+
import { VNodeProps } from 'vue';
|
|
14
|
+
|
|
15
|
+
export declare const Content: DefineComponent< {}, () => VNode<RendererNode, RendererElement, {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, EmitsOptions, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{} & {} & {}>, {}>;
|
|
18
|
+
|
|
19
|
+
export declare const Debug: ComponentOptions<{}, any, any, any, any, any, any, any>;
|
|
20
|
+
|
|
21
|
+
export declare interface EnhanceAppContext {
|
|
22
|
+
app: App;
|
|
23
|
+
router: Router;
|
|
24
|
+
siteData: Ref<SiteData>;
|
|
25
|
+
}
|
|
22
26
|
|
|
23
27
|
export declare type HeadConfig =
|
|
24
28
|
| [string, Record<string, string>]
|
|
@@ -30,6 +34,8 @@ export declare interface Header {
|
|
|
30
34
|
slug: string
|
|
31
35
|
}
|
|
32
36
|
|
|
37
|
+
export declare const inBrowser: boolean;
|
|
38
|
+
|
|
33
39
|
export declare interface LocaleConfig {
|
|
34
40
|
lang: string
|
|
35
41
|
title?: string
|
|
@@ -39,64 +45,24 @@ export declare interface LocaleConfig {
|
|
|
39
45
|
selectText?: string
|
|
40
46
|
}
|
|
41
47
|
|
|
42
|
-
export declare interface
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
leftDelimiter?: string;
|
|
50
|
-
rightDelimiter?: string;
|
|
51
|
-
allowedAttributes?: string[];
|
|
52
|
-
};
|
|
53
|
-
toc?: any;
|
|
54
|
-
externalLinks?: Record<string, string>;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export declare interface MarkdownParsedData {
|
|
58
|
-
hoistedTags?: string[];
|
|
59
|
-
links?: string[];
|
|
60
|
-
headers?: Header[];
|
|
48
|
+
export declare interface PageData {
|
|
49
|
+
relativePath: string
|
|
50
|
+
title: string
|
|
51
|
+
description: string
|
|
52
|
+
headers: Header[]
|
|
53
|
+
frontmatter: Record<string, any>
|
|
54
|
+
lastUpdated: number
|
|
61
55
|
}
|
|
62
56
|
|
|
63
|
-
export declare interface
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
data: any;
|
|
68
|
-
};
|
|
57
|
+
export declare interface Route {
|
|
58
|
+
path: string;
|
|
59
|
+
data: PageData;
|
|
60
|
+
component: Component | null;
|
|
69
61
|
}
|
|
70
62
|
|
|
71
|
-
export declare
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
export declare function resolveSiteData(root: string, userConfig?: UserConfig, command?: 'serve' | 'build', mode?: string): Promise<SiteData>;
|
|
76
|
-
|
|
77
|
-
export declare function resolveSiteDataByRoute(siteData: SiteData, route: string): SiteData;
|
|
78
|
-
|
|
79
|
-
export declare function serve(options?: ServeOptions): Promise<void>;
|
|
80
|
-
|
|
81
|
-
export declare interface ServeOptions {
|
|
82
|
-
root?: string;
|
|
83
|
-
port?: number;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export declare interface SiteConfig<ThemeConfig = any> {
|
|
87
|
-
root: string;
|
|
88
|
-
srcDir: string;
|
|
89
|
-
site: SiteData<ThemeConfig>;
|
|
90
|
-
configPath: string | undefined;
|
|
91
|
-
themeDir: string;
|
|
92
|
-
outDir: string;
|
|
93
|
-
tempDir: string;
|
|
94
|
-
alias: AliasOptions;
|
|
95
|
-
pages: string[];
|
|
96
|
-
markdown: MarkdownOptions | undefined;
|
|
97
|
-
vue: Options | undefined;
|
|
98
|
-
vite: UserConfig_2 | undefined;
|
|
99
|
-
mpa: boolean;
|
|
63
|
+
export declare interface Router {
|
|
64
|
+
route: Route;
|
|
65
|
+
go: (href?: string) => Promise<void>;
|
|
100
66
|
}
|
|
101
67
|
|
|
102
68
|
export declare interface SiteData<ThemeConfig = any> {
|
|
@@ -133,31 +99,29 @@ export declare interface SiteData<ThemeConfig = any> {
|
|
|
133
99
|
>
|
|
134
100
|
}
|
|
135
101
|
|
|
136
|
-
export declare interface
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
title?: string;
|
|
141
|
-
description?: string;
|
|
142
|
-
head?: HeadConfig[];
|
|
143
|
-
themeConfig?: ThemeConfig;
|
|
144
|
-
locales?: Record<string, LocaleConfig>;
|
|
145
|
-
markdown?: MarkdownOptions;
|
|
146
|
-
/**
|
|
147
|
-
* Opitons to pass on to `@vitejs/plugin-vue`
|
|
148
|
-
*/
|
|
149
|
-
vue?: Options;
|
|
150
|
-
/**
|
|
151
|
-
* Vite config
|
|
152
|
-
*/
|
|
153
|
-
vite?: UserConfig_2;
|
|
154
|
-
srcDir?: string;
|
|
155
|
-
srcExclude?: string[];
|
|
156
|
-
/**
|
|
157
|
-
* Enable MPA / zero-JS mode
|
|
158
|
-
* @experimental
|
|
159
|
-
*/
|
|
160
|
-
mpa?: boolean;
|
|
102
|
+
export declare interface Theme {
|
|
103
|
+
Layout: Component;
|
|
104
|
+
NotFound?: Component;
|
|
105
|
+
enhanceApp?: (ctx: EnhanceAppContext) => void;
|
|
161
106
|
}
|
|
162
107
|
|
|
108
|
+
export declare function useData<T = any>(): VitePressData<T>;
|
|
109
|
+
|
|
110
|
+
export declare function useRoute(): Route;
|
|
111
|
+
|
|
112
|
+
export declare function useRouter(): Router;
|
|
113
|
+
|
|
114
|
+
export declare interface VitePressData<T = any> {
|
|
115
|
+
site: Ref<SiteData<T>>;
|
|
116
|
+
page: Ref<PageData>;
|
|
117
|
+
theme: Ref<T>;
|
|
118
|
+
frontmatter: Ref<PageData['frontmatter']>;
|
|
119
|
+
title: Ref<string>;
|
|
120
|
+
description: Ref<string>;
|
|
121
|
+
lang: Ref<string>;
|
|
122
|
+
localePath: Ref<string>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export declare function withBase(path: string): string;
|
|
126
|
+
|
|
163
127
|
export { }
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { AliasOptions } from 'vite';
|
|
2
|
+
import anchor from 'markdown-it-anchor';
|
|
3
|
+
import { BuildOptions } from 'vite';
|
|
4
|
+
import MarkdownIt from 'markdown-it';
|
|
5
|
+
import { Options } from '@vitejs/plugin-vue';
|
|
6
|
+
import { ServerOptions } from 'vite';
|
|
7
|
+
import { UserConfig as UserConfig_2 } from 'vite';
|
|
8
|
+
import { ViteDevServer } from 'vite';
|
|
9
|
+
|
|
10
|
+
export declare function build(root: string, buildOptions?: BuildOptions & {
|
|
11
|
+
mpa?: string;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
|
|
14
|
+
export declare const createMarkdownRenderer: (srcDir: string, options?: MarkdownOptions) => MarkdownRenderer;
|
|
15
|
+
|
|
16
|
+
export declare function createServer(root?: string, serverOptions?: ServerOptions): Promise<ViteDevServer>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Type config helper
|
|
20
|
+
*/
|
|
21
|
+
export declare function defineConfig(config: RawConfigExports): RawConfigExports;
|
|
22
|
+
|
|
23
|
+
export declare type HeadConfig =
|
|
24
|
+
| [string, Record<string, string>]
|
|
25
|
+
| [string, Record<string, string>, string]
|
|
26
|
+
|
|
27
|
+
export declare interface Header {
|
|
28
|
+
level: number
|
|
29
|
+
title: string
|
|
30
|
+
slug: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export declare interface LocaleConfig {
|
|
34
|
+
lang: string
|
|
35
|
+
title?: string
|
|
36
|
+
description?: string
|
|
37
|
+
head?: HeadConfig[]
|
|
38
|
+
label?: string
|
|
39
|
+
selectText?: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export declare interface MarkdownOptions extends MarkdownIt.Options {
|
|
43
|
+
lineNumbers?: boolean;
|
|
44
|
+
config?: (md: MarkdownIt) => void;
|
|
45
|
+
anchor?: {
|
|
46
|
+
permalink?: anchor.AnchorOptions['permalink'];
|
|
47
|
+
};
|
|
48
|
+
attrs?: {
|
|
49
|
+
leftDelimiter?: string;
|
|
50
|
+
rightDelimiter?: string;
|
|
51
|
+
allowedAttributes?: string[];
|
|
52
|
+
};
|
|
53
|
+
toc?: any;
|
|
54
|
+
externalLinks?: Record<string, string>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export declare interface MarkdownParsedData {
|
|
58
|
+
hoistedTags?: string[];
|
|
59
|
+
links?: string[];
|
|
60
|
+
headers?: Header[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export declare interface MarkdownRenderer {
|
|
64
|
+
__data: MarkdownParsedData;
|
|
65
|
+
render: (src: string, env?: any) => {
|
|
66
|
+
html: string;
|
|
67
|
+
data: any;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export declare type RawConfigExports = UserConfig | Promise<UserConfig> | (() => UserConfig | Promise<UserConfig>);
|
|
72
|
+
|
|
73
|
+
export declare function resolveConfig(root?: string, command?: 'serve' | 'build', mode?: string): Promise<SiteConfig>;
|
|
74
|
+
|
|
75
|
+
export declare function resolveSiteData(root: string, userConfig?: UserConfig, command?: 'serve' | 'build', mode?: string): Promise<SiteData>;
|
|
76
|
+
|
|
77
|
+
export declare function resolveSiteDataByRoute(siteData: SiteData, route: string): SiteData;
|
|
78
|
+
|
|
79
|
+
export declare function serve(options?: ServeOptions): Promise<void>;
|
|
80
|
+
|
|
81
|
+
export declare interface ServeOptions {
|
|
82
|
+
root?: string;
|
|
83
|
+
port?: number;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export declare interface SiteConfig<ThemeConfig = any> {
|
|
87
|
+
root: string;
|
|
88
|
+
srcDir: string;
|
|
89
|
+
site: SiteData<ThemeConfig>;
|
|
90
|
+
configPath: string | undefined;
|
|
91
|
+
themeDir: string;
|
|
92
|
+
outDir: string;
|
|
93
|
+
tempDir: string;
|
|
94
|
+
alias: AliasOptions;
|
|
95
|
+
pages: string[];
|
|
96
|
+
markdown: MarkdownOptions | undefined;
|
|
97
|
+
vue: Options | undefined;
|
|
98
|
+
vite: UserConfig_2 | undefined;
|
|
99
|
+
mpa: boolean;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export declare interface SiteData<ThemeConfig = any> {
|
|
103
|
+
base: string
|
|
104
|
+
/**
|
|
105
|
+
* Language of the site as it should be set on the `html` element.
|
|
106
|
+
* @example `en-US`, `zh-CN`
|
|
107
|
+
*/
|
|
108
|
+
lang: string
|
|
109
|
+
title: string
|
|
110
|
+
description: string
|
|
111
|
+
head: HeadConfig[]
|
|
112
|
+
themeConfig: ThemeConfig
|
|
113
|
+
locales: Record<string, LocaleConfig>
|
|
114
|
+
/**
|
|
115
|
+
* Available locales for the site when it has defined `locales` in its
|
|
116
|
+
* `themeConfig`. This object is otherwise empty. Keys are paths like `/` or
|
|
117
|
+
* `/zh/`.
|
|
118
|
+
*/
|
|
119
|
+
langs: Record<
|
|
120
|
+
string,
|
|
121
|
+
{
|
|
122
|
+
/**
|
|
123
|
+
* Lang attribute as set on the `<html>` element.
|
|
124
|
+
* @example `en-US`, `zh-CN`
|
|
125
|
+
*/
|
|
126
|
+
lang: string
|
|
127
|
+
/**
|
|
128
|
+
* Label to display in the language menu.
|
|
129
|
+
* @example `English`, `简体中文`
|
|
130
|
+
*/
|
|
131
|
+
label: string
|
|
132
|
+
}
|
|
133
|
+
>
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export declare interface UserConfig<ThemeConfig = any> {
|
|
137
|
+
extends?: RawConfigExports;
|
|
138
|
+
lang?: string;
|
|
139
|
+
base?: string;
|
|
140
|
+
title?: string;
|
|
141
|
+
description?: string;
|
|
142
|
+
head?: HeadConfig[];
|
|
143
|
+
themeConfig?: ThemeConfig;
|
|
144
|
+
locales?: Record<string, LocaleConfig>;
|
|
145
|
+
markdown?: MarkdownOptions;
|
|
146
|
+
/**
|
|
147
|
+
* Opitons to pass on to `@vitejs/plugin-vue`
|
|
148
|
+
*/
|
|
149
|
+
vue?: Options;
|
|
150
|
+
/**
|
|
151
|
+
* Vite config
|
|
152
|
+
*/
|
|
153
|
+
vite?: UserConfig_2;
|
|
154
|
+
srcDir?: string;
|
|
155
|
+
srcExclude?: string[];
|
|
156
|
+
/**
|
|
157
|
+
* Enable MPA / zero-JS mode
|
|
158
|
+
* @experimental
|
|
159
|
+
*/
|
|
160
|
+
mpa?: boolean;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export { }
|