@slidev/types 52.19.0 → 52.19.2
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 +103 -104
- package/package.json +11 -11
package/dist/index.d.mts
CHANGED
|
@@ -21,11 +21,11 @@ import RemoteAssets from "vite-plugin-remote-assets";
|
|
|
21
21
|
import { ViteStaticCopyOptions } from "vite-plugin-static-copy";
|
|
22
22
|
import ServerRef from "vite-plugin-vue-server-ref";
|
|
23
23
|
//#region src/cli.d.ts
|
|
24
|
-
interface CommonArgs {
|
|
24
|
+
export interface CommonArgs {
|
|
25
25
|
entry: string;
|
|
26
26
|
theme?: string;
|
|
27
27
|
}
|
|
28
|
-
interface ExportArgs extends CommonArgs {
|
|
28
|
+
export interface ExportArgs extends CommonArgs {
|
|
29
29
|
'output'?: string;
|
|
30
30
|
'format'?: string;
|
|
31
31
|
'timeout'?: number;
|
|
@@ -40,7 +40,7 @@ interface ExportArgs extends CommonArgs {
|
|
|
40
40
|
'scale'?: number;
|
|
41
41
|
'omit-background'?: boolean;
|
|
42
42
|
}
|
|
43
|
-
interface BuildArgs extends ExportArgs {
|
|
43
|
+
export interface BuildArgs extends ExportArgs {
|
|
44
44
|
'out': string;
|
|
45
45
|
'base'?: string;
|
|
46
46
|
'download'?: boolean;
|
|
@@ -49,14 +49,14 @@ interface BuildArgs extends ExportArgs {
|
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region src/clicks.d.ts
|
|
52
|
-
type RawSingleAtValue = null | undefined | boolean | string | number;
|
|
53
|
-
type RawRangeAtValue = null | undefined | false | [string | number, string | number];
|
|
54
|
-
type RawAtValue = RawSingleAtValue | RawRangeAtValue;
|
|
55
|
-
type NormalizedSingleClickValue = number | string | null;
|
|
56
|
-
type NormalizedRangeClickValue = [number, number] | [number, string] | [string, number] | [string, string] | [string | number, string | number] | null;
|
|
57
|
-
type NormalizedAtValue = NormalizedSingleClickValue | NormalizedRangeClickValue;
|
|
58
|
-
type ClicksElement = Element | string;
|
|
59
|
-
interface ClicksInfo {
|
|
52
|
+
export type RawSingleAtValue = null | undefined | boolean | string | number;
|
|
53
|
+
export type RawRangeAtValue = null | undefined | false | [string | number, string | number];
|
|
54
|
+
export type RawAtValue = RawSingleAtValue | RawRangeAtValue;
|
|
55
|
+
export type NormalizedSingleClickValue = number | string | null;
|
|
56
|
+
export type NormalizedRangeClickValue = [number, number] | [number, string] | [string, number] | [string, string] | [string | number, string | number] | null;
|
|
57
|
+
export type NormalizedAtValue = NormalizedSingleClickValue | NormalizedRangeClickValue;
|
|
58
|
+
export type ClicksElement = Element | string;
|
|
59
|
+
export interface ClicksInfo {
|
|
60
60
|
/**
|
|
61
61
|
* The absolute start click num
|
|
62
62
|
*/
|
|
@@ -86,7 +86,7 @@ interface ClicksInfo {
|
|
|
86
86
|
*/
|
|
87
87
|
isActive: ComputedRef<boolean>;
|
|
88
88
|
}
|
|
89
|
-
interface ClicksContext {
|
|
89
|
+
export interface ClicksContext {
|
|
90
90
|
current: number;
|
|
91
91
|
readonly clicksStart: number;
|
|
92
92
|
readonly relativeSizeMap: Map<ClicksElement, number>;
|
|
@@ -103,7 +103,7 @@ interface ClicksContext {
|
|
|
103
103
|
}
|
|
104
104
|
//#endregion
|
|
105
105
|
//#region src/code-runner.d.ts
|
|
106
|
-
interface CodeRunnerContext {
|
|
106
|
+
export interface CodeRunnerContext {
|
|
107
107
|
/**
|
|
108
108
|
* Options passed to runner via the `runnerOptions` prop.
|
|
109
109
|
*/
|
|
@@ -117,7 +117,7 @@ interface CodeRunnerContext {
|
|
|
117
117
|
*/
|
|
118
118
|
run: (code: string, lang: string) => Promise<CodeRunnerOutputs>;
|
|
119
119
|
}
|
|
120
|
-
interface CodeRunnerOutputHtml {
|
|
120
|
+
export interface CodeRunnerOutputHtml {
|
|
121
121
|
/**
|
|
122
122
|
* The HTML to be rendered.
|
|
123
123
|
*
|
|
@@ -125,19 +125,19 @@ interface CodeRunnerOutputHtml {
|
|
|
125
125
|
*/
|
|
126
126
|
html: string;
|
|
127
127
|
}
|
|
128
|
-
interface CodeRunnerOutputDom {
|
|
128
|
+
export interface CodeRunnerOutputDom {
|
|
129
129
|
/**
|
|
130
130
|
* The DOM element to be rendered.
|
|
131
131
|
*/
|
|
132
132
|
element: HTMLElement;
|
|
133
133
|
}
|
|
134
|
-
interface CodeRunnerOutputError {
|
|
134
|
+
export interface CodeRunnerOutputError {
|
|
135
135
|
/**
|
|
136
136
|
* The error message to be displayed.
|
|
137
137
|
*/
|
|
138
138
|
error: string;
|
|
139
139
|
}
|
|
140
|
-
interface CodeRunnerOutputText {
|
|
140
|
+
export interface CodeRunnerOutputText {
|
|
141
141
|
/**
|
|
142
142
|
* The text to be displayed.
|
|
143
143
|
*/
|
|
@@ -151,18 +151,18 @@ interface CodeRunnerOutputText {
|
|
|
151
151
|
*/
|
|
152
152
|
highlightLang?: string;
|
|
153
153
|
}
|
|
154
|
-
type CodeRunnerOutputTextArray = CodeRunnerOutputText[];
|
|
155
|
-
type CodeRunnerOutput = CodeRunnerOutputHtml | CodeRunnerOutputError | CodeRunnerOutputText | CodeRunnerOutputTextArray | CodeRunnerOutputDom;
|
|
156
|
-
type CodeRunnerOutputs = MaybeRefOrGetter<Arrayable<CodeRunnerOutput>>;
|
|
157
|
-
type CodeRunner = (code: string, ctx: CodeRunnerContext) => Awaitable<CodeRunnerOutputs>;
|
|
158
|
-
type CodeRunnerProviders = Record<string, CodeRunner>;
|
|
154
|
+
export type CodeRunnerOutputTextArray = CodeRunnerOutputText[];
|
|
155
|
+
export type CodeRunnerOutput = CodeRunnerOutputHtml | CodeRunnerOutputError | CodeRunnerOutputText | CodeRunnerOutputTextArray | CodeRunnerOutputDom;
|
|
156
|
+
export type CodeRunnerOutputs = MaybeRefOrGetter<Arrayable<CodeRunnerOutput>>;
|
|
157
|
+
export type CodeRunner = (code: string, ctx: CodeRunnerContext) => Awaitable<CodeRunnerOutputs>;
|
|
158
|
+
export type CodeRunnerProviders = Record<string, CodeRunner>;
|
|
159
159
|
//#endregion
|
|
160
160
|
//#region src/builtin-layouts.d.ts
|
|
161
161
|
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';
|
|
162
162
|
//#endregion
|
|
163
163
|
//#region src/types.d.ts
|
|
164
|
-
type FrontmatterStyle = 'frontmatter' | 'yaml';
|
|
165
|
-
interface SlideInfoBase {
|
|
164
|
+
export type FrontmatterStyle = 'frontmatter' | 'yaml';
|
|
165
|
+
export interface SlideInfoBase {
|
|
166
166
|
revision: string;
|
|
167
167
|
frontmatter: Record<string, any>;
|
|
168
168
|
content: string;
|
|
@@ -176,7 +176,7 @@ interface SlideInfoBase {
|
|
|
176
176
|
*/
|
|
177
177
|
images?: string[];
|
|
178
178
|
}
|
|
179
|
-
interface SourceSlideInfo extends SlideInfoBase {
|
|
179
|
+
export interface SourceSlideInfo extends SlideInfoBase {
|
|
180
180
|
/**
|
|
181
181
|
* The filepath of the markdown file
|
|
182
182
|
*/
|
|
@@ -203,7 +203,7 @@ interface SourceSlideInfo extends SlideInfoBase {
|
|
|
203
203
|
frontmatterDoc?: YAML.Document<YAML.Node, true>;
|
|
204
204
|
frontmatterStyle?: FrontmatterStyle;
|
|
205
205
|
}
|
|
206
|
-
interface SlideInfo extends SlideInfoBase {
|
|
206
|
+
export interface SlideInfo extends SlideInfoBase {
|
|
207
207
|
/**
|
|
208
208
|
* The index of the slide in the presentation
|
|
209
209
|
*/
|
|
@@ -221,7 +221,7 @@ interface SlideInfo extends SlideInfoBase {
|
|
|
221
221
|
/**
|
|
222
222
|
* Editable fields for a slide
|
|
223
223
|
*/
|
|
224
|
-
type SlidePatch = Partial<Pick<SlideInfoBase, 'content' | 'note' | 'frontmatterRaw'>> & {
|
|
224
|
+
export type SlidePatch = Partial<Pick<SlideInfoBase, 'content' | 'note' | 'frontmatterRaw'>> & {
|
|
225
225
|
skipHmr?: boolean;
|
|
226
226
|
/**
|
|
227
227
|
* The frontmatter patch (only the changed fields)
|
|
@@ -232,13 +232,13 @@ type SlidePatch = Partial<Pick<SlideInfoBase, 'content' | 'note' | 'frontmatterR
|
|
|
232
232
|
/**
|
|
233
233
|
* Metadata for "slidev" field in themes' package.json
|
|
234
234
|
*/
|
|
235
|
-
interface SlidevThemeMeta {
|
|
235
|
+
export interface SlidevThemeMeta {
|
|
236
236
|
defaults?: Partial<SlidevConfig>;
|
|
237
237
|
colorSchema?: 'dark' | 'light' | 'both';
|
|
238
238
|
highlighter?: 'shiki';
|
|
239
239
|
}
|
|
240
|
-
type SlidevThemeConfig = Record<string, string | number>;
|
|
241
|
-
interface SlidevDetectedFeatures {
|
|
240
|
+
export type SlidevThemeConfig = Record<string, string | number>;
|
|
241
|
+
export interface SlidevDetectedFeatures {
|
|
242
242
|
katex: boolean;
|
|
243
243
|
/**
|
|
244
244
|
* `false` or referenced module specifiers
|
|
@@ -251,7 +251,7 @@ interface SlidevDetectedFeatures {
|
|
|
251
251
|
bluesky: boolean;
|
|
252
252
|
mermaid: boolean;
|
|
253
253
|
}
|
|
254
|
-
interface SlidevMarkdown {
|
|
254
|
+
export interface SlidevMarkdown {
|
|
255
255
|
filepath: string;
|
|
256
256
|
raw: string;
|
|
257
257
|
/**
|
|
@@ -263,7 +263,7 @@ interface SlidevMarkdown {
|
|
|
263
263
|
message: string;
|
|
264
264
|
}[];
|
|
265
265
|
}
|
|
266
|
-
interface SlidevData {
|
|
266
|
+
export interface SlidevData {
|
|
267
267
|
/**
|
|
268
268
|
* Slides that should be rendered (disabled slides excluded)
|
|
269
269
|
*/
|
|
@@ -279,15 +279,15 @@ interface SlidevData {
|
|
|
279
279
|
*/
|
|
280
280
|
watchFiles: Record<string, Set<number>>;
|
|
281
281
|
}
|
|
282
|
-
interface SlidevPreparserExtension {
|
|
282
|
+
export interface SlidevPreparserExtension {
|
|
283
283
|
name?: string;
|
|
284
284
|
transformRawLines?: (lines: string[]) => Promise<void> | void;
|
|
285
285
|
transformSlide?: (content: string, frontmatter: any) => Promise<string | undefined>;
|
|
286
286
|
transformNote?: (note: string | undefined, frontmatter: any) => Promise<string | undefined>;
|
|
287
287
|
}
|
|
288
|
-
type PreparserExtensionLoader = (roots: string[], headmatter: Record<string, unknown>, filepath: string, mode?: string) => Promise<SlidevPreparserExtension[]>;
|
|
289
|
-
type RenderContext = 'none' | 'slide' | 'overview' | 'presenter' | 'previewNext';
|
|
290
|
-
interface SlideRoute {
|
|
288
|
+
export type PreparserExtensionLoader = (roots: string[], headmatter: Record<string, unknown>, filepath: string, mode?: string) => Promise<SlidevPreparserExtension[]>;
|
|
289
|
+
export type RenderContext = 'none' | 'slide' | 'overview' | 'presenter' | 'previewNext';
|
|
290
|
+
export interface SlideRoute {
|
|
291
291
|
no: number;
|
|
292
292
|
meta: RouteMeta & Required<Pick<RouteMeta, 'slide'>>;
|
|
293
293
|
/**
|
|
@@ -303,13 +303,13 @@ interface SlideRoute {
|
|
|
303
303
|
}
|
|
304
304
|
//#endregion
|
|
305
305
|
//#region src/frontmatter.d.ts
|
|
306
|
-
interface Headmatter extends HeadmatterConfig, Omit<Frontmatter, 'title' | 'transition'> {
|
|
306
|
+
export interface Headmatter extends HeadmatterConfig, Omit<Frontmatter, 'title' | 'transition'> {
|
|
307
307
|
/**
|
|
308
308
|
* Default frontmatter options applied to all slides
|
|
309
309
|
*/
|
|
310
310
|
defaults?: Frontmatter;
|
|
311
311
|
}
|
|
312
|
-
interface HeadmatterConfig extends TransitionOptions {
|
|
312
|
+
export interface HeadmatterConfig extends TransitionOptions {
|
|
313
313
|
/**
|
|
314
314
|
* Title of the slides
|
|
315
315
|
*/
|
|
@@ -649,7 +649,7 @@ interface HeadmatterConfig extends TransitionOptions {
|
|
|
649
649
|
ahead?: number;
|
|
650
650
|
};
|
|
651
651
|
}
|
|
652
|
-
interface Frontmatter extends TransitionOptions {
|
|
652
|
+
export interface Frontmatter extends TransitionOptions {
|
|
653
653
|
/**
|
|
654
654
|
* Slide layout to use
|
|
655
655
|
*
|
|
@@ -730,7 +730,7 @@ interface Frontmatter extends TransitionOptions {
|
|
|
730
730
|
*/
|
|
731
731
|
src?: string;
|
|
732
732
|
}
|
|
733
|
-
interface DrawingsOptions {
|
|
733
|
+
export interface DrawingsOptions {
|
|
734
734
|
/**
|
|
735
735
|
* Persist the drawings to disk
|
|
736
736
|
* Passing string to specify the directory (default to `.slidev/drawings`)
|
|
@@ -755,7 +755,7 @@ interface DrawingsOptions {
|
|
|
755
755
|
*/
|
|
756
756
|
syncAll?: boolean;
|
|
757
757
|
}
|
|
758
|
-
interface FontOptions {
|
|
758
|
+
export interface FontOptions {
|
|
759
759
|
/**
|
|
760
760
|
* Sans serif fonts (default fonts for most text)
|
|
761
761
|
*/
|
|
@@ -803,8 +803,8 @@ interface FontOptions {
|
|
|
803
803
|
*/
|
|
804
804
|
fallbacks?: boolean;
|
|
805
805
|
}
|
|
806
|
-
type BuiltinSlideTransition = 'fade' | 'fade-out' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'view-transition';
|
|
807
|
-
interface TransitionOptions {
|
|
806
|
+
export type BuiltinSlideTransition = 'fade' | 'fade-out' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'view-transition';
|
|
807
|
+
export interface TransitionOptions {
|
|
808
808
|
/**
|
|
809
809
|
* Page transition, powered by Vue's `<TransitionGroup/>`
|
|
810
810
|
*
|
|
@@ -823,7 +823,7 @@ interface TransitionOptions {
|
|
|
823
823
|
*/
|
|
824
824
|
transition?: BuiltinSlideTransition | string | TransitionGroupProps | null;
|
|
825
825
|
}
|
|
826
|
-
interface TransitionGroupProps {
|
|
826
|
+
export interface TransitionGroupProps {
|
|
827
827
|
appear?: boolean;
|
|
828
828
|
persisted?: boolean;
|
|
829
829
|
tag?: string;
|
|
@@ -846,7 +846,7 @@ interface TransitionGroupProps {
|
|
|
846
846
|
/**
|
|
847
847
|
* The following type should map to unhead MataFlat type
|
|
848
848
|
*/
|
|
849
|
-
interface SeoMeta {
|
|
849
|
+
export interface SeoMeta {
|
|
850
850
|
ogTitle?: string;
|
|
851
851
|
ogDescription?: string;
|
|
852
852
|
ogImage?: string;
|
|
@@ -860,14 +860,14 @@ interface SeoMeta {
|
|
|
860
860
|
}
|
|
861
861
|
//#endregion
|
|
862
862
|
//#region src/config.d.ts
|
|
863
|
-
interface ResolvedSlidevConfigSub {
|
|
863
|
+
export interface ResolvedSlidevConfigSub {
|
|
864
864
|
export: ResolvedExportOptions;
|
|
865
865
|
drawings: ResolvedDrawingsOptions;
|
|
866
866
|
fonts: ResolvedFontOptions;
|
|
867
867
|
aspectRatio: number;
|
|
868
868
|
}
|
|
869
|
-
interface SlidevConfig extends Omit<Required<HeadmatterConfig>, keyof ResolvedSlidevConfigSub>, ResolvedSlidevConfigSub {}
|
|
870
|
-
interface ResolvedFontOptions {
|
|
869
|
+
export interface SlidevConfig extends Omit<Required<HeadmatterConfig>, keyof ResolvedSlidevConfigSub>, ResolvedSlidevConfigSub {}
|
|
870
|
+
export interface ResolvedFontOptions {
|
|
871
871
|
sans: string[];
|
|
872
872
|
mono: string[];
|
|
873
873
|
serif: string[];
|
|
@@ -877,13 +877,13 @@ interface ResolvedFontOptions {
|
|
|
877
877
|
webfonts: string[];
|
|
878
878
|
local: string[];
|
|
879
879
|
}
|
|
880
|
-
interface ResolvedDrawingsOptions {
|
|
880
|
+
export interface ResolvedDrawingsOptions {
|
|
881
881
|
persist: string | false;
|
|
882
882
|
enabled: boolean | 'dev' | 'build';
|
|
883
883
|
presenterOnly: boolean;
|
|
884
884
|
syncAll: boolean;
|
|
885
885
|
}
|
|
886
|
-
interface ResolvedExportOptions extends Omit<ExportArgs, 'entry' | 'theme'> {
|
|
886
|
+
export interface ResolvedExportOptions extends Omit<ExportArgs, 'entry' | 'theme'> {
|
|
887
887
|
withClicks?: boolean;
|
|
888
888
|
executablePath?: string;
|
|
889
889
|
withToc?: boolean;
|
|
@@ -903,7 +903,7 @@ type ContextMenuOption = {
|
|
|
903
903
|
icon: Component | string;
|
|
904
904
|
label: string;
|
|
905
905
|
});
|
|
906
|
-
type ContextMenuItem = ContextMenuOption | 'separator';
|
|
906
|
+
export type ContextMenuItem = ContextMenuOption | 'separator';
|
|
907
907
|
//#endregion
|
|
908
908
|
//#region src/hmr.d.ts
|
|
909
909
|
declare module 'vite' {
|
|
@@ -921,14 +921,14 @@ declare module 'vite' {
|
|
|
921
921
|
}
|
|
922
922
|
//#endregion
|
|
923
923
|
//#region src/options.d.ts
|
|
924
|
-
interface RootsInfo {
|
|
924
|
+
export interface RootsInfo {
|
|
925
925
|
cliRoot: string;
|
|
926
926
|
clientRoot: string;
|
|
927
927
|
userRoot: string;
|
|
928
928
|
userPkgJson: Record<string, any>;
|
|
929
929
|
userWorkspaceRoot: string;
|
|
930
930
|
}
|
|
931
|
-
interface SlidevEntryOptions {
|
|
931
|
+
export interface SlidevEntryOptions {
|
|
932
932
|
/**
|
|
933
933
|
* Markdown entry
|
|
934
934
|
*/
|
|
@@ -962,7 +962,7 @@ interface SlidevEntryOptions {
|
|
|
962
962
|
*/
|
|
963
963
|
routerMode?: 'hash' | 'history' | 'memory';
|
|
964
964
|
}
|
|
965
|
-
interface ResolvedSlidevOptions extends RootsInfo, SlidevEntryOptions {
|
|
965
|
+
export interface ResolvedSlidevOptions extends RootsInfo, SlidevEntryOptions {
|
|
966
966
|
data: SlidevData;
|
|
967
967
|
themeRaw: string;
|
|
968
968
|
themeRoots: string[];
|
|
@@ -974,7 +974,7 @@ interface ResolvedSlidevOptions extends RootsInfo, SlidevEntryOptions {
|
|
|
974
974
|
mode: 'dev' | 'build' | 'export';
|
|
975
975
|
utils: ResolvedSlidevUtils;
|
|
976
976
|
}
|
|
977
|
-
interface ResolvedSlidevUtils {
|
|
977
|
+
export interface ResolvedSlidevUtils {
|
|
978
978
|
shiki: ShorthandsBundle<string, string>;
|
|
979
979
|
shikiOptions: MarkdownItShikiOptions & CodeOptionsThemes$1;
|
|
980
980
|
katexOptions: KatexOptions | null;
|
|
@@ -984,7 +984,7 @@ interface ResolvedSlidevUtils {
|
|
|
984
984
|
isMonacoTypesIgnored: (pkg: string) => boolean;
|
|
985
985
|
getLayouts: () => Promise<Record<string, string>>;
|
|
986
986
|
}
|
|
987
|
-
interface SlidevServerOptions {
|
|
987
|
+
export interface SlidevServerOptions {
|
|
988
988
|
/**
|
|
989
989
|
* @returns `false` if server should be restarted
|
|
990
990
|
*/
|
|
@@ -992,7 +992,7 @@ interface SlidevServerOptions {
|
|
|
992
992
|
}
|
|
993
993
|
//#endregion
|
|
994
994
|
//#region src/transform.d.ts
|
|
995
|
-
interface MarkdownTransformContext {
|
|
995
|
+
export interface MarkdownTransformContext {
|
|
996
996
|
/**
|
|
997
997
|
* The magic string instance for the current markdown content
|
|
998
998
|
*/
|
|
@@ -1006,8 +1006,8 @@ interface MarkdownTransformContext {
|
|
|
1006
1006
|
*/
|
|
1007
1007
|
options: ResolvedSlidevOptions;
|
|
1008
1008
|
}
|
|
1009
|
-
type MarkdownTransformer = (ctx: MarkdownTransformContext) => Awaitable<void>;
|
|
1010
|
-
interface CodeblockTransformContext {
|
|
1009
|
+
export type MarkdownTransformer = (ctx: MarkdownTransformContext) => Awaitable<void>;
|
|
1010
|
+
export interface CodeblockTransformContext {
|
|
1011
1011
|
/**
|
|
1012
1012
|
* The language and meta info of the code block, i.e., the content after "```"
|
|
1013
1013
|
*/
|
|
@@ -1036,19 +1036,19 @@ interface CodeblockTransformContext {
|
|
|
1036
1036
|
*/
|
|
1037
1037
|
options: ResolvedSlidevOptions;
|
|
1038
1038
|
}
|
|
1039
|
-
type CodeblockTransformer = (ctx: CodeblockTransformContext) => Awaitable<string | undefined | null>;
|
|
1040
|
-
declare const defineMarkdownTransformer: (fn: MarkdownTransformer) => MarkdownTransformer;
|
|
1041
|
-
declare const defineCodeblockTransformer: (fn: CodeblockTransformer) => CodeblockTransformer;
|
|
1039
|
+
export type CodeblockTransformer = (ctx: CodeblockTransformContext) => Awaitable<string | undefined | null>;
|
|
1040
|
+
export declare const defineMarkdownTransformer: (fn: MarkdownTransformer) => MarkdownTransformer;
|
|
1041
|
+
export declare const defineCodeblockTransformer: (fn: CodeblockTransformer) => CodeblockTransformer;
|
|
1042
1042
|
//#endregion
|
|
1043
1043
|
//#region src/setups.d.ts
|
|
1044
|
-
interface AppContext {
|
|
1044
|
+
export interface AppContext {
|
|
1045
1045
|
app: App;
|
|
1046
1046
|
router: Router;
|
|
1047
1047
|
}
|
|
1048
|
-
interface MonacoSetupReturn {
|
|
1048
|
+
export interface MonacoSetupReturn {
|
|
1049
1049
|
editorOptions?: monaco.editor.IEditorOptions;
|
|
1050
1050
|
}
|
|
1051
|
-
interface NavOperations {
|
|
1051
|
+
export interface NavOperations {
|
|
1052
1052
|
next: () => void;
|
|
1053
1053
|
prev: () => Promise<void>;
|
|
1054
1054
|
nextSlide: () => void;
|
|
@@ -1063,23 +1063,23 @@ interface NavOperations {
|
|
|
1063
1063
|
escapeOverview: () => void;
|
|
1064
1064
|
showGotoDialog: () => void;
|
|
1065
1065
|
}
|
|
1066
|
-
interface ShortcutOptions {
|
|
1066
|
+
export interface ShortcutOptions {
|
|
1067
1067
|
key: string | Ref<boolean>;
|
|
1068
1068
|
fn?: () => void;
|
|
1069
1069
|
autoRepeat?: boolean;
|
|
1070
1070
|
name?: string;
|
|
1071
1071
|
}
|
|
1072
|
-
interface ShikiContext {
|
|
1072
|
+
export interface ShikiContext {
|
|
1073
1073
|
/**
|
|
1074
1074
|
* @deprecated Pass directly the theme name it's supported by Shiki.
|
|
1075
1075
|
* For custom themes, load it manually via `JSON.parse(fs.readFileSync(path, 'utf-8'))` and pass the raw JSON object instead.
|
|
1076
1076
|
*/
|
|
1077
1077
|
loadTheme: (path: string) => Promise<any>;
|
|
1078
1078
|
}
|
|
1079
|
-
type ShikiSetupReturn = Partial<Omit<CodeToHastOptionsCommon<BuiltinLanguage>, 'lang'> & CodeOptionsThemes<BuiltinTheme> & CodeOptionsMeta & {
|
|
1079
|
+
export type ShikiSetupReturn = Partial<Omit<CodeToHastOptionsCommon<BuiltinLanguage>, 'lang'> & CodeOptionsThemes<BuiltinTheme> & CodeOptionsMeta & {
|
|
1080
1080
|
langs: (MaybeArray<LanguageRegistration> | BuiltinLanguage)[] | Record<string, LanguageInput>;
|
|
1081
1081
|
}>;
|
|
1082
|
-
interface TransformersSetupReturn {
|
|
1082
|
+
export interface TransformersSetupReturn {
|
|
1083
1083
|
pre: (MarkdownTransformer | false)[];
|
|
1084
1084
|
/**
|
|
1085
1085
|
* @deprecated It has the same effect as `pre`
|
|
@@ -1095,44 +1095,44 @@ interface TransformersSetupReturn {
|
|
|
1095
1095
|
post: (MarkdownTransformer | false)[];
|
|
1096
1096
|
codeblocks: (CodeblockTransformer | false)[];
|
|
1097
1097
|
}
|
|
1098
|
-
type ShikiSetup = (shiki: ShikiContext) => Awaitable<ShikiSetupReturn | void>;
|
|
1099
|
-
type KatexSetup = () => Awaitable<Partial<KatexOptions> | void>;
|
|
1100
|
-
type UnoSetup = () => Awaitable<Partial<VitePluginConfig> | void>;
|
|
1101
|
-
type TransformersSetup = () => Awaitable<Partial<TransformersSetupReturn>>;
|
|
1102
|
-
type PreparserSetup = (context: {
|
|
1098
|
+
export type ShikiSetup = (shiki: ShikiContext) => Awaitable<ShikiSetupReturn | void>;
|
|
1099
|
+
export type KatexSetup = () => Awaitable<Partial<KatexOptions> | void>;
|
|
1100
|
+
export type UnoSetup = () => Awaitable<Partial<VitePluginConfig> | void>;
|
|
1101
|
+
export type TransformersSetup = () => Awaitable<Partial<TransformersSetupReturn>>;
|
|
1102
|
+
export type PreparserSetup = (context: {
|
|
1103
1103
|
filepath: string;
|
|
1104
1104
|
headmatter: Record<string, unknown>;
|
|
1105
1105
|
mode?: string;
|
|
1106
1106
|
}) => Awaitable<SlidevPreparserExtension[]>;
|
|
1107
|
-
type VitePluginsSetup = (options: ResolvedSlidevOptions) => PluginOption;
|
|
1108
|
-
type MonacoSetup = (m: typeof monaco) => Awaitable<MonacoSetupReturn | void>;
|
|
1109
|
-
type AppSetup = (context: AppContext) => Awaitable<void>;
|
|
1110
|
-
type RootSetup = () => Awaitable<void>;
|
|
1111
|
-
type RoutesSetup = (routes: RouteRecordRaw[]) => RouteRecordRaw[];
|
|
1112
|
-
type MermaidSetup = () => Awaitable<Partial<MermaidConfig> | void>;
|
|
1113
|
-
type MermaidRenderFn = (code: string, options: Record<string, any>) => Awaitable<string>;
|
|
1114
|
-
type MermaidRendererSetup = () => Awaitable<MermaidRenderFn | void>;
|
|
1115
|
-
type ShortcutsSetup = (nav: NavOperations, defaultShortcuts: ShortcutOptions[]) => Array<ShortcutOptions>;
|
|
1116
|
-
type CodeRunnersSetup = (runners: CodeRunnerProviders) => Awaitable<CodeRunnerProviders | void>;
|
|
1117
|
-
type ContextMenuSetup = (items: ComputedRef<ContextMenuItem[]>) => ComputedRef<ContextMenuItem[]>;
|
|
1118
|
-
declare const defineShikiSetup: (fn: ShikiSetup) => ShikiSetup;
|
|
1119
|
-
declare const defineUnoSetup: (fn: UnoSetup) => UnoSetup;
|
|
1120
|
-
declare const defineMonacoSetup: (fn: MonacoSetup) => MonacoSetup;
|
|
1121
|
-
declare const defineAppSetup: (fn: AppSetup) => AppSetup;
|
|
1122
|
-
declare const defineRootSetup: (fn: RootSetup) => RootSetup;
|
|
1123
|
-
declare const defineRoutesSetup: (fn: RoutesSetup) => RoutesSetup;
|
|
1124
|
-
declare const defineMermaidSetup: (fn: MermaidSetup) => MermaidSetup;
|
|
1125
|
-
declare const defineMermaidRendererSetup: (fn: MermaidRendererSetup) => MermaidRendererSetup;
|
|
1126
|
-
declare const defineKatexSetup: (fn: KatexSetup) => KatexSetup;
|
|
1127
|
-
declare const defineShortcutsSetup: (fn: ShortcutsSetup) => ShortcutsSetup;
|
|
1128
|
-
declare const defineTransformersSetup: (fn: TransformersSetup) => TransformersSetup;
|
|
1129
|
-
declare const definePreparserSetup: (fn: PreparserSetup) => PreparserSetup;
|
|
1130
|
-
declare const defineVitePluginsSetup: (fn: VitePluginsSetup) => VitePluginsSetup;
|
|
1131
|
-
declare const defineCodeRunnersSetup: (fn: CodeRunnersSetup) => CodeRunnersSetup;
|
|
1132
|
-
declare const defineContextMenuSetup: (fn: ContextMenuSetup) => ContextMenuSetup;
|
|
1107
|
+
export type VitePluginsSetup = (options: ResolvedSlidevOptions) => PluginOption;
|
|
1108
|
+
export type MonacoSetup = (m: typeof monaco) => Awaitable<MonacoSetupReturn | void>;
|
|
1109
|
+
export type AppSetup = (context: AppContext) => Awaitable<void>;
|
|
1110
|
+
export type RootSetup = () => Awaitable<void>;
|
|
1111
|
+
export type RoutesSetup = (routes: RouteRecordRaw[]) => RouteRecordRaw[];
|
|
1112
|
+
export type MermaidSetup = () => Awaitable<Partial<MermaidConfig> | void>;
|
|
1113
|
+
export type MermaidRenderFn = (code: string, options: Record<string, any>) => Awaitable<string>;
|
|
1114
|
+
export type MermaidRendererSetup = () => Awaitable<MermaidRenderFn | void>;
|
|
1115
|
+
export type ShortcutsSetup = (nav: NavOperations, defaultShortcuts: ShortcutOptions[]) => Array<ShortcutOptions>;
|
|
1116
|
+
export type CodeRunnersSetup = (runners: CodeRunnerProviders) => Awaitable<CodeRunnerProviders | void>;
|
|
1117
|
+
export type ContextMenuSetup = (items: ComputedRef<ContextMenuItem[]>) => ComputedRef<ContextMenuItem[]>;
|
|
1118
|
+
export declare const defineShikiSetup: (fn: ShikiSetup) => ShikiSetup;
|
|
1119
|
+
export declare const defineUnoSetup: (fn: UnoSetup) => UnoSetup;
|
|
1120
|
+
export declare const defineMonacoSetup: (fn: MonacoSetup) => MonacoSetup;
|
|
1121
|
+
export declare const defineAppSetup: (fn: AppSetup) => AppSetup;
|
|
1122
|
+
export declare const defineRootSetup: (fn: RootSetup) => RootSetup;
|
|
1123
|
+
export declare const defineRoutesSetup: (fn: RoutesSetup) => RoutesSetup;
|
|
1124
|
+
export declare const defineMermaidSetup: (fn: MermaidSetup) => MermaidSetup;
|
|
1125
|
+
export declare const defineMermaidRendererSetup: (fn: MermaidRendererSetup) => MermaidRendererSetup;
|
|
1126
|
+
export declare const defineKatexSetup: (fn: KatexSetup) => KatexSetup;
|
|
1127
|
+
export declare const defineShortcutsSetup: (fn: ShortcutsSetup) => ShortcutsSetup;
|
|
1128
|
+
export declare const defineTransformersSetup: (fn: TransformersSetup) => TransformersSetup;
|
|
1129
|
+
export declare const definePreparserSetup: (fn: PreparserSetup) => PreparserSetup;
|
|
1130
|
+
export declare const defineVitePluginsSetup: (fn: VitePluginsSetup) => VitePluginsSetup;
|
|
1131
|
+
export declare const defineCodeRunnersSetup: (fn: CodeRunnersSetup) => CodeRunnersSetup;
|
|
1132
|
+
export declare const defineContextMenuSetup: (fn: ContextMenuSetup) => ContextMenuSetup;
|
|
1133
1133
|
//#endregion
|
|
1134
1134
|
//#region src/toc.d.ts
|
|
1135
|
-
interface TocItem {
|
|
1135
|
+
export interface TocItem {
|
|
1136
1136
|
no: number;
|
|
1137
1137
|
active?: boolean;
|
|
1138
1138
|
activeParent?: boolean;
|
|
@@ -1146,7 +1146,7 @@ interface TocItem {
|
|
|
1146
1146
|
}
|
|
1147
1147
|
//#endregion
|
|
1148
1148
|
//#region src/vite.d.ts
|
|
1149
|
-
interface SlidevPluginOptions {
|
|
1149
|
+
export interface SlidevPluginOptions {
|
|
1150
1150
|
vue?: ArgumentsType<typeof Vue>[0];
|
|
1151
1151
|
vuejsx?: ArgumentsType<typeof VueJsx>[0];
|
|
1152
1152
|
markdown?: ArgumentsType<typeof Markdown>[0];
|
|
@@ -1168,5 +1168,4 @@ declare module 'vite' {
|
|
|
1168
1168
|
slidev?: SlidevPluginOptions;
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
|
-
//#endregion
|
|
1172
|
-
export { AppContext, AppSetup, BuildArgs, BuiltinSlideTransition, ClicksContext, ClicksElement, ClicksInfo, CodeRunner, CodeRunnerContext, CodeRunnerOutput, CodeRunnerOutputDom, CodeRunnerOutputError, CodeRunnerOutputHtml, CodeRunnerOutputText, CodeRunnerOutputTextArray, CodeRunnerOutputs, CodeRunnerProviders, CodeRunnersSetup, CodeblockTransformContext, CodeblockTransformer, CommonArgs, ContextMenuItem, ContextMenuSetup, DrawingsOptions, ExportArgs, FontOptions, Frontmatter, FrontmatterStyle, Headmatter, HeadmatterConfig, KatexSetup, MarkdownTransformContext, MarkdownTransformer, MermaidRenderFn, MermaidRendererSetup, 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, defineCodeblockTransformer, defineContextMenuSetup, defineKatexSetup, defineMarkdownTransformer, defineMermaidRendererSetup, defineMermaidSetup, defineMonacoSetup, definePreparserSetup, defineRootSetup, defineRoutesSetup, defineShikiSetup, defineShortcutsSetup, defineTransformersSetup, defineUnoSetup, defineVitePluginsSetup };
|
|
1171
|
+
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/types",
|
|
3
|
-
"version": "52.19.
|
|
3
|
+
"version": "52.19.2",
|
|
4
4
|
"description": "Shared types declarations for Slidev",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,22 +24,22 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@antfu/utils": "^9.3.0",
|
|
27
|
-
"@shikijs/markdown-it": "^4.4.
|
|
28
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
27
|
+
"@shikijs/markdown-it": "^4.4.3",
|
|
28
|
+
"@vitejs/plugin-vue": "^6.0.9",
|
|
29
29
|
"@vitejs/plugin-vue-jsx": "^5.1.6",
|
|
30
|
-
"katex": "^0.18.
|
|
31
|
-
"mermaid": "^11.16.
|
|
30
|
+
"katex": "^0.18.7",
|
|
31
|
+
"mermaid": "^11.16.1",
|
|
32
32
|
"monaco-editor": "^0.56.0",
|
|
33
|
-
"shiki": "^4.4.
|
|
34
|
-
"unocss": "^66.
|
|
35
|
-
"unplugin-icons": "^
|
|
36
|
-
"unplugin-vue-markdown": "^32.
|
|
33
|
+
"shiki": "^4.4.3",
|
|
34
|
+
"unocss": "^66.10.3",
|
|
35
|
+
"unplugin-icons": "^24.0.0",
|
|
36
|
+
"unplugin-vue-markdown": "^32.1.1",
|
|
37
37
|
"vite-plugin-inspect": "^12.0.2",
|
|
38
38
|
"vite-plugin-remote-assets": "^2.1.0",
|
|
39
39
|
"vite-plugin-static-copy": "^4.1.1",
|
|
40
40
|
"vite-plugin-vue-server-ref": "^1.0.0",
|
|
41
|
-
"vue": "^3.5.
|
|
42
|
-
"vue-router": "^5.
|
|
41
|
+
"vue": "^3.5.42",
|
|
42
|
+
"vue-router": "^5.3.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"tsdown-stale-guard": "^0.1.3"
|