@slidev/types 52.7.0 → 52.9.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/client.d.ts CHANGED
@@ -40,16 +40,11 @@ declare module '#slidev/custom-nav-controls' {
40
40
  export default component
41
41
  }
42
42
 
43
- declare module '#slidev/shiki' {
44
- import type { BundledLanguage, BundledTheme, CodeToHastOptions } from 'shiki'
45
- import type { ShikiHighlighterCore } from 'shiki/core'
43
+ declare module '#slidev/setups/shiki' {
44
+ import type { ShikiSetup } from '@slidev/types'
46
45
 
47
- export { shikiToMonaco } from '@shikijs/monaco'
48
-
49
- export const languages: BundledLanguage[]
50
- export const themes: BundledTheme | Record<string, BundledTheme>
51
- export const shiki: Promise<ShikiHighlighterCore>
52
- export function getHighlighter(): Promise<(code: string, lang: string, options?: Partial<CodeToHastOptions>) => string>
46
+ const setups: ShikiSetup[]
47
+ export default setups
53
48
  }
54
49
 
55
50
  declare module '#slidev/setups/monaco' {
package/dist/index.d.mts CHANGED
@@ -1,10 +1,11 @@
1
1
  import { App, Component, ComputedRef, MaybeRefOrGetter, Ref } from "vue";
2
2
  import { ArgumentsType, Arrayable, Awaitable } from "@antfu/utils";
3
- import { BuiltinLanguage, BuiltinTheme, CodeOptionsMeta, CodeOptionsThemes, CodeToHastOptions, CodeToHastOptionsCommon, Highlighter, HighlighterGeneric, LanguageInput } from "shiki";
3
+ import { BuiltinLanguage, BuiltinTheme, CodeOptionsMeta, CodeOptionsThemes, CodeToHastOptions, CodeToHastOptionsCommon, LanguageInput, LanguageRegistration, MaybeArray } from "shiki";
4
4
  import { RouteComponent, RouteMeta, RouteRecordRaw, Router } from "vue-router";
5
5
  import YAML from "yaml";
6
6
  import { MarkdownItShikiOptions } from "@shikijs/markdown-it";
7
7
  import { KatexOptions } from "katex";
8
+ import { CodeOptionsThemes as CodeOptionsThemes$1, ShorthandsBundle } from "shiki/core";
8
9
  import { MermaidConfig } from "mermaid";
9
10
  import * as monaco from "monaco-editor";
10
11
  import { VitePluginConfig } from "unocss/vite";
@@ -599,6 +600,12 @@ interface HeadmatterConfig extends TransitionOptions {
599
600
  * @default 'stopwatch'
600
601
  */
601
602
  timer?: 'stopwatch' | 'countdown';
603
+ /**
604
+ * Duration for shiki magic move transitions in milliseconds
605
+ *
606
+ * @default 800
607
+ */
608
+ magicMoveDuration?: number;
602
609
  }
603
610
  interface Frontmatter extends TransitionOptions {
604
611
  /**
@@ -750,7 +757,7 @@ interface FontOptions {
750
757
  */
751
758
  fallbacks?: boolean;
752
759
  }
753
- type BuiltinSlideTransition = 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'fade' | 'zoom' | 'none';
760
+ type BuiltinSlideTransition = 'fade' | 'fade-out' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'view-transition';
754
761
  interface TransitionOptions {
755
762
  /**
756
763
  * Page transition, powered by Vue's `<TransitionGroup/>`
@@ -762,6 +769,7 @@ interface TransitionOptions {
762
769
  * - slide-right
763
770
  * - slide-up
764
771
  * - slide-down
772
+ * - view-transition
765
773
  *
766
774
  * See https://sli.dev/guide/animations.html#pages-transitions
767
775
  *
@@ -913,14 +921,14 @@ interface ResolvedSlidevOptions extends RootsInfo, SlidevEntryOptions {
913
921
  utils: ResolvedSlidevUtils;
914
922
  }
915
923
  interface ResolvedSlidevUtils {
916
- shiki: HighlighterGeneric<any, any>;
917
- shikiOptions: MarkdownItShikiOptions;
924
+ shiki: ShorthandsBundle<string, string>;
925
+ shikiOptions: MarkdownItShikiOptions & CodeOptionsThemes$1;
918
926
  katexOptions: KatexOptions | null;
919
927
  indexHtml: string;
920
928
  define: Record<string, string>;
921
929
  iconsResolvePath: string[];
922
930
  isMonacoTypesIgnored: (pkg: string) => boolean;
923
- getLayouts: () => Record<string, string>;
931
+ getLayouts: () => Promise<Record<string, string>>;
924
932
  }
925
933
  interface SlidevServerOptions {
926
934
  /**
@@ -983,8 +991,7 @@ interface ShikiContext {
983
991
  loadTheme: (path: string) => Promise<any>;
984
992
  }
985
993
  type ShikiSetupReturn = Partial<Omit<CodeToHastOptionsCommon<BuiltinLanguage>, 'lang'> & CodeOptionsThemes<BuiltinTheme> & CodeOptionsMeta & {
986
- setup: (highlighter: Highlighter) => Awaitable<void>;
987
- langs: (LanguageInput | BuiltinLanguage)[];
994
+ langs: (MaybeArray<LanguageRegistration> | BuiltinLanguage)[] | Record<string, LanguageInput>;
988
995
  }>;
989
996
  interface TransformersSetupReturn {
990
997
  pre: (MarkdownTransformer | false)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/types",
3
- "version": "52.7.0",
3
+ "version": "52.9.0",
4
4
  "description": "Shared types declarations for Slidev",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -31,14 +31,14 @@
31
31
  "mermaid": "^11.12.1",
32
32
  "monaco-editor": "^0.54.0",
33
33
  "shiki": "^3.15.0",
34
- "unocss": "^66.5.4",
34
+ "unocss": "^66.5.5",
35
35
  "unplugin-icons": "^22.5.0",
36
36
  "unplugin-vue-markdown": "^29.2.0",
37
37
  "vite-plugin-inspect": "^11.3.3",
38
38
  "vite-plugin-remote-assets": "^2.1.0",
39
39
  "vite-plugin-static-copy": "^3.1.4",
40
40
  "vite-plugin-vue-server-ref": "^1.0.0",
41
- "vue": "^3.5.23",
41
+ "vue": "^3.5.24",
42
42
  "vue-router": "^4.6.3"
43
43
  },
44
44
  "scripts": {