@slidev/types 0.49.18 → 0.49.20

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.
Files changed (2) hide show
  1. package/dist/index.d.mts +158 -54
  2. package/package.json +1 -1
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, MaybeRefOrGetter, App, Ref, ComputedRef } from 'vue';
3
+ import { Component, MaybeRefOrGetter, 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 { KatexOptions } from 'katex';
@@ -45,7 +45,15 @@ interface BuildArgs extends ExportArgs {
45
45
  inspect: boolean;
46
46
  }
47
47
 
48
- interface Headmatter {
48
+ 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';
49
+
50
+ interface Headmatter extends HeadmatterConfig, Frontmatter {
51
+ /**
52
+ * Default frontmatter options applied to all slides
53
+ */
54
+ defaults?: Frontmatter;
55
+ }
56
+ interface HeadmatterConfig extends TransitionOptions {
49
57
  /**
50
58
  * Title of the slides
51
59
  */
@@ -60,7 +68,7 @@ interface Headmatter {
60
68
  /**
61
69
  * Theme to use for the slides
62
70
  *
63
- * @see https://sli.dev/themes/use.html
71
+ * See https://sli.dev/themes/use.html
64
72
  * @default 'default'
65
73
  */
66
74
  theme?: string;
@@ -99,7 +107,7 @@ interface Headmatter {
99
107
  /**
100
108
  * Prefer highlighter
101
109
  *
102
- * @see https://sli.dev/custom/config-highlighter.html
110
+ * See https://sli.dev/custom/config-highlighter.html
103
111
  * @default shiki
104
112
  */
105
113
  highlighter?: 'shiki' | 'prism';
@@ -162,7 +170,7 @@ interface Headmatter {
162
170
  *
163
171
  * @default {}
164
172
  */
165
- fonts?: ResolvedFontOptions;
173
+ fonts?: FontOptions;
166
174
  /**
167
175
  * Configure the icon for app
168
176
  *
@@ -174,7 +182,7 @@ interface Headmatter {
174
182
  *
175
183
  * @default {}
176
184
  */
177
- drawings?: ResolvedDrawingsOptions;
185
+ drawings?: DrawingsOptions;
178
186
  /**
179
187
  * URL of PlantUML server used to render diagrams
180
188
  *
@@ -198,7 +206,7 @@ interface Headmatter {
198
206
  /**
199
207
  * Engine for Atomic CSS
200
208
  *
201
- * @see https://unocss.dev/
209
+ * See https://unocss.dev/
202
210
  * @deprecated
203
211
  * @default 'unocss'
204
212
  */
@@ -216,26 +224,12 @@ interface Headmatter {
216
224
  */
217
225
  htmlAttrs?: Record<string, string>;
218
226
  /**
219
- * Page transition, powered by Vue's <TransitionGroup/>
227
+ * Suppport MDC syntax
220
228
  *
221
- * Built-in transitions:
222
- * - fade
223
- * - fade-out
224
- * - slide-left
225
- * - slide-right
226
- * - slide-up
227
- * - slide-down
229
+ * See https://github.com/antfu/markdown-it-mdc
228
230
  *
229
- * @see https://sli.dev/guide/animations.html#pages-transitions
230
- * @see https://vuejs.org/guide/built-ins/transition.html
231
- */
232
- transition?: BuiltinSlideTransition | string | TransitionGroupProps | null;
233
- /**
234
- * Suppport MDC syntax
231
+ * See https://content.nuxtjs.org/guide/writing/mdc
235
232
  *
236
- * @see https://github.com/antfu/markdown-it-mdc
237
- * @see https://content.nuxtjs.org/guide/writing/mdc
238
- * @experimental
239
233
  * @default false
240
234
  */
241
235
  mdc?: boolean;
@@ -255,12 +249,6 @@ interface Headmatter {
255
249
  * Enable wake lock
256
250
  */
257
251
  wakeLock?: boolean | 'dev' | 'build';
258
- /**
259
- * Options for export
260
- *
261
- * @default {}
262
- */
263
- export?: ResolvedExportOptions;
264
252
  /**
265
253
  * Force the filename used when exporting the presentation.
266
254
  * The extension, e.g. .pdf, gets automatically added.
@@ -271,7 +259,7 @@ interface Headmatter {
271
259
  /**
272
260
  * Enable Monaco
273
261
  *
274
- * @see https://sli.dev/custom/config-monaco.html
262
+ * See https://sli.dev/custom/config-monaco.html
275
263
  * @default true
276
264
  */
277
265
  monaco?: boolean | 'dev' | 'build';
@@ -303,7 +291,102 @@ interface Headmatter {
303
291
  */
304
292
  monacoRunAdditionalDeps?: string[];
305
293
  }
306
- interface SlidevConfig extends Required<Headmatter> {
294
+ interface Frontmatter extends TransitionOptions {
295
+ /**
296
+ * Slide layout to use
297
+ *
298
+ * Default to 'cover' for the first slide, 'default' for the rest
299
+ */
300
+ layout?: BuiltinLayouts | string;
301
+ /**
302
+ * Custom class added to the slide root element
303
+ */
304
+ class?: string | string[] | Record<string, unknown>;
305
+ /**
306
+ * Manually specified the total clicks needed to this slide
307
+ *
308
+ * When not specified, the clicks will be calculated by the usage of v-clicks
309
+ *
310
+ * See https://sli.dev/guide/animations
311
+ */
312
+ clicks?: number;
313
+ /**
314
+ * Manually specified the total clicks needed to this slide to start
315
+ *
316
+ * @default 0
317
+ */
318
+ clicksStart?: number;
319
+ /**
320
+ * Preload the slide when the previous slide is active
321
+ * @default true
322
+ */
323
+ preload?: boolean;
324
+ /**
325
+ * Completely hide and disable the slide
326
+ */
327
+ hide?: boolean;
328
+ /**
329
+ * Same as `hide`, completely hide and disable the slide
330
+ */
331
+ disabled?: boolean;
332
+ /**
333
+ * hide the slide for the `<Toc>` components
334
+ *
335
+ * See https://sli.dev/builtin/components#toc
336
+ */
337
+ hideInToc?: boolean;
338
+ /**
339
+ * Override the title level for the <TitleRenderer> and <Toc> components
340
+ * Only if `title` has also been declared
341
+ */
342
+ level?: number;
343
+ /**
344
+ * Create a route alias that can be used in the URL or with the <Link> component
345
+ */
346
+ routeAlias?: string;
347
+ /**
348
+ * Custom zoom level for the slide
349
+ * @default 1
350
+ */
351
+ zoom?: number;
352
+ /**
353
+ * Store the positions of draggable elements
354
+ * Normally you don't need to set this manually
355
+ *
356
+ * See https://sli.dev/features/draggable
357
+ */
358
+ dragPos?: Record<string, string>[];
359
+ /**
360
+ * Includes a markdown file
361
+ *
362
+ * See https://sli.dev/guide/syntax.html#importing-slides
363
+ */
364
+ src?: string;
365
+ }
366
+ interface DrawingsOptions {
367
+ /**
368
+ * Persist the drawings to disk
369
+ * Passing string to specify the directory (default to `.slidev/drawings`)
370
+ *
371
+ * @default false
372
+ */
373
+ persist?: boolean | string;
374
+ /**
375
+ * @default true
376
+ */
377
+ enabled?: boolean | 'dev' | 'build';
378
+ /**
379
+ * Only allow drawing from presenter mode
380
+ *
381
+ * @default false
382
+ */
383
+ presenterOnly?: boolean;
384
+ /**
385
+ * Sync drawing for all instances
386
+ *
387
+ * @default true
388
+ */
389
+ syncAll?: boolean;
307
390
  }
308
391
  interface FontOptions {
309
392
  /**
@@ -353,30 +436,52 @@ interface FontOptions {
353
436
  */
354
437
  fallbacks?: boolean;
355
438
  }
356
- interface DrawingsOptions {
439
+ type BuiltinSlideTransition = 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'fade' | 'zoom' | 'none';
440
+ interface TransitionOptions {
357
441
  /**
358
- * Persist the drawings to disk
359
- * Passing string to specify the directory (default to `.slidev/drawings`)
442
+ * Page transition, powered by Vue's `<TransitionGroup/>`
360
443
  *
361
- * @default false
362
- */
363
- persist?: boolean | string;
364
- /**
365
- * @default true
366
- */
367
- enabled?: boolean | 'dev' | 'build';
368
- /**
369
- * Only allow drawing from presenter mode
444
+ * Built-in transitions:
445
+ * - fade
446
+ * - fade-out
447
+ * - slide-left
448
+ * - slide-right
449
+ * - slide-up
450
+ * - slide-down
370
451
  *
371
- * @default false
372
- */
373
- presenterOnly?: boolean;
374
- /**
375
- * Sync drawing for all instances
452
+ * See https://sli.dev/guide/animations.html#pages-transitions
376
453
  *
377
- * @default true
454
+ * See https://vuejs.org/guide/built-ins/transition.html
378
455
  */
379
- syncAll?: boolean;
456
+ transition?: BuiltinSlideTransition | string | TransitionGroupProps | null;
457
+ }
458
+ interface TransitionGroupProps {
459
+ appear?: boolean;
460
+ persisted?: boolean;
461
+ tag?: string;
462
+ moveClass?: string;
463
+ css?: boolean;
464
+ duration?: number | {
465
+ enter: number;
466
+ leave: number;
467
+ };
468
+ enterFromClass?: string;
469
+ enterActiveClass?: string;
470
+ enterToClass?: string;
471
+ appearFromClass?: string;
472
+ appearActiveClass?: string;
473
+ appearToClass?: string;
474
+ leaveFromClass?: string;
475
+ leaveActiveClass?: string;
476
+ leaveToClass?: string;
477
+ }
478
+
479
+ interface ResolvedSlidevConfigSub {
480
+ export: ResolvedExportOptions;
481
+ drawings: ResolvedDrawingsOptions;
482
+ fonts: ResolvedFontOptions;
483
+ }
484
+ interface SlidevConfig extends Omit<Required<HeadmatterConfig>, keyof ResolvedSlidevConfigSub>, ResolvedSlidevConfigSub {
380
485
  }
381
486
  interface ResolvedFontOptions {
382
487
  sans: string[];
@@ -399,7 +504,6 @@ interface ResolvedExportOptions extends Omit<ExportArgs, 'entry' | 'theme'> {
399
504
  executablePath?: string;
400
505
  withToc?: boolean;
401
506
  }
402
- type BuiltinSlideTransition = 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'fade' | 'zoom' | 'none';
403
507
 
404
508
  type FrontmatterStyle = 'frontmatter' | 'yaml';
405
509
  interface SlideInfoBase {
@@ -783,7 +887,7 @@ declare module 'vite' {
783
887
  /**
784
888
  * Custom internal plugin options for Slidev (advanced)
785
889
  *
786
- * @see https://github.com/slidevjs/slidev/blob/main/packages/slidev/node/options.ts#L50
890
+ * See https://github.com/slidevjs/slidev/blob/main/packages/slidev/node/options.ts#L50
787
891
  */
788
892
  slidev?: SlidevPluginOptions;
789
893
  }
@@ -842,4 +946,4 @@ interface ClicksContext {
842
946
  readonly total: number;
843
947
  }
844
948
 
845
- 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 Headmatter, type KatexSetup, type LoadedSnippets, type MarkdownTransformContext, type MarkdownTransformer, type MermaidSetup, type MonacoSetup, type MonacoSetupReturn, type NavOperations, type NormalizedAtValue, type NormalizedRangeClickValue, type NormalizedSingleClickValue, type PreparserExtensionLoader, type PreparserSetup, type RawAtValue, type RawRangeAtValue, type RawSingleAtValue, type RenderContext, type ResolvedDrawingsOptions, type ResolvedExportOptions, type ResolvedFontOptions, type ResolvedSlidevOptions, type ResolvedSlidevUtils, 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 TransformersSetup, type TransformersSetupReturn, type UnoSetup, defineAppSetup, defineCodeRunnersSetup, defineContextMenuSetup, defineKatexSetup, defineMermaidSetup, defineMonacoSetup, definePreparserSetup, defineRootSetup, defineRoutesSetup, defineShikiSetup, defineShortcutsSetup, defineTransformersSetup, defineUnoSetup };
949
+ 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 Frontmatter, type FrontmatterStyle, type Headmatter, type HeadmatterConfig, type KatexSetup, type LoadedSnippets, type MarkdownTransformContext, type MarkdownTransformer, type MermaidSetup, type MonacoSetup, type MonacoSetupReturn, type NavOperations, type NormalizedAtValue, type NormalizedRangeClickValue, type NormalizedSingleClickValue, type PreparserExtensionLoader, type PreparserSetup, type RawAtValue, type RawRangeAtValue, type RawSingleAtValue, type RenderContext, type ResolvedDrawingsOptions, type ResolvedExportOptions, type ResolvedFontOptions, type ResolvedSlidevConfigSub, type ResolvedSlidevOptions, type ResolvedSlidevUtils, 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 TransformersSetup, type TransformersSetupReturn, type TransitionGroupProps, type TransitionOptions, type UnoSetup, defineAppSetup, defineCodeRunnersSetup, defineContextMenuSetup, defineKatexSetup, defineMermaidSetup, defineMonacoSetup, definePreparserSetup, defineRootSetup, defineRoutesSetup, defineShikiSetup, defineShortcutsSetup, defineTransformersSetup, defineUnoSetup };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/types",
3
- "version": "0.49.18",
3
+ "version": "0.49.20",
4
4
  "description": "Shared types declarations for Slidev",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",