@slidev/types 51.6.1 → 51.7.0
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/index.d.mts +847 -838
- package/dist/index.mjs +19 -32
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,51 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Arrayable, Awaitable
|
|
3
|
-
import {
|
|
4
|
-
import { RouteMeta,
|
|
5
|
-
import YAML from
|
|
6
|
-
import { MarkdownItShikiOptions } from
|
|
7
|
-
import { KatexOptions } from
|
|
8
|
-
import { MermaidConfig } from
|
|
9
|
-
import * as monaco from
|
|
10
|
-
import { VitePluginConfig } from
|
|
11
|
-
import { Plugin } from
|
|
12
|
-
import MagicString from
|
|
13
|
-
import Vue from
|
|
14
|
-
import VueJsx from
|
|
15
|
-
import Icons from
|
|
16
|
-
import Components from
|
|
17
|
-
import Markdown from
|
|
18
|
-
import { ViteInspectOptions } from
|
|
19
|
-
import RemoteAssets from
|
|
20
|
-
import { ViteStaticCopyOptions } from
|
|
21
|
-
import ServerRef from
|
|
1
|
+
import { App, Component, ComputedRef, MaybeRefOrGetter, Ref } from "vue";
|
|
2
|
+
import { ArgumentsType, Arrayable, Awaitable } from "@antfu/utils";
|
|
3
|
+
import { BuiltinLanguage, BuiltinTheme, CodeOptionsMeta, CodeOptionsThemes, CodeToHastOptions, CodeToHastOptionsCommon, Highlighter, HighlighterGeneric, LanguageInput } from "shiki";
|
|
4
|
+
import { RouteComponent, RouteMeta, RouteRecordRaw, Router } from "vue-router";
|
|
5
|
+
import YAML from "yaml";
|
|
6
|
+
import { MarkdownItShikiOptions } from "@shikijs/markdown-it";
|
|
7
|
+
import { KatexOptions } from "katex";
|
|
8
|
+
import { MermaidConfig } from "mermaid";
|
|
9
|
+
import * as monaco from "monaco-editor";
|
|
10
|
+
import { VitePluginConfig } from "unocss/vite";
|
|
11
|
+
import { Plugin } from "vite";
|
|
12
|
+
import MagicString from "magic-string-stack";
|
|
13
|
+
import Vue from "@vitejs/plugin-vue";
|
|
14
|
+
import VueJsx from "@vitejs/plugin-vue-jsx";
|
|
15
|
+
import Icons from "unplugin-icons/vite";
|
|
16
|
+
import Components from "unplugin-vue-components/vite";
|
|
17
|
+
import Markdown from "unplugin-vue-markdown/vite";
|
|
18
|
+
import { ViteInspectOptions } from "vite-plugin-inspect";
|
|
19
|
+
import RemoteAssets from "vite-plugin-remote-assets";
|
|
20
|
+
import { ViteStaticCopyOptions } from "vite-plugin-static-copy";
|
|
21
|
+
import ServerRef from "vite-plugin-vue-server-ref";
|
|
22
22
|
|
|
23
|
+
//#region src/cli.d.ts
|
|
23
24
|
interface CommonArgs {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
entry: string;
|
|
26
|
+
theme?: string;
|
|
26
27
|
}
|
|
27
28
|
interface ExportArgs extends CommonArgs {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
'output'?: string;
|
|
30
|
+
'format'?: string;
|
|
31
|
+
'timeout'?: number;
|
|
32
|
+
'wait'?: number;
|
|
33
|
+
'wait-until'?: string;
|
|
34
|
+
'range'?: string;
|
|
35
|
+
'dark'?: boolean;
|
|
36
|
+
'with-clicks'?: boolean;
|
|
37
|
+
'executable-path'?: string;
|
|
38
|
+
'with-toc'?: boolean;
|
|
39
|
+
'per-slide'?: boolean;
|
|
40
|
+
'scale'?: number;
|
|
41
|
+
'omit-background'?: boolean;
|
|
41
42
|
}
|
|
42
43
|
interface BuildArgs extends ExportArgs {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
out: string;
|
|
45
|
+
base?: string;
|
|
46
|
+
download?: boolean;
|
|
47
|
+
inspect: boolean;
|
|
47
48
|
}
|
|
48
49
|
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/clicks.d.ts
|
|
49
52
|
type RawSingleAtValue = null | undefined | boolean | string | number;
|
|
50
53
|
type RawRangeAtValue = null | undefined | false | [string | number, string | number];
|
|
51
54
|
type RawAtValue = RawSingleAtValue | RawRangeAtValue;
|
|
@@ -54,98 +57,100 @@ type NormalizedRangeClickValue = [number, number] | [number, string] | [string,
|
|
|
54
57
|
type NormalizedAtValue = NormalizedSingleClickValue | NormalizedRangeClickValue;
|
|
55
58
|
type ClicksElement = Element | string;
|
|
56
59
|
interface ClicksInfo {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
60
|
+
/**
|
|
61
|
+
* The absolute start click num
|
|
62
|
+
*/
|
|
63
|
+
start: number;
|
|
64
|
+
/**
|
|
65
|
+
* The absolute end click num
|
|
66
|
+
*/
|
|
67
|
+
end: number;
|
|
68
|
+
/**
|
|
69
|
+
* The required total click num
|
|
70
|
+
*/
|
|
71
|
+
max: number;
|
|
72
|
+
/**
|
|
73
|
+
* The delta for relative clicks
|
|
74
|
+
*/
|
|
75
|
+
delta: number;
|
|
76
|
+
/**
|
|
77
|
+
* currentClicks - start
|
|
78
|
+
*/
|
|
79
|
+
currentOffset: ComputedRef<number>;
|
|
80
|
+
/**
|
|
81
|
+
* currentOffset === 0
|
|
82
|
+
*/
|
|
83
|
+
isCurrent: ComputedRef<boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* Computed ref of whether the click is active
|
|
86
|
+
*/
|
|
87
|
+
isActive: ComputedRef<boolean>;
|
|
85
88
|
}
|
|
86
89
|
interface ClicksContext {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
current: number;
|
|
91
|
+
readonly clicksStart: number;
|
|
92
|
+
readonly relativeSizeMap: Map<ClicksElement, number>;
|
|
93
|
+
readonly maxMap: Map<ClicksElement, number>;
|
|
94
|
+
calculateSince: (at: RawSingleAtValue, size?: number) => ClicksInfo | null;
|
|
95
|
+
calculateRange: (at: RawRangeAtValue) => ClicksInfo | null;
|
|
96
|
+
calculate: (at: RawAtValue) => ClicksInfo | null;
|
|
97
|
+
register: (el: ClicksElement, info: Pick<ClicksInfo, 'delta' | 'max'> | null) => void;
|
|
98
|
+
unregister: (el: ClicksElement) => void;
|
|
99
|
+
readonly isMounted: boolean;
|
|
100
|
+
setup: () => void;
|
|
101
|
+
readonly currentOffset: number;
|
|
102
|
+
readonly total: number;
|
|
100
103
|
}
|
|
101
104
|
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/code-runner.d.ts
|
|
102
107
|
interface CodeRunnerContext {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Options passed to runner via the `runnerOptions` prop.
|
|
110
|
+
*/
|
|
111
|
+
options: Record<string, unknown>;
|
|
112
|
+
/**
|
|
113
|
+
* Highlight code with shiki.
|
|
114
|
+
*/
|
|
115
|
+
highlight: (code: string, lang: string, options?: Partial<CodeToHastOptions>) => string;
|
|
116
|
+
/**
|
|
117
|
+
* Use (other) code runner to run code.
|
|
118
|
+
*/
|
|
119
|
+
run: (code: string, lang: string) => Promise<CodeRunnerOutputs>;
|
|
115
120
|
}
|
|
116
121
|
interface CodeRunnerOutputHtml {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
/**
|
|
123
|
+
* The HTML to be rendered.
|
|
124
|
+
*
|
|
125
|
+
* Slidev does NOT sanitize the HTML for you - make sure it's from trusted sources or sanitize it before passing it in
|
|
126
|
+
*/
|
|
127
|
+
html: string;
|
|
123
128
|
}
|
|
124
129
|
interface CodeRunnerOutputDom {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
/**
|
|
131
|
+
* The DOM element to be rendered.
|
|
132
|
+
*/
|
|
133
|
+
element: HTMLElement;
|
|
129
134
|
}
|
|
130
135
|
interface CodeRunnerOutputError {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
136
|
+
/**
|
|
137
|
+
* The error message to be displayed.
|
|
138
|
+
*/
|
|
139
|
+
error: string;
|
|
135
140
|
}
|
|
136
141
|
interface CodeRunnerOutputText {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
142
|
+
/**
|
|
143
|
+
* The text to be displayed.
|
|
144
|
+
*/
|
|
145
|
+
text: string;
|
|
146
|
+
/**
|
|
147
|
+
* The class to be applied to the text.
|
|
148
|
+
*/
|
|
149
|
+
class?: string;
|
|
150
|
+
/**
|
|
151
|
+
* The language to be highlighted.
|
|
152
|
+
*/
|
|
153
|
+
highlightLang?: string;
|
|
149
154
|
}
|
|
150
155
|
type CodeRunnerOutputTextArray = CodeRunnerOutputText[];
|
|
151
156
|
type CodeRunnerOutput = CodeRunnerOutputHtml | CodeRunnerOutputError | CodeRunnerOutputText | CodeRunnerOutputTextArray | CodeRunnerOutputDom;
|
|
@@ -153,797 +158,796 @@ type CodeRunnerOutputs = MaybeRefOrGetter<Arrayable<CodeRunnerOutput>>;
|
|
|
153
158
|
type CodeRunner = (code: string, ctx: CodeRunnerContext) => Awaitable<CodeRunnerOutputs>;
|
|
154
159
|
type CodeRunnerProviders = Record<string, CodeRunner>;
|
|
155
160
|
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/builtin-layouts.d.ts
|
|
156
163
|
type BuiltinLayouts = '404' | 'center' | 'cover' | 'default' | 'end' | 'error' | 'fact' | 'full' | 'iframe-left' | 'iframe-right' | 'iframe' | 'image-left' | 'image-right' | 'image' | 'intro' | 'none' | 'quote' | 'section' | 'statement' | 'two-cols-header' | 'two-cols';
|
|
157
164
|
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/types.d.ts
|
|
158
167
|
type FrontmatterStyle = 'frontmatter' | 'yaml';
|
|
159
168
|
interface SlideInfoBase {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
169
|
+
revision: string;
|
|
170
|
+
frontmatter: Record<string, any>;
|
|
171
|
+
content: string;
|
|
172
|
+
frontmatterRaw?: string;
|
|
173
|
+
note?: string;
|
|
174
|
+
title?: string;
|
|
175
|
+
level?: number;
|
|
167
176
|
}
|
|
168
177
|
interface SourceSlideInfo extends SlideInfoBase {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
178
|
+
/**
|
|
179
|
+
* The filepath of the markdown file
|
|
180
|
+
*/
|
|
181
|
+
filepath: string;
|
|
182
|
+
/**
|
|
183
|
+
* The index of the slide in the markdown file
|
|
184
|
+
*/
|
|
185
|
+
index: number;
|
|
186
|
+
/**
|
|
187
|
+
* The range of the slide in the markdown file
|
|
188
|
+
*/
|
|
189
|
+
start: number;
|
|
190
|
+
contentStart: number;
|
|
191
|
+
end: number;
|
|
192
|
+
raw: string;
|
|
193
|
+
/**
|
|
194
|
+
* Raw content before being processed by preparsers (if any)
|
|
195
|
+
*/
|
|
196
|
+
contentRaw: string;
|
|
197
|
+
/**
|
|
198
|
+
* Slides import by this slide.
|
|
199
|
+
*/
|
|
200
|
+
imports?: SourceSlideInfo[];
|
|
201
|
+
frontmatterDoc?: YAML.Document;
|
|
202
|
+
frontmatterStyle?: FrontmatterStyle;
|
|
194
203
|
}
|
|
195
204
|
interface SlideInfo extends SlideInfoBase {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
/**
|
|
206
|
+
* The index of the slide in the presentation
|
|
207
|
+
*/
|
|
208
|
+
index: number;
|
|
209
|
+
/**
|
|
210
|
+
* The importers of this slide. `[]` if this slide is the entry markdown file
|
|
211
|
+
*/
|
|
212
|
+
importChain?: SourceSlideInfo[];
|
|
213
|
+
/**
|
|
214
|
+
* The source slide where the content is from
|
|
215
|
+
*/
|
|
216
|
+
source: SourceSlideInfo;
|
|
217
|
+
noteHTML?: string;
|
|
209
218
|
}
|
|
210
219
|
/**
|
|
211
220
|
* Editable fields for a slide
|
|
212
221
|
*/
|
|
213
222
|
type SlidePatch = Partial<Pick<SlideInfoBase, 'content' | 'note' | 'frontmatterRaw'>> & {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
223
|
+
skipHmr?: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* The frontmatter patch (only the changed fields)
|
|
226
|
+
* `null` to remove a field
|
|
227
|
+
*/
|
|
228
|
+
frontmatter?: Record<string, any>;
|
|
220
229
|
};
|
|
221
230
|
/**
|
|
222
231
|
* Metadata for "slidev" field in themes' package.json
|
|
223
232
|
*/
|
|
224
233
|
interface SlidevThemeMeta {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
234
|
+
defaults?: Partial<SlidevConfig>;
|
|
235
|
+
colorSchema?: 'dark' | 'light' | 'both';
|
|
236
|
+
highlighter?: 'shiki';
|
|
228
237
|
}
|
|
229
238
|
type SlidevThemeConfig = Record<string, string | number>;
|
|
230
239
|
interface SlidevDetectedFeatures {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
240
|
+
katex: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* `false` or referenced module specifiers
|
|
243
|
+
*/
|
|
244
|
+
monaco: false | {
|
|
245
|
+
types: string[];
|
|
246
|
+
deps: string[];
|
|
247
|
+
};
|
|
248
|
+
tweet: boolean;
|
|
249
|
+
mermaid: boolean;
|
|
241
250
|
}
|
|
242
251
|
interface SlidevMarkdown {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
252
|
+
filepath: string;
|
|
253
|
+
raw: string;
|
|
254
|
+
/**
|
|
255
|
+
* All slides in this markdown file
|
|
256
|
+
*/
|
|
257
|
+
slides: SourceSlideInfo[];
|
|
258
|
+
errors?: {
|
|
259
|
+
row: number;
|
|
260
|
+
message: string;
|
|
261
|
+
}[];
|
|
253
262
|
}
|
|
254
263
|
interface SlidevData {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
264
|
+
/**
|
|
265
|
+
* Slides that should be rendered (disabled slides excluded)
|
|
266
|
+
*/
|
|
267
|
+
slides: SlideInfo[];
|
|
268
|
+
entry: SlidevMarkdown;
|
|
269
|
+
config: SlidevConfig;
|
|
270
|
+
headmatter: Record<string, unknown>;
|
|
271
|
+
features: SlidevDetectedFeatures;
|
|
272
|
+
themeMeta?: SlidevThemeMeta;
|
|
273
|
+
markdownFiles: Record<string, SlidevMarkdown>;
|
|
274
|
+
/**
|
|
275
|
+
* From watched files to indexes of slides that must be reloaded regardless of the loaded content
|
|
276
|
+
*/
|
|
277
|
+
watchFiles: Record<string, Set<number>>;
|
|
269
278
|
}
|
|
270
279
|
interface SlidevPreparserExtension {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
280
|
+
name?: string;
|
|
281
|
+
transformRawLines?: (lines: string[]) => Promise<void> | void;
|
|
282
|
+
transformSlide?: (content: string, frontmatter: any) => Promise<string | undefined>;
|
|
283
|
+
transformNote?: (note: string | undefined, frontmatter: any) => Promise<string | undefined>;
|
|
275
284
|
}
|
|
276
285
|
type PreparserExtensionLoader = (headmatter: Record<string, unknown>, filepath: string, mode?: string) => Promise<SlidevPreparserExtension[]>;
|
|
277
286
|
type RenderContext = 'none' | 'slide' | 'overview' | 'presenter' | 'previewNext';
|
|
278
287
|
interface SlideRoute {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
288
|
+
no: number;
|
|
289
|
+
meta: RouteMeta & Required<Pick<RouteMeta, 'slide'>>;
|
|
290
|
+
/**
|
|
291
|
+
* load the slide component itself
|
|
292
|
+
*/
|
|
293
|
+
load: () => Promise<{
|
|
294
|
+
default: RouteComponent;
|
|
295
|
+
}>;
|
|
296
|
+
/**
|
|
297
|
+
* Wrapped async component
|
|
298
|
+
*/
|
|
299
|
+
component: Component;
|
|
291
300
|
}
|
|
292
301
|
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region src/frontmatter.d.ts
|
|
293
304
|
interface Headmatter extends HeadmatterConfig, Omit<Frontmatter, 'title'> {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
305
|
+
/**
|
|
306
|
+
* Default frontmatter options applied to all slides
|
|
307
|
+
*/
|
|
308
|
+
defaults?: Frontmatter;
|
|
298
309
|
}
|
|
299
310
|
interface HeadmatterConfig extends TransitionOptions {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
311
|
+
/**
|
|
312
|
+
* Title of the slides
|
|
313
|
+
*/
|
|
314
|
+
title?: string;
|
|
315
|
+
/**
|
|
316
|
+
* String template to compose title
|
|
317
|
+
*
|
|
318
|
+
* @example "%s - Slidev" - to suffix " - Slidev" to all pages
|
|
319
|
+
* @default '%s - Slidev'
|
|
320
|
+
*/
|
|
321
|
+
titleTemplate?: string;
|
|
322
|
+
/**
|
|
323
|
+
* Theme to use for the slides
|
|
324
|
+
*
|
|
325
|
+
* See https://sli.dev/guide/theme-addon#use-theme
|
|
326
|
+
* @default 'default'
|
|
327
|
+
*/
|
|
328
|
+
theme?: string;
|
|
329
|
+
/**
|
|
330
|
+
* List of Slidev addons
|
|
331
|
+
*
|
|
332
|
+
* @default []
|
|
333
|
+
*/
|
|
334
|
+
addons?: string[];
|
|
335
|
+
/**
|
|
336
|
+
* Download remote assets in local using vite-plugin-remote-assets
|
|
337
|
+
*
|
|
338
|
+
* @default false
|
|
339
|
+
*/
|
|
340
|
+
remoteAssets?: boolean | 'dev' | 'build';
|
|
341
|
+
/**
|
|
342
|
+
* Show a download button in the SPA build,
|
|
343
|
+
* could also be a link to custom pdf
|
|
344
|
+
*
|
|
345
|
+
* @default false
|
|
346
|
+
*/
|
|
347
|
+
download?: boolean | string;
|
|
348
|
+
/**
|
|
349
|
+
* Show a copy button in code blocks
|
|
350
|
+
*
|
|
351
|
+
* @default true
|
|
352
|
+
*/
|
|
353
|
+
codeCopy?: boolean;
|
|
354
|
+
/**
|
|
355
|
+
* The author of the slides
|
|
356
|
+
*/
|
|
357
|
+
author?: string;
|
|
358
|
+
/**
|
|
359
|
+
* Information shows on the built SPA
|
|
360
|
+
* Can be a markdown string
|
|
361
|
+
*
|
|
362
|
+
* @default false
|
|
363
|
+
*/
|
|
364
|
+
info?: string | boolean;
|
|
365
|
+
/**
|
|
366
|
+
* Prefer highlighter
|
|
367
|
+
*
|
|
368
|
+
* See https://sli.dev/custom/config-highlighter.html
|
|
369
|
+
* @default shiki
|
|
370
|
+
*/
|
|
371
|
+
highlighter?: 'shiki';
|
|
372
|
+
/**
|
|
373
|
+
* Enable Twoslash
|
|
374
|
+
*
|
|
375
|
+
* @default true
|
|
376
|
+
*/
|
|
377
|
+
twoslash?: boolean | 'dev' | 'build';
|
|
378
|
+
/**
|
|
379
|
+
* Show line numbers in code blocks
|
|
380
|
+
*
|
|
381
|
+
* @default false
|
|
382
|
+
*/
|
|
383
|
+
lineNumbers?: boolean;
|
|
384
|
+
/**
|
|
385
|
+
* Force slides color schema
|
|
386
|
+
*
|
|
387
|
+
* @default 'auto'
|
|
388
|
+
*/
|
|
389
|
+
colorSchema?: 'dark' | 'light' | 'all' | 'auto';
|
|
390
|
+
/**
|
|
391
|
+
* Router mode for vue-router
|
|
392
|
+
*
|
|
393
|
+
* @default 'history'
|
|
394
|
+
*/
|
|
395
|
+
routerMode?: 'hash' | 'history';
|
|
396
|
+
/**
|
|
397
|
+
* Aspect ratio for slides
|
|
398
|
+
* should be like `16/9` or `1:1`
|
|
399
|
+
*
|
|
400
|
+
* @default '16/9'
|
|
401
|
+
*/
|
|
402
|
+
aspectRatio?: number | string;
|
|
403
|
+
/**
|
|
404
|
+
* The actual width for slides canvas.
|
|
405
|
+
* unit in px.
|
|
406
|
+
*
|
|
407
|
+
* @default '980'
|
|
408
|
+
*/
|
|
409
|
+
canvasWidth?: number;
|
|
410
|
+
/**
|
|
411
|
+
* Controls whether texts in slides are selectable
|
|
412
|
+
*
|
|
413
|
+
* @default true
|
|
414
|
+
*/
|
|
415
|
+
selectable?: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* Configure for themes, will inject intro root styles as
|
|
418
|
+
* `--slidev-theme-x` for attribute `x`
|
|
419
|
+
*
|
|
420
|
+
* This allows themes to have customization options in frontmatter
|
|
421
|
+
* Refer to themes' document for options avaliable
|
|
422
|
+
*
|
|
423
|
+
* @default {}
|
|
424
|
+
*/
|
|
425
|
+
themeConfig?: SlidevThemeConfig;
|
|
426
|
+
/**
|
|
427
|
+
* Configure fonts for the slides and app
|
|
428
|
+
*
|
|
429
|
+
* @default {}
|
|
430
|
+
*/
|
|
431
|
+
fonts?: FontOptions;
|
|
432
|
+
/**
|
|
433
|
+
* Configure the icon for app
|
|
434
|
+
*
|
|
435
|
+
* @default 'https://cdn.jsdelivr.net/gh/slidevjs/slidev/assets/favicon.png'
|
|
436
|
+
*/
|
|
437
|
+
favicon?: string;
|
|
438
|
+
/**
|
|
439
|
+
* Options for drawings
|
|
440
|
+
*
|
|
441
|
+
* @default {}
|
|
442
|
+
*/
|
|
443
|
+
drawings?: DrawingsOptions;
|
|
444
|
+
/**
|
|
445
|
+
* URL of PlantUML server used to render diagrams
|
|
446
|
+
*
|
|
447
|
+
* @default https://www.plantuml.com/plantuml
|
|
448
|
+
*/
|
|
449
|
+
plantUmlServer?: string;
|
|
450
|
+
/**
|
|
451
|
+
* Enable slides recording
|
|
452
|
+
*
|
|
453
|
+
* @default 'dev'
|
|
454
|
+
*/
|
|
455
|
+
record?: boolean | 'dev' | 'build';
|
|
456
|
+
/**
|
|
457
|
+
* Expose the server to inbound requests (listen to `0.0.0.0`)
|
|
458
|
+
*
|
|
459
|
+
* Pass a string to set the password for accessing presenter mode.
|
|
460
|
+
*
|
|
461
|
+
* @default false
|
|
462
|
+
*/
|
|
463
|
+
remote?: string | boolean;
|
|
464
|
+
/**
|
|
465
|
+
* Engine for Atomic CSS
|
|
466
|
+
*
|
|
467
|
+
* See https://unocss.dev/
|
|
468
|
+
* @deprecated
|
|
469
|
+
* @default 'unocss'
|
|
470
|
+
*/
|
|
471
|
+
css?: 'unocss';
|
|
472
|
+
/**
|
|
473
|
+
* Enable presenter mode
|
|
474
|
+
*
|
|
475
|
+
* @default true
|
|
476
|
+
*/
|
|
477
|
+
presenter?: boolean | 'dev' | 'build';
|
|
478
|
+
/**
|
|
479
|
+
* Enable browser exporter
|
|
480
|
+
*
|
|
481
|
+
* @default 'dev'
|
|
482
|
+
*/
|
|
483
|
+
browserExporter?: boolean | 'dev' | 'build';
|
|
484
|
+
/**
|
|
485
|
+
* Attributes to apply to the HTML element
|
|
486
|
+
*
|
|
487
|
+
* @default {}
|
|
488
|
+
*/
|
|
489
|
+
htmlAttrs?: Record<string, string>;
|
|
490
|
+
/**
|
|
491
|
+
* Suppport MDC syntax
|
|
492
|
+
*
|
|
493
|
+
* See https://github.com/antfu/markdown-it-mdc
|
|
494
|
+
*
|
|
495
|
+
* See https://content.nuxtjs.org/guide/writing/mdc
|
|
496
|
+
*
|
|
497
|
+
* @default false
|
|
498
|
+
*/
|
|
499
|
+
mdc?: boolean;
|
|
500
|
+
/**
|
|
501
|
+
* Enable built-in editor
|
|
502
|
+
*
|
|
503
|
+
* @default true
|
|
504
|
+
*/
|
|
505
|
+
editor?: boolean;
|
|
506
|
+
/**
|
|
507
|
+
* Enable context menu
|
|
508
|
+
*
|
|
509
|
+
* @default true
|
|
510
|
+
*/
|
|
511
|
+
contextMenu?: boolean | 'dev' | 'build' | null;
|
|
512
|
+
/**
|
|
513
|
+
* Enable wake lock
|
|
514
|
+
*/
|
|
515
|
+
wakeLock?: boolean | 'dev' | 'build';
|
|
516
|
+
/**
|
|
517
|
+
* Force the filename used when exporting the presentation.
|
|
518
|
+
* The extension, e.g. .pdf, gets automatically added.
|
|
519
|
+
*
|
|
520
|
+
* @default ''
|
|
521
|
+
*/
|
|
522
|
+
exportFilename?: string | null;
|
|
523
|
+
/**
|
|
524
|
+
* Enable Monaco
|
|
525
|
+
*
|
|
526
|
+
* See https://sli.dev/custom/config-monaco.html
|
|
527
|
+
* @default true
|
|
528
|
+
*/
|
|
529
|
+
monaco?: boolean | 'dev' | 'build';
|
|
530
|
+
/**
|
|
531
|
+
* Where to load monaco types from
|
|
532
|
+
*
|
|
533
|
+
* - `cdn` - load from CDN with `@typescript/ata`
|
|
534
|
+
* - `local` - load from local node_modules
|
|
535
|
+
*
|
|
536
|
+
* @default 'local'
|
|
537
|
+
*/
|
|
538
|
+
monacoTypesSource?: 'cdn' | 'local' | 'none';
|
|
539
|
+
/**
|
|
540
|
+
* Additional node packages to load as monaco types
|
|
541
|
+
*
|
|
542
|
+
* @default []
|
|
543
|
+
*/
|
|
544
|
+
monacoTypesAdditionalPackages?: string[];
|
|
545
|
+
/**
|
|
546
|
+
* Packages to ignore when loading monaco types
|
|
547
|
+
*
|
|
548
|
+
* @default []
|
|
549
|
+
*/
|
|
550
|
+
monacoTypesIgnorePackages?: string[];
|
|
551
|
+
/**
|
|
552
|
+
* Additional local modules to load as dependencies of monaco runnable
|
|
553
|
+
*
|
|
554
|
+
* @default []
|
|
555
|
+
*/
|
|
556
|
+
monacoRunAdditionalDeps?: string[];
|
|
557
|
+
/**
|
|
558
|
+
* Seo meta tags settings
|
|
559
|
+
*
|
|
560
|
+
* @default {}
|
|
561
|
+
*/
|
|
562
|
+
seoMeta?: SeoMeta;
|
|
552
563
|
}
|
|
553
564
|
interface Frontmatter extends TransitionOptions {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
565
|
+
/**
|
|
566
|
+
* Slide layout to use
|
|
567
|
+
*
|
|
568
|
+
* Default to 'cover' for the first slide, 'default' for the rest
|
|
569
|
+
*/
|
|
570
|
+
layout?: BuiltinLayouts | string;
|
|
571
|
+
/**
|
|
572
|
+
* Custom class added to the slide root element
|
|
573
|
+
*/
|
|
574
|
+
class?: string | string[] | Record<string, unknown>;
|
|
575
|
+
/**
|
|
576
|
+
* Manually specified the total clicks needed to this slide
|
|
577
|
+
*
|
|
578
|
+
* When not specified, the clicks will be calculated by the usage of v-clicks
|
|
579
|
+
*
|
|
580
|
+
* See https://sli.dev/guide/animations
|
|
581
|
+
*/
|
|
582
|
+
clicks?: number;
|
|
583
|
+
/**
|
|
584
|
+
* Manually specified the total clicks needed to this slide to start
|
|
585
|
+
*
|
|
586
|
+
* @default 0
|
|
587
|
+
*/
|
|
588
|
+
clicksStart?: number;
|
|
589
|
+
/**
|
|
590
|
+
* Preload the slide when the previous slide is active
|
|
591
|
+
* @default true
|
|
592
|
+
*/
|
|
593
|
+
preload?: boolean;
|
|
594
|
+
/**
|
|
595
|
+
* Completely hide and disable the slide
|
|
596
|
+
*/
|
|
597
|
+
hide?: boolean;
|
|
598
|
+
/**
|
|
599
|
+
* Same as `hide`, completely hide and disable the slide
|
|
600
|
+
*/
|
|
601
|
+
disabled?: boolean;
|
|
602
|
+
/**
|
|
603
|
+
* Hide the slide for the `<Toc>` components
|
|
604
|
+
*
|
|
605
|
+
* See https://sli.dev/builtin/components#toc
|
|
606
|
+
*/
|
|
607
|
+
hideInToc?: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* Override the title for the `<TitleRenderer>` and `<Toc>` components
|
|
610
|
+
* Only if `title` has also been declared
|
|
611
|
+
*/
|
|
612
|
+
title?: string;
|
|
613
|
+
/**
|
|
614
|
+
* Override the title level for the `<TitleRenderer>` and `<Toc>` components
|
|
615
|
+
* Only if `title` has also been declared
|
|
616
|
+
*/
|
|
617
|
+
level?: number;
|
|
618
|
+
/**
|
|
619
|
+
* Create a route alias that can be used in the URL or with the `<Link>` component
|
|
620
|
+
*/
|
|
621
|
+
routeAlias?: string;
|
|
622
|
+
/**
|
|
623
|
+
* Custom zoom level for the slide
|
|
624
|
+
* @default 1
|
|
625
|
+
*/
|
|
626
|
+
zoom?: number;
|
|
627
|
+
/**
|
|
628
|
+
* Store the positions of draggable elements
|
|
629
|
+
* Normally you don't need to set this manually
|
|
630
|
+
*
|
|
631
|
+
* See https://sli.dev/features/draggable
|
|
632
|
+
*/
|
|
633
|
+
dragPos?: Record<string, string>;
|
|
634
|
+
/**
|
|
635
|
+
* Includes a markdown file
|
|
636
|
+
*
|
|
637
|
+
* See https://sli.dev/guide/syntax.html#importing-slides
|
|
638
|
+
*/
|
|
639
|
+
src?: string;
|
|
629
640
|
}
|
|
630
641
|
interface DrawingsOptions {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
642
|
+
/**
|
|
643
|
+
* Persist the drawings to disk
|
|
644
|
+
* Passing string to specify the directory (default to `.slidev/drawings`)
|
|
645
|
+
*
|
|
646
|
+
* @default false
|
|
647
|
+
*/
|
|
648
|
+
persist?: boolean | string;
|
|
649
|
+
/**
|
|
650
|
+
* @default true
|
|
651
|
+
*/
|
|
652
|
+
enabled?: boolean | 'dev' | 'build';
|
|
653
|
+
/**
|
|
654
|
+
* Only allow drawing from presenter mode
|
|
655
|
+
*
|
|
656
|
+
* @default false
|
|
657
|
+
*/
|
|
658
|
+
presenterOnly?: boolean;
|
|
659
|
+
/**
|
|
660
|
+
* Sync drawing for all instances
|
|
661
|
+
*
|
|
662
|
+
* @default true
|
|
663
|
+
*/
|
|
664
|
+
syncAll?: boolean;
|
|
654
665
|
}
|
|
655
666
|
interface FontOptions {
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
667
|
+
/**
|
|
668
|
+
* Sans serif fonts (default fonts for most text)
|
|
669
|
+
*/
|
|
670
|
+
sans?: string | string[];
|
|
671
|
+
/**
|
|
672
|
+
* Serif fonts
|
|
673
|
+
*/
|
|
674
|
+
serif?: string | string[];
|
|
675
|
+
/**
|
|
676
|
+
* Monospace fonts, for code blocks and etc.
|
|
677
|
+
*/
|
|
678
|
+
mono?: string | string[];
|
|
679
|
+
/**
|
|
680
|
+
* Load webfonts for custom CSS (does not apply anywhere by default)
|
|
681
|
+
*/
|
|
682
|
+
custom?: string | string[];
|
|
683
|
+
/**
|
|
684
|
+
* Weights for fonts
|
|
685
|
+
*
|
|
686
|
+
* @default [200, 400, 600]
|
|
687
|
+
*/
|
|
688
|
+
weights?: string | (string | number)[];
|
|
689
|
+
/**
|
|
690
|
+
* Import italic fonts
|
|
691
|
+
*
|
|
692
|
+
* @default false
|
|
693
|
+
*/
|
|
694
|
+
italic?: boolean;
|
|
695
|
+
/**
|
|
696
|
+
* @default 'google'
|
|
697
|
+
*/
|
|
698
|
+
provider?: 'none' | 'google' | 'coollabs';
|
|
699
|
+
/**
|
|
700
|
+
* Specify web fonts names, will detect from `sans`, `mono`, `serif` if not provided
|
|
701
|
+
*/
|
|
702
|
+
webfonts?: string[];
|
|
703
|
+
/**
|
|
704
|
+
* Specify local fonts names, be excluded from webfonts
|
|
705
|
+
*/
|
|
706
|
+
local?: string[];
|
|
707
|
+
/**
|
|
708
|
+
* Use fonts fallback
|
|
709
|
+
*
|
|
710
|
+
* @default true
|
|
711
|
+
*/
|
|
712
|
+
fallbacks?: boolean;
|
|
702
713
|
}
|
|
703
714
|
type BuiltinSlideTransition = 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'fade' | 'zoom' | 'none';
|
|
704
715
|
interface TransitionOptions {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
716
|
+
/**
|
|
717
|
+
* Page transition, powered by Vue's `<TransitionGroup/>`
|
|
718
|
+
*
|
|
719
|
+
* Built-in transitions:
|
|
720
|
+
* - fade
|
|
721
|
+
* - fade-out
|
|
722
|
+
* - slide-left
|
|
723
|
+
* - slide-right
|
|
724
|
+
* - slide-up
|
|
725
|
+
* - slide-down
|
|
726
|
+
*
|
|
727
|
+
* See https://sli.dev/guide/animations.html#pages-transitions
|
|
728
|
+
*
|
|
729
|
+
* See https://vuejs.org/guide/built-ins/transition.html
|
|
730
|
+
*/
|
|
731
|
+
transition?: BuiltinSlideTransition | string | TransitionGroupProps | null;
|
|
721
732
|
}
|
|
722
733
|
interface TransitionGroupProps {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
734
|
+
appear?: boolean;
|
|
735
|
+
persisted?: boolean;
|
|
736
|
+
tag?: string;
|
|
737
|
+
moveClass?: string;
|
|
738
|
+
css?: boolean;
|
|
739
|
+
duration?: number | {
|
|
740
|
+
enter: number;
|
|
741
|
+
leave: number;
|
|
742
|
+
};
|
|
743
|
+
enterFromClass?: string;
|
|
744
|
+
enterActiveClass?: string;
|
|
745
|
+
enterToClass?: string;
|
|
746
|
+
appearFromClass?: string;
|
|
747
|
+
appearActiveClass?: string;
|
|
748
|
+
appearToClass?: string;
|
|
749
|
+
leaveFromClass?: string;
|
|
750
|
+
leaveActiveClass?: string;
|
|
751
|
+
leaveToClass?: string;
|
|
741
752
|
}
|
|
742
753
|
/**
|
|
743
754
|
* The following type should map to unhead MataFlat type
|
|
744
755
|
*/
|
|
745
756
|
interface SeoMeta {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
}
|
|
757
|
-
|
|
757
|
+
ogTitle?: string;
|
|
758
|
+
ogDescription?: string;
|
|
759
|
+
ogImage?: string;
|
|
760
|
+
ogUrl?: string;
|
|
761
|
+
twitterCard?: 'summary' | 'summary_large_image' | 'app' | 'player';
|
|
762
|
+
twitterSite?: string;
|
|
763
|
+
twitterTitle?: string;
|
|
764
|
+
twitterDescription?: string;
|
|
765
|
+
twitterImage?: string;
|
|
766
|
+
twitterUrl?: string;
|
|
767
|
+
} //#endregion
|
|
768
|
+
//#region src/config.d.ts
|
|
758
769
|
interface ResolvedSlidevConfigSub {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
}
|
|
764
|
-
interface SlidevConfig extends Omit<Required<HeadmatterConfig>, keyof ResolvedSlidevConfigSub>, ResolvedSlidevConfigSub {
|
|
770
|
+
export: ResolvedExportOptions;
|
|
771
|
+
drawings: ResolvedDrawingsOptions;
|
|
772
|
+
fonts: ResolvedFontOptions;
|
|
773
|
+
aspectRatio: number;
|
|
765
774
|
}
|
|
775
|
+
interface SlidevConfig extends Omit<Required<HeadmatterConfig>, keyof ResolvedSlidevConfigSub>, ResolvedSlidevConfigSub {}
|
|
766
776
|
interface ResolvedFontOptions {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
777
|
+
sans: string[];
|
|
778
|
+
mono: string[];
|
|
779
|
+
serif: string[];
|
|
780
|
+
weights: string[];
|
|
781
|
+
italic: boolean;
|
|
782
|
+
provider: 'none' | 'google' | 'coollabs';
|
|
783
|
+
webfonts: string[];
|
|
784
|
+
local: string[];
|
|
775
785
|
}
|
|
776
786
|
interface ResolvedDrawingsOptions {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
787
|
+
persist: string | false;
|
|
788
|
+
enabled: boolean | 'dev' | 'build';
|
|
789
|
+
presenterOnly: boolean;
|
|
790
|
+
syncAll: boolean;
|
|
781
791
|
}
|
|
782
792
|
interface ResolvedExportOptions extends Omit<ExportArgs, 'entry' | 'theme'> {
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
793
|
+
withClicks?: boolean;
|
|
794
|
+
executablePath?: string;
|
|
795
|
+
withToc?: boolean;
|
|
786
796
|
}
|
|
787
797
|
|
|
798
|
+
//#endregion
|
|
799
|
+
//#region src/context-menu.d.ts
|
|
788
800
|
type ContextMenuOption = {
|
|
789
|
-
|
|
790
|
-
|
|
801
|
+
action: () => void;
|
|
802
|
+
disabled?: boolean;
|
|
791
803
|
} & ({
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
804
|
+
small?: false;
|
|
805
|
+
icon?: Component | string;
|
|
806
|
+
label: string | Component;
|
|
795
807
|
} | {
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
808
|
+
small: true;
|
|
809
|
+
icon: Component | string;
|
|
810
|
+
label: string;
|
|
799
811
|
});
|
|
800
812
|
type ContextMenuItem = ContextMenuOption | 'separator';
|
|
801
813
|
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
'slidev:update-slide': {
|
|
805
|
-
no: number;
|
|
806
|
-
data: SlideInfo;
|
|
807
|
-
};
|
|
808
|
-
'slidev:update-note': {
|
|
809
|
-
no: number;
|
|
810
|
-
note: string;
|
|
811
|
-
noteHTML: string;
|
|
812
|
-
};
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
|
|
814
|
+
//#endregion
|
|
815
|
+
//#region src/options.d.ts
|
|
816
816
|
interface RootsInfo {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
817
|
+
cliRoot: string;
|
|
818
|
+
clientRoot: string;
|
|
819
|
+
userRoot: string;
|
|
820
|
+
userPkgJson: Record<string, any>;
|
|
821
|
+
userWorkspaceRoot: string;
|
|
822
822
|
}
|
|
823
823
|
interface SlidevEntryOptions {
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
824
|
+
/**
|
|
825
|
+
* Markdown entry
|
|
826
|
+
*/
|
|
827
|
+
entry: string;
|
|
828
|
+
/**
|
|
829
|
+
* Theme id
|
|
830
|
+
*/
|
|
831
|
+
theme?: string;
|
|
832
|
+
/**
|
|
833
|
+
* Remote password
|
|
834
|
+
*/
|
|
835
|
+
remote?: string;
|
|
836
|
+
/**
|
|
837
|
+
* Enable inspect plugin
|
|
838
|
+
*/
|
|
839
|
+
inspect?: boolean;
|
|
840
|
+
/**
|
|
841
|
+
* Build with --download option
|
|
842
|
+
*/
|
|
843
|
+
download?: boolean;
|
|
844
|
+
/**
|
|
845
|
+
* Base URL in dev or build mode
|
|
846
|
+
*/
|
|
847
|
+
base?: string;
|
|
848
848
|
}
|
|
849
849
|
interface ResolvedSlidevOptions extends RootsInfo, SlidevEntryOptions {
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
850
|
+
data: SlidevData;
|
|
851
|
+
themeRaw: string;
|
|
852
|
+
themeRoots: string[];
|
|
853
|
+
addonRoots: string[];
|
|
854
|
+
/**
|
|
855
|
+
* =`[...themeRoots, ...addonRoots, userRoot]` (`clientRoot` excluded)
|
|
856
|
+
*/
|
|
857
|
+
roots: string[];
|
|
858
|
+
mode: 'dev' | 'build' | 'export';
|
|
859
|
+
utils: ResolvedSlidevUtils;
|
|
860
860
|
}
|
|
861
861
|
interface ResolvedSlidevUtils {
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
862
|
+
shiki: HighlighterGeneric<any, any>;
|
|
863
|
+
shikiOptions: MarkdownItShikiOptions;
|
|
864
|
+
katexOptions: KatexOptions | null;
|
|
865
|
+
indexHtml: string;
|
|
866
|
+
define: Record<string, string>;
|
|
867
|
+
iconsResolvePath: string[];
|
|
868
|
+
isMonacoTypesIgnored: (pkg: string) => boolean;
|
|
869
|
+
getLayouts: () => Record<string, string>;
|
|
870
870
|
}
|
|
871
871
|
interface SlidevServerOptions {
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
872
|
+
/**
|
|
873
|
+
* @returns `false` if server should be restarted
|
|
874
|
+
*/
|
|
875
|
+
loadData?: (loadedSource: Record<string, string>) => Promise<SlidevData | false>;
|
|
876
876
|
}
|
|
877
877
|
|
|
878
|
+
//#endregion
|
|
879
|
+
//#region src/transform.d.ts
|
|
878
880
|
interface MarkdownTransformContext {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
881
|
+
/**
|
|
882
|
+
* The magic string instance for the current markdown content
|
|
883
|
+
*/
|
|
884
|
+
s: MagicString;
|
|
885
|
+
/**
|
|
886
|
+
* The slide info of the current slide
|
|
887
|
+
*/
|
|
888
|
+
slide: SlideInfo;
|
|
889
|
+
/**
|
|
890
|
+
* Resolved Slidev options
|
|
891
|
+
*/
|
|
892
|
+
options: ResolvedSlidevOptions;
|
|
891
893
|
}
|
|
892
894
|
type MarkdownTransformer = (ctx: MarkdownTransformContext) => Awaitable<void>;
|
|
893
895
|
|
|
896
|
+
//#endregion
|
|
897
|
+
//#region src/setups.d.ts
|
|
894
898
|
interface AppContext {
|
|
895
|
-
|
|
896
|
-
|
|
899
|
+
app: App;
|
|
900
|
+
router: Router;
|
|
897
901
|
}
|
|
898
902
|
interface MonacoSetupReturn {
|
|
899
|
-
|
|
903
|
+
editorOptions?: monaco.editor.IEditorOptions;
|
|
900
904
|
}
|
|
901
905
|
interface NavOperations {
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
906
|
+
next: () => void;
|
|
907
|
+
prev: () => Promise<void>;
|
|
908
|
+
nextSlide: () => void;
|
|
909
|
+
prevSlide: () => Promise<void>;
|
|
910
|
+
go: (index: number) => void;
|
|
911
|
+
goFirst: () => void;
|
|
912
|
+
goLast: () => void;
|
|
913
|
+
downloadPDF: () => Promise<void>;
|
|
914
|
+
toggleDark: () => void;
|
|
915
|
+
toggleOverview: () => void;
|
|
916
|
+
toggleDrawing: () => void;
|
|
917
|
+
escapeOverview: () => void;
|
|
918
|
+
showGotoDialog: () => void;
|
|
915
919
|
}
|
|
916
920
|
interface ShortcutOptions {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
+
key: string | Ref<boolean>;
|
|
922
|
+
fn?: () => void;
|
|
923
|
+
autoRepeat?: boolean;
|
|
924
|
+
name?: string;
|
|
921
925
|
}
|
|
922
926
|
interface ShikiContext {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
927
|
+
/**
|
|
928
|
+
* @deprecated Pass directly the theme name it's supported by Shiki.
|
|
929
|
+
* For custom themes, load it manually via `JSON.parse(fs.readFileSync(path, 'utf-8'))` and pass the raw JSON object instead.
|
|
930
|
+
*/
|
|
931
|
+
loadTheme: (path: string) => Promise<any>;
|
|
928
932
|
}
|
|
929
933
|
type ShikiSetupReturn = Partial<Omit<CodeToHastOptionsCommon<BuiltinLanguage>, 'lang'> & CodeOptionsThemes<BuiltinTheme> & CodeOptionsMeta & {
|
|
930
|
-
|
|
931
|
-
|
|
934
|
+
setup: (highlighter: Highlighter) => Awaitable<void>;
|
|
935
|
+
langs: (LanguageInput | BuiltinLanguage)[];
|
|
932
936
|
}>;
|
|
933
937
|
interface TransformersSetupReturn {
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
+
pre: (MarkdownTransformer | false)[];
|
|
939
|
+
preCodeblock: (MarkdownTransformer | false)[];
|
|
940
|
+
postCodeblock: (MarkdownTransformer | false)[];
|
|
941
|
+
post: (MarkdownTransformer | false)[];
|
|
938
942
|
}
|
|
939
943
|
type ShikiSetup = (shiki: ShikiContext) => Awaitable<ShikiSetupReturn | void>;
|
|
940
944
|
type KatexSetup = () => Awaitable<Partial<KatexOptions> | void>;
|
|
941
945
|
type UnoSetup = () => Awaitable<Partial<VitePluginConfig> | void>;
|
|
942
946
|
type TransformersSetup = () => Awaitable<Partial<TransformersSetupReturn>>;
|
|
943
947
|
type PreparserSetup = (context: {
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
948
|
+
filepath: string;
|
|
949
|
+
headmatter: Record<string, unknown>;
|
|
950
|
+
mode?: string;
|
|
947
951
|
}) => Awaitable<SlidevPreparserExtension[]>;
|
|
948
952
|
type VitePluginsSetup = (options: ResolvedSlidevOptions) => Awaitable<Plugin[]>;
|
|
949
953
|
type MonacoSetup = (m: typeof monaco) => Awaitable<MonacoSetupReturn | void>;
|
|
@@ -969,40 +973,45 @@ declare const defineVitePluginsSetup: (fn: VitePluginsSetup) => VitePluginsSetup
|
|
|
969
973
|
declare const defineCodeRunnersSetup: (fn: CodeRunnersSetup) => CodeRunnersSetup;
|
|
970
974
|
declare const defineContextMenuSetup: (fn: ContextMenuSetup) => ContextMenuSetup;
|
|
971
975
|
|
|
976
|
+
//#endregion
|
|
977
|
+
//#region src/toc.d.ts
|
|
972
978
|
interface TocItem {
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
979
|
+
no: number;
|
|
980
|
+
active?: boolean;
|
|
981
|
+
activeParent?: boolean;
|
|
982
|
+
children: TocItem[];
|
|
983
|
+
hasActiveParent?: boolean;
|
|
984
|
+
level: number;
|
|
985
|
+
titleLevel: number;
|
|
986
|
+
path: string;
|
|
987
|
+
hideInToc?: boolean;
|
|
988
|
+
title?: string;
|
|
983
989
|
}
|
|
984
990
|
|
|
991
|
+
//#endregion
|
|
992
|
+
//#region src/vite.d.ts
|
|
985
993
|
interface SlidevPluginOptions {
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
994
|
+
vue?: ArgumentsType<typeof Vue>[0];
|
|
995
|
+
vuejsx?: ArgumentsType<typeof VueJsx>[0];
|
|
996
|
+
markdown?: ArgumentsType<typeof Markdown>[0];
|
|
997
|
+
components?: ArgumentsType<typeof Components>[0];
|
|
998
|
+
icons?: ArgumentsType<typeof Icons>[0];
|
|
999
|
+
remoteAssets?: ArgumentsType<typeof RemoteAssets>[0];
|
|
1000
|
+
serverRef?: ArgumentsType<typeof ServerRef>[0];
|
|
1001
|
+
unocss?: VitePluginConfig;
|
|
1002
|
+
staticCopy?: ViteStaticCopyOptions;
|
|
1003
|
+
inspect?: ViteInspectOptions;
|
|
996
1004
|
}
|
|
997
1005
|
declare module 'vite' {
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
+
interface UserConfig {
|
|
1007
|
+
/**
|
|
1008
|
+
* Custom internal plugin options for Slidev (advanced)
|
|
1009
|
+
*
|
|
1010
|
+
* See https://github.com/slidevjs/slidev/blob/main/packages/slidev/node/options.ts#L50
|
|
1011
|
+
*/
|
|
1012
|
+
slidev?: SlidevPluginOptions;
|
|
1013
|
+
}
|
|
1006
1014
|
}
|
|
1007
1015
|
|
|
1008
|
-
|
|
1016
|
+
//#endregion
|
|
1017
|
+
export { AppContext, AppSetup, BuildArgs, BuiltinSlideTransition, ClicksContext, ClicksElement, ClicksInfo, CodeRunner, CodeRunnerContext, CodeRunnerOutput, CodeRunnerOutputDom, CodeRunnerOutputError, CodeRunnerOutputHtml, CodeRunnerOutputText, CodeRunnerOutputTextArray, CodeRunnerOutputs, CodeRunnerProviders, CodeRunnersSetup, CommonArgs, ContextMenuItem, ContextMenuSetup, DrawingsOptions, ExportArgs, FontOptions, Frontmatter, FrontmatterStyle, Headmatter, HeadmatterConfig, KatexSetup, MarkdownTransformContext, MarkdownTransformer, MermaidSetup, MonacoSetup, MonacoSetupReturn, NavOperations, NormalizedAtValue, NormalizedRangeClickValue, NormalizedSingleClickValue, PreparserExtensionLoader, PreparserSetup, RawAtValue, RawRangeAtValue, RawSingleAtValue, RenderContext, ResolvedDrawingsOptions, ResolvedExportOptions, ResolvedFontOptions, ResolvedSlidevConfigSub, ResolvedSlidevOptions, ResolvedSlidevUtils, RootSetup, RootsInfo, RoutesSetup, SeoMeta, ShikiContext, ShikiSetup, ShikiSetupReturn, ShortcutOptions, ShortcutsSetup, SlideInfo, SlideInfoBase, SlidePatch, SlideRoute, SlidevConfig, SlidevData, SlidevDetectedFeatures, SlidevEntryOptions, SlidevMarkdown, SlidevPluginOptions, SlidevPreparserExtension, SlidevServerOptions, SlidevThemeConfig, SlidevThemeMeta, SourceSlideInfo, TocItem, TransformersSetup, TransformersSetupReturn, TransitionGroupProps, TransitionOptions, UnoSetup, VitePluginsSetup, defineAppSetup, defineCodeRunnersSetup, defineContextMenuSetup, defineKatexSetup, defineMermaidSetup, defineMonacoSetup, definePreparserSetup, defineRootSetup, defineRoutesSetup, defineShikiSetup, defineShortcutsSetup, defineTransformersSetup, defineUnoSetup, defineVitePluginsSetup };
|