@slidev/types 0.49.11 → 0.49.13

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
@@ -42,13 +42,14 @@ declare module '#slidev/custom-nav-controls' {
42
42
 
43
43
  declare module '#slidev/shiki' {
44
44
  import type { ShikiHighlighterCore } from 'shiki/core'
45
- import type { BundledLanguage, BundledTheme } from 'shiki'
45
+ import type { BundledLanguage, BundledTheme, CodeToHastOptions } from 'shiki'
46
46
 
47
47
  export { shikiToMonaco } from '@shikijs/monaco'
48
48
 
49
49
  export const langs: BundledLanguage[]
50
50
  export const themes: BundledTheme | Record<string, BundledTheme>
51
51
  export const shiki: Promise<ShikiHighlighterCore>
52
+ export function getHighlighter(): Promise<(code: string, lang: string, options?: Partial<CodeToHastOptions>) => string>
52
53
  }
53
54
 
54
55
  declare module '#slidev/setups/monaco' {
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { RouteMeta, RouteComponent, Router, RouteRecordRaw } from 'vue-router';
2
2
  import YAML from 'yaml';
3
- import { TransitionGroupProps, Component, App, Ref, ComputedRef } from 'vue';
3
+ import { TransitionGroupProps, MaybeRefOrGetter, Component, App, Ref, ComputedRef } from 'vue';
4
4
  import { Arrayable, Awaitable, ArgumentsType } from '@antfu/utils';
5
5
  import * as monaco from 'monaco-editor';
6
6
  import mermaid from 'mermaid';
@@ -25,6 +25,7 @@ interface ExportArgs extends CommonArgs {
25
25
  'format'?: string;
26
26
  'timeout'?: number;
27
27
  'wait'?: number;
28
+ 'wait-until'?: string;
28
29
  'range'?: string;
29
30
  'dark'?: boolean;
30
31
  'with-clicks'?: boolean;
@@ -238,9 +239,10 @@ interface SlidevConfig {
238
239
  * Engine for Atomic CSS
239
240
  *
240
241
  * @see https://unocss.dev/
242
+ * @deprecated
241
243
  * @default 'unocss'
242
244
  */
243
- css: 'unocss' | 'none';
245
+ css: 'unocss';
244
246
  /**
245
247
  * Enable presenter mode
246
248
  *
@@ -477,6 +479,10 @@ interface SlidevMarkdown {
477
479
  * All slides in this markdown file
478
480
  */
479
481
  slides: SourceSlideInfo[];
482
+ errors?: {
483
+ row: number;
484
+ message: string;
485
+ }[];
480
486
  }
481
487
  interface SlidevData {
482
488
  /**
@@ -515,7 +521,7 @@ interface CodeRunnerContext {
515
521
  /**
516
522
  * Highlight code with shiki.
517
523
  */
518
- highlight: (code: string, lang: string, options?: Partial<CodeToHastOptions>) => Promise<string>;
524
+ highlight: (code: string, lang: string, options?: Partial<CodeToHastOptions>) => string;
519
525
  /**
520
526
  * Use (other) code runner to run code.
521
527
  */
@@ -557,7 +563,7 @@ interface CodeRunnerOutputText {
557
563
  }
558
564
  type CodeRunnerOutputTextArray = CodeRunnerOutputText[];
559
565
  type CodeRunnerOutput = CodeRunnerOutputHtml | CodeRunnerOutputError | CodeRunnerOutputText | CodeRunnerOutputTextArray | CodeRunnerOutputDom;
560
- type CodeRunnerOutputs = Arrayable<CodeRunnerOutput>;
566
+ type CodeRunnerOutputs = MaybeRefOrGetter<Arrayable<CodeRunnerOutput>>;
561
567
  type CodeRunner = (code: string, ctx: CodeRunnerContext) => Awaitable<CodeRunnerOutputs>;
562
568
  type CodeRunnerProviders = Record<string, CodeRunner>;
563
569
 
@@ -790,14 +796,16 @@ interface ClicksInfo {
790
796
  interface ClicksContext {
791
797
  current: number;
792
798
  readonly clicksStart: number;
793
- readonly relativeOffsets: Map<ClicksElement, number>;
799
+ readonly relativeSizeMap: Map<ClicksElement, number>;
794
800
  readonly maxMap: Map<ClicksElement, number>;
795
801
  calculateSince: (at: RawSingleAtValue, size?: number) => ClicksInfo | null;
796
802
  calculateRange: (at: RawRangeAtValue) => ClicksInfo | null;
797
803
  calculate: (at: RawAtValue) => ClicksInfo | null;
798
804
  register: (el: ClicksElement, info: Pick<ClicksInfo, 'delta' | 'max'> | null) => void;
799
805
  unregister: (el: ClicksElement) => void;
806
+ readonly isMounted: boolean;
800
807
  onMounted: () => void;
808
+ onUnmounted: () => void;
801
809
  readonly currentOffset: number;
802
810
  readonly total: number;
803
811
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/types",
3
- "version": "0.49.11",
3
+ "version": "0.49.13",
4
4
  "description": "Shared types declarations for Slidev",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -23,20 +23,20 @@
23
23
  "node": ">=18.0.0"
24
24
  },
25
25
  "dependencies": {
26
- "@antfu/utils": "^0.7.8",
26
+ "@antfu/utils": "^0.7.10",
27
27
  "@vitejs/plugin-vue": "^5.0.5",
28
- "@vitejs/plugin-vue-jsx": "^3.1.0",
28
+ "@vitejs/plugin-vue-jsx": "^4.0.0",
29
29
  "katex": "^0.16.10",
30
30
  "mermaid": "^10.9.1",
31
- "monaco-editor": "^0.49.0",
32
- "shiki": "^1.6.1",
33
- "unocss": "^0.60.4",
31
+ "monaco-editor": "^0.50.0",
32
+ "shiki": "^1.10.0",
33
+ "unocss": "^0.61.0",
34
34
  "unplugin-icons": "^0.19.0",
35
35
  "unplugin-vue-markdown": "^0.26.2",
36
36
  "vite-plugin-remote-assets": "^0.4.1",
37
37
  "vite-plugin-vue-server-ref": "^0.4.2",
38
- "vue": "^3.4.27",
39
- "vue-router": "^4.3.2"
38
+ "vue": "^3.4.31",
39
+ "vue-router": "^4.4.0"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "tsup src/index.ts",