@slidev/types 0.49.0-beta.3 → 0.49.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client.d.ts CHANGED
@@ -118,3 +118,8 @@ declare module '#slidev/styles' {
118
118
  declare module '#slidev/monaco-types' {
119
119
  // side-effects only
120
120
  }
121
+
122
+ declare module '#slidev/monaco-run-deps' {
123
+ const modules: Recored<string, unknown>
124
+ export default modules
125
+ }
package/dist/index.d.mts CHANGED
@@ -14,7 +14,7 @@ import Components from 'unplugin-vue-components/vite';
14
14
  import Markdown from 'unplugin-vue-markdown/vite';
15
15
  import RemoteAssets from 'vite-plugin-remote-assets';
16
16
  import ServerRef from 'vite-plugin-vue-server-ref';
17
- import MagicString from 'magic-string';
17
+ import MagicString from 'magic-string-stack';
18
18
 
19
19
  interface CommonArgs {
20
20
  entry: string;
@@ -91,6 +91,12 @@ interface SlidevConfig {
91
91
  * @default []
92
92
  */
93
93
  monacoTypesAdditionalPackages: string[];
94
+ /**
95
+ * Additional local modules to load as dependencies of monaco runnable
96
+ *
97
+ * @default []
98
+ */
99
+ monacoRunAdditionalDeps: string[];
94
100
  /**
95
101
  * Show a download button in the SPA build,
96
102
  * could also be a link to custom pdf
@@ -123,7 +129,7 @@ interface SlidevConfig {
123
129
  * @see https://sli.dev/custom/highlighters.html
124
130
  * @default shiki
125
131
  */
126
- highlighter: 'prism' | 'shiki';
132
+ highlighter: 'shiki' | 'prism';
127
133
  /**
128
134
  * Enable Twoslash
129
135
  *
@@ -431,9 +437,15 @@ interface SlidevThemeMeta {
431
437
  highlighter?: 'prism' | 'shiki' | 'both';
432
438
  }
433
439
  type SlidevThemeConfig = Record<string, string | number>;
434
- interface SlidevFeatureFlags {
440
+ interface SlidevDetectedFeatures {
435
441
  katex: boolean;
436
- monaco: boolean;
442
+ /**
443
+ * `false` or referenced module specifiers
444
+ */
445
+ monaco: false | {
446
+ types: string[];
447
+ deps: string[];
448
+ };
437
449
  tweet: boolean;
438
450
  mermaid: boolean;
439
451
  }
@@ -453,7 +465,7 @@ interface SlidevData {
453
465
  entry: SlidevMarkdown;
454
466
  config: SlidevConfig;
455
467
  headmatter: Record<string, unknown>;
456
- features: SlidevFeatureFlags;
468
+ features: SlidevDetectedFeatures;
457
469
  themeMeta?: SlidevThemeMeta;
458
470
  markdownFiles: Record<string, SlidevMarkdown>;
459
471
  watchFiles: string[];
@@ -481,10 +493,6 @@ interface CodeRunnerContext {
481
493
  * Highlight code with shiki.
482
494
  */
483
495
  highlight: (code: string, lang: string, options?: Partial<CodeToHastOptions>) => Promise<string>;
484
- /**
485
- * Resolve the import path of a module.
486
- */
487
- resolveId: (specifer: string) => Promise<string | null>;
488
496
  /**
489
497
  * Use (other) code runner to run code.
490
498
  */
@@ -705,9 +713,10 @@ declare module 'vite' {
705
713
 
706
714
  interface MarkdownTransformContext {
707
715
  s: MagicString;
708
- ignores: [number, number][];
709
- isIgnored: (index: number) => boolean;
716
+ id: string;
717
+ options: ResolvedSlidevOptions;
710
718
  }
719
+ type MarkdownTransformer = (ctx: MarkdownTransformContext) => void;
711
720
 
712
721
  type RawAtValue = undefined | boolean | string | number | [string | number, string | number];
713
722
  type NormalizedSinceClickValue = number | string;
@@ -755,4 +764,4 @@ interface ClicksContext {
755
764
  readonly total: number;
756
765
  }
757
766
 
758
- 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 MermaidOptions, type MermaidSetup, type MonacoSetup, type MonacoSetupReturn, type NavOperations, type NormalizedAtValue, type NormalizedRangeClickValue, type NormalizedSinceClickValue, type PreparserExtensionLoader, type PreparserSetup, type RawAtValue, type RenderContext, type ResolvedDrawingsOptions, type ResolvedExportOptions, type ResolvedFontOptions, type ResolvedSlidevOptions, 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 SlidevEntryOptions, type SlidevFeatureFlags, type SlidevMarkdown, type SlidevPluginOptions, type SlidevPreparserExtension, type SlidevServerOptions, type SlidevThemeConfig, type SlidevThemeMeta, type SourceSlideInfo, type TocItem, type UnoSetup, defineAppSetup, defineCodeRunnersSetup, defineContextMenuSetup, defineKatexSetup, defineMermaidSetup, defineMonacoSetup, definePreparserSetup, defineRootSetup, defineRoutesSetup, defineShikiSetup, defineShortcutsSetup, defineUnoSetup };
767
+ 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 MermaidOptions, type MermaidSetup, type MonacoSetup, type MonacoSetupReturn, type NavOperations, type NormalizedAtValue, type NormalizedRangeClickValue, type NormalizedSinceClickValue, type PreparserExtensionLoader, type PreparserSetup, type RawAtValue, type RenderContext, type ResolvedDrawingsOptions, type ResolvedExportOptions, type ResolvedFontOptions, type ResolvedSlidevOptions, 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 UnoSetup, defineAppSetup, defineCodeRunnersSetup, defineContextMenuSetup, defineKatexSetup, defineMermaidSetup, defineMonacoSetup, definePreparserSetup, defineRootSetup, defineRoutesSetup, defineShikiSetup, defineShortcutsSetup, defineUnoSetup };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/types",
3
- "version": "0.49.0-beta.3",
3
+ "version": "0.49.0-beta.4",
4
4
  "description": "Shared types declarations for Slidev",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -30,12 +30,12 @@
30
30
  "mermaid": "^10.9.0",
31
31
  "monaco-editor": "^0.47.0",
32
32
  "shiki": "^1.3.0",
33
- "unocss": "^0.59.2",
33
+ "unocss": "^0.59.3",
34
34
  "unplugin-icons": "^0.18.5",
35
- "unplugin-vue-markdown": "^0.26.0",
35
+ "unplugin-vue-markdown": "^0.26.1",
36
36
  "vite-plugin-remote-assets": "^0.4.1",
37
37
  "vite-plugin-vue-server-ref": "^0.4.2",
38
- "vue": "^3.4.21",
38
+ "vue": "^3.4.22",
39
39
  "vue-router": "^4.3.0"
40
40
  },
41
41
  "scripts": {