@slidev/types 0.49.16 → 0.49.18
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 +178 -146
- package/dist/index.mjs +2 -0
- package/package.json +9 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { RouteMeta, RouteComponent, Router, RouteRecordRaw } from 'vue-router';
|
|
2
2
|
import YAML from 'yaml';
|
|
3
|
-
import { TransitionGroupProps,
|
|
3
|
+
import { TransitionGroupProps, Component, MaybeRefOrGetter, App, Ref, ComputedRef } from 'vue';
|
|
4
4
|
import { Arrayable, Awaitable, ArgumentsType } from '@antfu/utils';
|
|
5
5
|
import * as monaco from 'monaco-editor';
|
|
6
|
-
import mermaid from 'mermaid';
|
|
7
6
|
import { KatexOptions } from 'katex';
|
|
8
7
|
import { CodeToHastOptions, CodeToHastOptionsCommon, BuiltinLanguage, CodeOptionsThemes, BuiltinTheme, CodeOptionsMeta, Highlighter, LanguageInput } from 'shiki';
|
|
9
8
|
import { VitePluginConfig } from 'unocss/vite';
|
|
9
|
+
import { MermaidConfig } from 'mermaid';
|
|
10
|
+
import MagicString from 'magic-string-stack';
|
|
11
|
+
import { MarkdownItShikiOptions } from '@shikijs/markdown-it/index.mjs';
|
|
12
|
+
import { HighlighterGeneric } from 'shiki/types.mjs';
|
|
10
13
|
import Vue from '@vitejs/plugin-vue';
|
|
11
14
|
import VueJsx from '@vitejs/plugin-vue-jsx';
|
|
12
15
|
import Icons from 'unplugin-icons/vite';
|
|
@@ -14,7 +17,8 @@ import Components from 'unplugin-vue-components/vite';
|
|
|
14
17
|
import Markdown from 'unplugin-vue-markdown/vite';
|
|
15
18
|
import RemoteAssets from 'vite-plugin-remote-assets';
|
|
16
19
|
import ServerRef from 'vite-plugin-vue-server-ref';
|
|
17
|
-
import
|
|
20
|
+
import { ViteStaticCopyOptions } from 'vite-plugin-static-copy';
|
|
21
|
+
import { Options } from 'vite-plugin-inspect';
|
|
18
22
|
|
|
19
23
|
interface CommonArgs {
|
|
20
24
|
entry: string;
|
|
@@ -41,152 +45,108 @@ interface BuildArgs extends ExportArgs {
|
|
|
41
45
|
inspect: boolean;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
|
-
interface
|
|
45
|
-
|
|
48
|
+
interface Headmatter {
|
|
49
|
+
/**
|
|
50
|
+
* Title of the slides
|
|
51
|
+
*/
|
|
52
|
+
title?: string;
|
|
46
53
|
/**
|
|
47
54
|
* String template to compose title
|
|
48
55
|
*
|
|
49
56
|
* @example "%s - Slidev" - to suffix " - Slidev" to all pages
|
|
50
57
|
* @default '%s - Slidev'
|
|
51
58
|
*/
|
|
52
|
-
titleTemplate
|
|
59
|
+
titleTemplate?: string;
|
|
53
60
|
/**
|
|
54
61
|
* Theme to use for the slides
|
|
55
62
|
*
|
|
56
63
|
* @see https://sli.dev/themes/use.html
|
|
57
64
|
* @default 'default'
|
|
58
65
|
*/
|
|
59
|
-
theme
|
|
66
|
+
theme?: string;
|
|
60
67
|
/**
|
|
61
68
|
* List of Slidev addons
|
|
62
69
|
*
|
|
63
70
|
* @default []
|
|
64
71
|
*/
|
|
65
|
-
addons
|
|
72
|
+
addons?: string[];
|
|
66
73
|
/**
|
|
67
74
|
* Download remote assets in local using vite-plugin-remote-assets
|
|
68
75
|
*
|
|
69
76
|
* @default false
|
|
70
77
|
*/
|
|
71
|
-
remoteAssets
|
|
72
|
-
/**
|
|
73
|
-
* Enable Monaco
|
|
74
|
-
*
|
|
75
|
-
* @see https://sli.dev/custom/config-monaco.html
|
|
76
|
-
* @default true
|
|
77
|
-
*/
|
|
78
|
-
monaco: boolean | 'dev' | 'build';
|
|
79
|
-
/**
|
|
80
|
-
* Where to load monaco types from
|
|
81
|
-
*
|
|
82
|
-
* - `cdn` - load from CDN with `@typescript/ata`
|
|
83
|
-
* - `local` - load from local node_modules
|
|
84
|
-
*
|
|
85
|
-
* @default 'local'
|
|
86
|
-
*/
|
|
87
|
-
monacoTypesSource: 'cdn' | 'local' | 'none';
|
|
88
|
-
/**
|
|
89
|
-
* Additional node packages to load as monaco types
|
|
90
|
-
*
|
|
91
|
-
* @default []
|
|
92
|
-
*/
|
|
93
|
-
monacoTypesAdditionalPackages: string[];
|
|
94
|
-
/**
|
|
95
|
-
* Packages to ignore when loading monaco types
|
|
96
|
-
*
|
|
97
|
-
* @default []
|
|
98
|
-
*/
|
|
99
|
-
monacoTypesIgnorePackages: string[];
|
|
100
|
-
/**
|
|
101
|
-
* Additional local modules to load as dependencies of monaco runnable
|
|
102
|
-
*
|
|
103
|
-
* @default []
|
|
104
|
-
*/
|
|
105
|
-
monacoRunAdditionalDeps: string[];
|
|
78
|
+
remoteAssets?: boolean | 'dev' | 'build';
|
|
106
79
|
/**
|
|
107
80
|
* Show a download button in the SPA build,
|
|
108
81
|
* could also be a link to custom pdf
|
|
109
82
|
*
|
|
110
83
|
* @default false
|
|
111
84
|
*/
|
|
112
|
-
download
|
|
113
|
-
/**
|
|
114
|
-
* Options for export
|
|
115
|
-
*
|
|
116
|
-
* @default {}
|
|
117
|
-
*/
|
|
118
|
-
export: ResolvedExportOptions;
|
|
85
|
+
download?: boolean | string;
|
|
119
86
|
/**
|
|
120
87
|
* Show a copy button in code blocks
|
|
121
88
|
*
|
|
122
89
|
* @default true
|
|
123
90
|
*/
|
|
124
|
-
codeCopy
|
|
91
|
+
codeCopy?: boolean;
|
|
125
92
|
/**
|
|
126
93
|
* Information shows on the built SPA
|
|
127
94
|
* Can be a markdown string
|
|
128
95
|
*
|
|
129
96
|
* @default false
|
|
130
97
|
*/
|
|
131
|
-
info
|
|
98
|
+
info?: string | boolean;
|
|
132
99
|
/**
|
|
133
100
|
* Prefer highlighter
|
|
134
101
|
*
|
|
135
|
-
* @see https://sli.dev/custom/
|
|
102
|
+
* @see https://sli.dev/custom/config-highlighter.html
|
|
136
103
|
* @default shiki
|
|
137
104
|
*/
|
|
138
|
-
highlighter
|
|
105
|
+
highlighter?: 'shiki' | 'prism';
|
|
139
106
|
/**
|
|
140
107
|
* Enable Twoslash
|
|
141
108
|
*
|
|
142
109
|
* @default true
|
|
143
110
|
*/
|
|
144
|
-
twoslash
|
|
111
|
+
twoslash?: boolean | 'dev' | 'build';
|
|
145
112
|
/**
|
|
146
113
|
* Show line numbers in code blocks
|
|
147
114
|
*
|
|
148
115
|
* @default false
|
|
149
116
|
*/
|
|
150
|
-
lineNumbers
|
|
117
|
+
lineNumbers?: boolean;
|
|
151
118
|
/**
|
|
152
119
|
* Force slides color schema
|
|
153
120
|
*
|
|
154
121
|
* @default 'auto'
|
|
155
122
|
*/
|
|
156
|
-
colorSchema
|
|
123
|
+
colorSchema?: 'dark' | 'light' | 'all' | 'auto';
|
|
157
124
|
/**
|
|
158
125
|
* Router mode for vue-router
|
|
159
126
|
*
|
|
160
127
|
* @default 'history'
|
|
161
128
|
*/
|
|
162
|
-
routerMode
|
|
129
|
+
routerMode?: 'hash' | 'history';
|
|
163
130
|
/**
|
|
164
131
|
* Aspect ratio for slides
|
|
165
132
|
* should be like `16/9` or `1:1`
|
|
166
133
|
*
|
|
167
134
|
* @default '16/9'
|
|
168
135
|
*/
|
|
169
|
-
aspectRatio
|
|
136
|
+
aspectRatio?: number;
|
|
170
137
|
/**
|
|
171
138
|
* The actual width for slides canvas.
|
|
172
139
|
* unit in px.
|
|
173
140
|
*
|
|
174
141
|
* @default '980'
|
|
175
142
|
*/
|
|
176
|
-
canvasWidth
|
|
177
|
-
/**
|
|
178
|
-
* Force the filename used when exporting the presentation.
|
|
179
|
-
* The extension, e.g. .pdf, gets automatically added.
|
|
180
|
-
*
|
|
181
|
-
* @default ''
|
|
182
|
-
*/
|
|
183
|
-
exportFilename: string | null;
|
|
143
|
+
canvasWidth?: number;
|
|
184
144
|
/**
|
|
185
145
|
* Controls whether texts in slides are selectable
|
|
186
146
|
*
|
|
187
147
|
* @default true
|
|
188
148
|
*/
|
|
189
|
-
selectable
|
|
149
|
+
selectable?: boolean;
|
|
190
150
|
/**
|
|
191
151
|
* Configure for themes, will inject intro root styles as
|
|
192
152
|
* `--slidev-theme-x` for attribute `x`
|
|
@@ -196,37 +156,37 @@ interface SlidevConfig {
|
|
|
196
156
|
*
|
|
197
157
|
* @default {}
|
|
198
158
|
*/
|
|
199
|
-
themeConfig
|
|
159
|
+
themeConfig?: SlidevThemeConfig;
|
|
200
160
|
/**
|
|
201
161
|
* Configure fonts for the slides and app
|
|
202
162
|
*
|
|
203
163
|
* @default {}
|
|
204
164
|
*/
|
|
205
|
-
fonts
|
|
165
|
+
fonts?: ResolvedFontOptions;
|
|
206
166
|
/**
|
|
207
167
|
* Configure the icon for app
|
|
208
168
|
*
|
|
209
169
|
* @default 'https://cdn.jsdelivr.net/gh/slidevjs/slidev/assets/favicon.png'
|
|
210
170
|
*/
|
|
211
|
-
favicon
|
|
171
|
+
favicon?: string;
|
|
212
172
|
/**
|
|
213
173
|
* Options for drawings
|
|
214
174
|
*
|
|
215
175
|
* @default {}
|
|
216
176
|
*/
|
|
217
|
-
drawings
|
|
177
|
+
drawings?: ResolvedDrawingsOptions;
|
|
218
178
|
/**
|
|
219
179
|
* URL of PlantUML server used to render diagrams
|
|
220
180
|
*
|
|
221
181
|
* @default https://www.plantuml.com/plantuml
|
|
222
182
|
*/
|
|
223
|
-
plantUmlServer
|
|
183
|
+
plantUmlServer?: string;
|
|
224
184
|
/**
|
|
225
185
|
* Enable slides recording
|
|
226
186
|
*
|
|
227
187
|
* @default 'dev'
|
|
228
188
|
*/
|
|
229
|
-
record
|
|
189
|
+
record?: boolean | 'dev' | 'build';
|
|
230
190
|
/**
|
|
231
191
|
* Expose the server to inbound requests (listen to `0.0.0.0`)
|
|
232
192
|
*
|
|
@@ -242,19 +202,19 @@ interface SlidevConfig {
|
|
|
242
202
|
* @deprecated
|
|
243
203
|
* @default 'unocss'
|
|
244
204
|
*/
|
|
245
|
-
css
|
|
205
|
+
css?: 'unocss';
|
|
246
206
|
/**
|
|
247
207
|
* Enable presenter mode
|
|
248
208
|
*
|
|
249
209
|
* @default true
|
|
250
210
|
*/
|
|
251
|
-
presenter
|
|
211
|
+
presenter?: boolean | 'dev' | 'build';
|
|
252
212
|
/**
|
|
253
213
|
* Attributes to apply to the HTML element
|
|
254
214
|
*
|
|
255
215
|
* @default {}
|
|
256
216
|
*/
|
|
257
|
-
htmlAttrs
|
|
217
|
+
htmlAttrs?: Record<string, string>;
|
|
258
218
|
/**
|
|
259
219
|
* Page transition, powered by Vue's <TransitionGroup/>
|
|
260
220
|
*
|
|
@@ -269,7 +229,7 @@ interface SlidevConfig {
|
|
|
269
229
|
* @see https://sli.dev/guide/animations.html#pages-transitions
|
|
270
230
|
* @see https://vuejs.org/guide/built-ins/transition.html
|
|
271
231
|
*/
|
|
272
|
-
transition?: BuiltinSlideTransition | string | TransitionGroupProps;
|
|
232
|
+
transition?: BuiltinSlideTransition | string | TransitionGroupProps | null;
|
|
273
233
|
/**
|
|
274
234
|
* Suppport MDC syntax
|
|
275
235
|
*
|
|
@@ -284,17 +244,66 @@ interface SlidevConfig {
|
|
|
284
244
|
*
|
|
285
245
|
* @default true
|
|
286
246
|
*/
|
|
287
|
-
editor
|
|
247
|
+
editor?: boolean;
|
|
288
248
|
/**
|
|
289
249
|
* Enable context menu
|
|
290
250
|
*
|
|
291
251
|
* @default true
|
|
292
252
|
*/
|
|
293
|
-
contextMenu
|
|
253
|
+
contextMenu?: boolean | 'dev' | 'build' | null;
|
|
294
254
|
/**
|
|
295
255
|
* Enable wake lock
|
|
296
256
|
*/
|
|
297
|
-
wakeLock
|
|
257
|
+
wakeLock?: boolean | 'dev' | 'build';
|
|
258
|
+
/**
|
|
259
|
+
* Options for export
|
|
260
|
+
*
|
|
261
|
+
* @default {}
|
|
262
|
+
*/
|
|
263
|
+
export?: ResolvedExportOptions;
|
|
264
|
+
/**
|
|
265
|
+
* Force the filename used when exporting the presentation.
|
|
266
|
+
* The extension, e.g. .pdf, gets automatically added.
|
|
267
|
+
*
|
|
268
|
+
* @default ''
|
|
269
|
+
*/
|
|
270
|
+
exportFilename?: string | null;
|
|
271
|
+
/**
|
|
272
|
+
* Enable Monaco
|
|
273
|
+
*
|
|
274
|
+
* @see https://sli.dev/custom/config-monaco.html
|
|
275
|
+
* @default true
|
|
276
|
+
*/
|
|
277
|
+
monaco?: boolean | 'dev' | 'build';
|
|
278
|
+
/**
|
|
279
|
+
* Where to load monaco types from
|
|
280
|
+
*
|
|
281
|
+
* - `cdn` - load from CDN with `@typescript/ata`
|
|
282
|
+
* - `local` - load from local node_modules
|
|
283
|
+
*
|
|
284
|
+
* @default 'local'
|
|
285
|
+
*/
|
|
286
|
+
monacoTypesSource?: 'cdn' | 'local' | 'none';
|
|
287
|
+
/**
|
|
288
|
+
* Additional node packages to load as monaco types
|
|
289
|
+
*
|
|
290
|
+
* @default []
|
|
291
|
+
*/
|
|
292
|
+
monacoTypesAdditionalPackages?: string[];
|
|
293
|
+
/**
|
|
294
|
+
* Packages to ignore when loading monaco types
|
|
295
|
+
*
|
|
296
|
+
* @default []
|
|
297
|
+
*/
|
|
298
|
+
monacoTypesIgnorePackages?: string[];
|
|
299
|
+
/**
|
|
300
|
+
* Additional local modules to load as dependencies of monaco runnable
|
|
301
|
+
*
|
|
302
|
+
* @default []
|
|
303
|
+
*/
|
|
304
|
+
monacoRunAdditionalDeps?: string[];
|
|
305
|
+
}
|
|
306
|
+
interface SlidevConfig extends Required<Headmatter> {
|
|
298
307
|
}
|
|
299
308
|
interface FontOptions {
|
|
300
309
|
/**
|
|
@@ -507,9 +516,16 @@ type RenderContext = 'none' | 'slide' | 'overview' | 'presenter' | 'previewNext'
|
|
|
507
516
|
interface SlideRoute {
|
|
508
517
|
no: number;
|
|
509
518
|
meta: RouteMeta & Required<Pick<RouteMeta, 'slide'>>;
|
|
510
|
-
|
|
519
|
+
/**
|
|
520
|
+
* load the slide component itself
|
|
521
|
+
*/
|
|
522
|
+
load: () => Promise<{
|
|
511
523
|
default: RouteComponent;
|
|
512
524
|
}>;
|
|
525
|
+
/**
|
|
526
|
+
* Wrapped async component
|
|
527
|
+
*/
|
|
528
|
+
component: Component;
|
|
513
529
|
}
|
|
514
530
|
type LoadedSnippets = Record<string, string>;
|
|
515
531
|
|
|
@@ -581,6 +597,72 @@ type ContextMenuOption = {
|
|
|
581
597
|
});
|
|
582
598
|
type ContextMenuItem = ContextMenuOption | 'separator';
|
|
583
599
|
|
|
600
|
+
interface RootsInfo {
|
|
601
|
+
cliRoot: string;
|
|
602
|
+
clientRoot: string;
|
|
603
|
+
userRoot: string;
|
|
604
|
+
userPkgJson: Record<string, any>;
|
|
605
|
+
userWorkspaceRoot: string;
|
|
606
|
+
}
|
|
607
|
+
interface SlidevEntryOptions {
|
|
608
|
+
/**
|
|
609
|
+
* Markdown entry
|
|
610
|
+
*/
|
|
611
|
+
entry: string;
|
|
612
|
+
/**
|
|
613
|
+
* Theme id
|
|
614
|
+
*/
|
|
615
|
+
theme?: string;
|
|
616
|
+
/**
|
|
617
|
+
* Remote password
|
|
618
|
+
*/
|
|
619
|
+
remote?: string;
|
|
620
|
+
/**
|
|
621
|
+
* Enable inspect plugin
|
|
622
|
+
*/
|
|
623
|
+
inspect?: boolean;
|
|
624
|
+
}
|
|
625
|
+
interface ResolvedSlidevOptions extends RootsInfo, SlidevEntryOptions {
|
|
626
|
+
data: SlidevData;
|
|
627
|
+
themeRaw: string;
|
|
628
|
+
themeRoots: string[];
|
|
629
|
+
addonRoots: string[];
|
|
630
|
+
/**
|
|
631
|
+
* =`[...themeRoots, ...addonRoots, userRoot]` (`clientRoot` excluded)
|
|
632
|
+
*/
|
|
633
|
+
roots: string[];
|
|
634
|
+
mode: 'dev' | 'build' | 'export';
|
|
635
|
+
utils: ResolvedSlidevUtils;
|
|
636
|
+
}
|
|
637
|
+
interface ResolvedSlidevUtils {
|
|
638
|
+
shiki: HighlighterGeneric<any, any>;
|
|
639
|
+
shikiOptions: MarkdownItShikiOptions;
|
|
640
|
+
isMonacoTypesIgnored: (pkg: string) => boolean;
|
|
641
|
+
getLayouts: () => Record<string, string>;
|
|
642
|
+
}
|
|
643
|
+
interface SlidevServerOptions {
|
|
644
|
+
/**
|
|
645
|
+
* @returns `false` if server should be restarted
|
|
646
|
+
*/
|
|
647
|
+
loadData?: () => Promise<SlidevData | false>;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
interface MarkdownTransformContext {
|
|
651
|
+
/**
|
|
652
|
+
* The magic string instance for the current markdown content
|
|
653
|
+
*/
|
|
654
|
+
s: MagicString;
|
|
655
|
+
/**
|
|
656
|
+
* The slide info of the current slide
|
|
657
|
+
*/
|
|
658
|
+
slide: SlideInfo;
|
|
659
|
+
/**
|
|
660
|
+
* Resolved Slidev options
|
|
661
|
+
*/
|
|
662
|
+
options: ResolvedSlidevOptions;
|
|
663
|
+
}
|
|
664
|
+
type MarkdownTransformer = (ctx: MarkdownTransformContext) => void;
|
|
665
|
+
|
|
584
666
|
interface AppContext {
|
|
585
667
|
app: App;
|
|
586
668
|
router: Router;
|
|
@@ -588,7 +670,6 @@ interface AppContext {
|
|
|
588
670
|
interface MonacoSetupReturn {
|
|
589
671
|
editorOptions?: monaco.editor.IEditorOptions;
|
|
590
672
|
}
|
|
591
|
-
type MermaidOptions = (typeof mermaid.initialize) extends (a: infer A) => any ? A : never;
|
|
592
673
|
interface NavOperations {
|
|
593
674
|
next: () => void;
|
|
594
675
|
prev: () => Promise<void>;
|
|
@@ -621,19 +702,26 @@ type ShikiSetupReturn = Partial<Omit<CodeToHastOptionsCommon<BuiltinLanguage>, '
|
|
|
621
702
|
setup: (highlighter: Highlighter) => Awaitable<void>;
|
|
622
703
|
langs: (LanguageInput | BuiltinLanguage)[];
|
|
623
704
|
}>;
|
|
705
|
+
interface TransformersSetupReturn {
|
|
706
|
+
pre: (MarkdownTransformer | false)[];
|
|
707
|
+
preCodeblock: (MarkdownTransformer | false)[];
|
|
708
|
+
postCodeblock: (MarkdownTransformer | false)[];
|
|
709
|
+
post: (MarkdownTransformer | false)[];
|
|
710
|
+
}
|
|
624
711
|
type ShikiSetup = (shiki: ShikiContext) => Awaitable<ShikiSetupReturn | void>;
|
|
625
712
|
type KatexSetup = () => Awaitable<Partial<KatexOptions> | void>;
|
|
626
713
|
type UnoSetup = () => Awaitable<Partial<VitePluginConfig> | void>;
|
|
714
|
+
type TransformersSetup = () => Awaitable<Partial<TransformersSetupReturn>>;
|
|
627
715
|
type PreparserSetup = (context: {
|
|
628
716
|
filepath: string;
|
|
629
717
|
headmatter: Record<string, unknown>;
|
|
630
718
|
mode?: string;
|
|
631
|
-
}) => SlidevPreparserExtension[]
|
|
719
|
+
}) => Awaitable<SlidevPreparserExtension[]>;
|
|
632
720
|
type MonacoSetup = (m: typeof monaco) => Awaitable<MonacoSetupReturn | void>;
|
|
633
721
|
type AppSetup = (context: AppContext) => Awaitable<void>;
|
|
634
722
|
type RootSetup = () => Awaitable<void>;
|
|
635
723
|
type RoutesSetup = (routes: RouteRecordRaw[]) => RouteRecordRaw[];
|
|
636
|
-
type MermaidSetup = () => Partial<
|
|
724
|
+
type MermaidSetup = () => Awaitable<Partial<MermaidConfig> | void>;
|
|
637
725
|
type ShortcutsSetup = (nav: NavOperations, defaultShortcuts: ShortcutOptions[]) => Array<ShortcutOptions>;
|
|
638
726
|
type CodeRunnersSetup = (runners: CodeRunnerProviders) => Awaitable<CodeRunnerProviders | void>;
|
|
639
727
|
type ContextMenuSetup = (items: ComputedRef<ContextMenuItem[]>) => ComputedRef<ContextMenuItem[]>;
|
|
@@ -646,6 +734,7 @@ declare const defineRoutesSetup: (fn: RoutesSetup) => RoutesSetup;
|
|
|
646
734
|
declare const defineMermaidSetup: (fn: MermaidSetup) => MermaidSetup;
|
|
647
735
|
declare const defineKatexSetup: (fn: KatexSetup) => KatexSetup;
|
|
648
736
|
declare const defineShortcutsSetup: (fn: ShortcutsSetup) => ShortcutsSetup;
|
|
737
|
+
declare const defineTransformersSetup: (fn: TransformersSetup) => TransformersSetup;
|
|
649
738
|
declare const definePreparserSetup: (fn: PreparserSetup) => PreparserSetup;
|
|
650
739
|
declare const defineCodeRunnersSetup: (fn: CodeRunnersSetup) => CodeRunnersSetup;
|
|
651
740
|
declare const defineContextMenuSetup: (fn: ContextMenuSetup) => ContextMenuSetup;
|
|
@@ -677,57 +766,6 @@ declare module 'vite' {
|
|
|
677
766
|
}
|
|
678
767
|
}
|
|
679
768
|
|
|
680
|
-
interface RootsInfo {
|
|
681
|
-
cliRoot: string;
|
|
682
|
-
clientRoot: string;
|
|
683
|
-
userRoot: string;
|
|
684
|
-
userPkgJson: Record<string, any>;
|
|
685
|
-
userWorkspaceRoot: string;
|
|
686
|
-
}
|
|
687
|
-
interface SlidevEntryOptions {
|
|
688
|
-
/**
|
|
689
|
-
* Markdown entry
|
|
690
|
-
*/
|
|
691
|
-
entry: string;
|
|
692
|
-
/**
|
|
693
|
-
* Theme id
|
|
694
|
-
*/
|
|
695
|
-
theme?: string;
|
|
696
|
-
/**
|
|
697
|
-
* Remote password
|
|
698
|
-
*/
|
|
699
|
-
remote?: string;
|
|
700
|
-
/**
|
|
701
|
-
* Enable inspect plugin
|
|
702
|
-
*/
|
|
703
|
-
inspect?: boolean;
|
|
704
|
-
}
|
|
705
|
-
interface ResolvedSlidevOptions extends RootsInfo {
|
|
706
|
-
data: SlidevData;
|
|
707
|
-
entry: string;
|
|
708
|
-
themeRaw: string;
|
|
709
|
-
theme: string;
|
|
710
|
-
themeRoots: string[];
|
|
711
|
-
addonRoots: string[];
|
|
712
|
-
/**
|
|
713
|
-
* =`[...themeRoots, ...addonRoots, userRoot]` (`clientRoot` excluded)
|
|
714
|
-
*/
|
|
715
|
-
roots: string[];
|
|
716
|
-
mode: 'dev' | 'build' | 'export';
|
|
717
|
-
remote?: string;
|
|
718
|
-
inspect?: boolean;
|
|
719
|
-
utils: ResolvedSlidevUtils;
|
|
720
|
-
}
|
|
721
|
-
interface ResolvedSlidevUtils {
|
|
722
|
-
isMonacoTypesIgnored: (pkg: string) => boolean;
|
|
723
|
-
}
|
|
724
|
-
interface SlidevServerOptions {
|
|
725
|
-
/**
|
|
726
|
-
* @returns `false` if server should be restarted
|
|
727
|
-
*/
|
|
728
|
-
loadData?: () => Promise<SlidevData | false>;
|
|
729
|
-
}
|
|
730
|
-
|
|
731
769
|
interface SlidevPluginOptions {
|
|
732
770
|
vue?: ArgumentsType<typeof Vue>[0];
|
|
733
771
|
vuejsx?: ArgumentsType<typeof VueJsx>[0];
|
|
@@ -737,6 +775,8 @@ interface SlidevPluginOptions {
|
|
|
737
775
|
remoteAssets?: ArgumentsType<typeof RemoteAssets>[0];
|
|
738
776
|
serverRef?: ArgumentsType<typeof ServerRef>[0];
|
|
739
777
|
unocss?: VitePluginConfig;
|
|
778
|
+
staticCopy?: ViteStaticCopyOptions;
|
|
779
|
+
inspect?: Options;
|
|
740
780
|
}
|
|
741
781
|
declare module 'vite' {
|
|
742
782
|
interface UserConfig {
|
|
@@ -749,13 +789,6 @@ declare module 'vite' {
|
|
|
749
789
|
}
|
|
750
790
|
}
|
|
751
791
|
|
|
752
|
-
interface MarkdownTransformContext {
|
|
753
|
-
s: MagicString;
|
|
754
|
-
id: string;
|
|
755
|
-
options: ResolvedSlidevOptions;
|
|
756
|
-
}
|
|
757
|
-
type MarkdownTransformer = (ctx: MarkdownTransformContext) => void;
|
|
758
|
-
|
|
759
792
|
type RawSingleAtValue = null | undefined | boolean | string | number;
|
|
760
793
|
type RawRangeAtValue = null | undefined | false | [string | number, string | number];
|
|
761
794
|
type RawAtValue = RawSingleAtValue | RawRangeAtValue;
|
|
@@ -804,10 +837,9 @@ interface ClicksContext {
|
|
|
804
837
|
register: (el: ClicksElement, info: Pick<ClicksInfo, 'delta' | 'max'> | null) => void;
|
|
805
838
|
unregister: (el: ClicksElement) => void;
|
|
806
839
|
readonly isMounted: boolean;
|
|
807
|
-
|
|
808
|
-
onUnmounted: () => void;
|
|
840
|
+
setup: () => void;
|
|
809
841
|
readonly currentOffset: number;
|
|
810
842
|
readonly total: number;
|
|
811
843
|
}
|
|
812
844
|
|
|
813
|
-
export { type AppContext, type AppSetup, type BuildArgs, type BuiltinSlideTransition, type ClicksContext, type ClicksElement, type ClicksInfo, type CodeRunner, type CodeRunnerContext, type CodeRunnerOutput, type CodeRunnerOutputDom, type CodeRunnerOutputError, type CodeRunnerOutputHtml, type CodeRunnerOutputText, type CodeRunnerOutputTextArray, type CodeRunnerOutputs, type CodeRunnerProviders, type CodeRunnersSetup, type CommonArgs, type ContextMenuItem, type ContextMenuSetup, type DrawingsOptions, type ExportArgs, type FontOptions, type FrontmatterStyle, type KatexSetup, type LoadedSnippets, type MarkdownTransformContext, type MarkdownTransformer, type
|
|
845
|
+
export { type AppContext, type AppSetup, type BuildArgs, type BuiltinSlideTransition, type ClicksContext, type ClicksElement, type ClicksInfo, type CodeRunner, type CodeRunnerContext, type CodeRunnerOutput, type CodeRunnerOutputDom, type CodeRunnerOutputError, type CodeRunnerOutputHtml, type CodeRunnerOutputText, type CodeRunnerOutputTextArray, type CodeRunnerOutputs, type CodeRunnerProviders, type CodeRunnersSetup, type CommonArgs, type ContextMenuItem, type ContextMenuSetup, type DrawingsOptions, type ExportArgs, type FontOptions, type FrontmatterStyle, type Headmatter, type KatexSetup, type LoadedSnippets, type MarkdownTransformContext, type MarkdownTransformer, type MermaidSetup, type MonacoSetup, type MonacoSetupReturn, type NavOperations, type NormalizedAtValue, type NormalizedRangeClickValue, type NormalizedSingleClickValue, type PreparserExtensionLoader, type PreparserSetup, type RawAtValue, type RawRangeAtValue, type RawSingleAtValue, type RenderContext, type ResolvedDrawingsOptions, type ResolvedExportOptions, type ResolvedFontOptions, type ResolvedSlidevOptions, type ResolvedSlidevUtils, type RootSetup, type RootsInfo, type RoutesSetup, type ShikiContext, type ShikiSetup, type ShikiSetupReturn, type ShortcutOptions, type ShortcutsSetup, type SlideInfo, type SlideInfoBase, type SlidePatch, type SlideRoute, type SlidevConfig, type SlidevData, type SlidevDetectedFeatures, type SlidevEntryOptions, type SlidevMarkdown, type SlidevPluginOptions, type SlidevPreparserExtension, type SlidevServerOptions, type SlidevThemeConfig, type SlidevThemeMeta, type SourceSlideInfo, type TocItem, type TransformersSetup, type TransformersSetupReturn, type UnoSetup, defineAppSetup, defineCodeRunnersSetup, defineContextMenuSetup, defineKatexSetup, defineMermaidSetup, defineMonacoSetup, definePreparserSetup, defineRootSetup, defineRoutesSetup, defineShikiSetup, defineShortcutsSetup, defineTransformersSetup, defineUnoSetup };
|
package/dist/index.mjs
CHANGED
|
@@ -11,6 +11,7 @@ var defineRoutesSetup = defineSetup;
|
|
|
11
11
|
var defineMermaidSetup = defineSetup;
|
|
12
12
|
var defineKatexSetup = defineSetup;
|
|
13
13
|
var defineShortcutsSetup = defineSetup;
|
|
14
|
+
var defineTransformersSetup = defineSetup;
|
|
14
15
|
var definePreparserSetup = defineSetup;
|
|
15
16
|
var defineCodeRunnersSetup = defineSetup;
|
|
16
17
|
var defineContextMenuSetup = defineSetup;
|
|
@@ -26,5 +27,6 @@ export {
|
|
|
26
27
|
defineRoutesSetup,
|
|
27
28
|
defineShikiSetup,
|
|
28
29
|
defineShortcutsSetup,
|
|
30
|
+
defineTransformersSetup,
|
|
29
31
|
defineUnoSetup
|
|
30
32
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/types",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.18",
|
|
4
4
|
"description": "Shared types declarations for Slidev",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,18 +24,21 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@antfu/utils": "^0.7.10",
|
|
27
|
+
"@shikijs/markdown-it": "^1.10.3",
|
|
27
28
|
"@vitejs/plugin-vue": "^5.0.5",
|
|
28
29
|
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
|
29
|
-
"katex": "^0.16.
|
|
30
|
+
"katex": "^0.16.11",
|
|
30
31
|
"mermaid": "^10.9.1",
|
|
31
32
|
"monaco-editor": "^0.50.0",
|
|
32
|
-
"shiki": "^1.10.
|
|
33
|
-
"unocss": "^0.61.
|
|
33
|
+
"shiki": "^1.10.3",
|
|
34
|
+
"unocss": "^0.61.5",
|
|
34
35
|
"unplugin-icons": "^0.19.0",
|
|
35
36
|
"unplugin-vue-markdown": "^0.26.2",
|
|
36
|
-
"vite-plugin-
|
|
37
|
+
"vite-plugin-inspect": "^0.8.5",
|
|
38
|
+
"vite-plugin-remote-assets": "^0.5.0",
|
|
39
|
+
"vite-plugin-static-copy": "^1.0.6",
|
|
37
40
|
"vite-plugin-vue-server-ref": "^0.4.2",
|
|
38
|
-
"vue": "^3.4.
|
|
41
|
+
"vue": "^3.4.33",
|
|
39
42
|
"vue-router": "^4.4.0"
|
|
40
43
|
},
|
|
41
44
|
"scripts": {
|