@slidev/types 52.8.0 → 52.9.1

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";
@@ -756,7 +757,7 @@ interface FontOptions {
756
757
  */
757
758
  fallbacks?: boolean;
758
759
  }
759
- 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';
760
761
  interface TransitionOptions {
761
762
  /**
762
763
  * Page transition, powered by Vue's `<TransitionGroup/>`
@@ -768,6 +769,7 @@ interface TransitionOptions {
768
769
  * - slide-right
769
770
  * - slide-up
770
771
  * - slide-down
772
+ * - view-transition
771
773
  *
772
774
  * See https://sli.dev/guide/animations.html#pages-transitions
773
775
  *
@@ -919,14 +921,14 @@ interface ResolvedSlidevOptions extends RootsInfo, SlidevEntryOptions {
919
921
  utils: ResolvedSlidevUtils;
920
922
  }
921
923
  interface ResolvedSlidevUtils {
922
- shiki: HighlighterGeneric<any, any>;
923
- shikiOptions: MarkdownItShikiOptions;
924
+ shiki: ShorthandsBundle<string, string>;
925
+ shikiOptions: MarkdownItShikiOptions & CodeOptionsThemes$1;
924
926
  katexOptions: KatexOptions | null;
925
927
  indexHtml: string;
926
928
  define: Record<string, string>;
927
929
  iconsResolvePath: string[];
928
930
  isMonacoTypesIgnored: (pkg: string) => boolean;
929
- getLayouts: () => Record<string, string>;
931
+ getLayouts: () => Promise<Record<string, string>>;
930
932
  }
931
933
  interface SlidevServerOptions {
932
934
  /**
@@ -989,8 +991,7 @@ interface ShikiContext {
989
991
  loadTheme: (path: string) => Promise<any>;
990
992
  }
991
993
  type ShikiSetupReturn = Partial<Omit<CodeToHastOptionsCommon<BuiltinLanguage>, 'lang'> & CodeOptionsThemes<BuiltinTheme> & CodeOptionsMeta & {
992
- setup: (highlighter: Highlighter) => Awaitable<void>;
993
- langs: (LanguageInput | BuiltinLanguage)[];
994
+ langs: (MaybeArray<LanguageRegistration> | BuiltinLanguage)[] | Record<string, LanguageInput>;
994
995
  }>;
995
996
  interface TransformersSetupReturn {
996
997
  pre: (MarkdownTransformer | false)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/types",
3
- "version": "52.8.0",
3
+ "version": "52.9.1",
4
4
  "description": "Shared types declarations for Slidev",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",