@slidev/types 0.48.0-beta.1 → 0.48.0-beta.3

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 +39 -19
  2. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -341,28 +341,38 @@ type BuiltinSlideTransition = 'slide-up' | 'slide-down' | 'slide-left' | 'slide-
341
341
 
342
342
  type FrontmatterStyle = 'frontmatter' | 'yaml';
343
343
  interface SlideInfoBase {
344
- raw: string;
344
+ frontmatter: Record<string, any>;
345
345
  content: string;
346
346
  note?: string;
347
- frontmatter: Record<string, any>;
348
- frontmatterRaw?: string;
349
- frontmatterStyle?: FrontmatterStyle;
350
347
  title?: string;
351
348
  level?: number;
352
349
  }
353
- interface SlideInfo extends SlideInfoBase {
350
+ interface SourceSlideInfo extends SlideInfoBase {
351
+ /**
352
+ * The filepath of the markdown file
353
+ */
354
+ filepath: string;
355
+ /**
356
+ * The index of the slide in the markdown file
357
+ */
354
358
  index: number;
359
+ /**
360
+ * The range of the slide in the markdown file
361
+ */
355
362
  start: number;
356
363
  end: number;
357
- inline?: SlideInfoBase;
358
- source?: SlideInfoWithPath;
359
- snippetsUsed?: LoadedSnippets;
360
- }
361
- interface SlideInfoWithPath extends SlideInfoBase {
362
- filepath: string;
364
+ raw: string;
365
+ frontmatterRaw?: string;
366
+ frontmatterStyle?: FrontmatterStyle;
363
367
  }
364
- interface SlideInfoExtended extends SlideInfo {
365
- noteHTML: string;
368
+ interface SlideInfo extends SlideInfoBase {
369
+ /**
370
+ * The index of the slide in the presentation
371
+ */
372
+ index: number;
373
+ source: SourceSlideInfo;
374
+ snippetsUsed?: LoadedSnippets;
375
+ noteHTML?: string;
366
376
  }
367
377
  /**
368
378
  * Metadata for "slidev" field in themes' package.json
@@ -380,14 +390,25 @@ interface SlidevFeatureFlags {
380
390
  mermaid: boolean;
381
391
  }
382
392
  interface SlidevMarkdown {
383
- slides: SlideInfo[];
393
+ filepath: string;
384
394
  raw: string;
395
+ /**
396
+ * All slides in this markdown file
397
+ */
398
+ slides: SourceSlideInfo[];
399
+ }
400
+ interface SlidevData {
401
+ /**
402
+ * Slides that should be rendered (disabled slides excluded)
403
+ */
404
+ slides: SlideInfo[];
405
+ entry: SlidevMarkdown;
385
406
  config: SlidevConfig;
386
- features: SlidevFeatureFlags;
387
407
  headmatter: Record<string, unknown>;
388
- filepath?: string;
389
- entries?: string[];
408
+ features: SlidevFeatureFlags;
390
409
  themeMeta?: SlidevThemeMeta;
410
+ markdownFiles: Record<string, SlidevMarkdown>;
411
+ watchFiles: string[];
391
412
  }
392
413
  interface SlidevPreparserExtension {
393
414
  name: string;
@@ -395,7 +416,6 @@ interface SlidevPreparserExtension {
395
416
  transformSlide?: (content: string, frontmatter: any) => Promise<string | undefined>;
396
417
  }
397
418
  type PreparserExtensionLoader = (headmatter?: Record<string, unknown>, filepath?: string) => Promise<SlidevPreparserExtension[]>;
398
- type PreparserExtensionFromHeadmatter = (headmatter: any, exts: SlidevPreparserExtension[], filepath?: string) => Promise<SlidevPreparserExtension[]>;
399
419
  type RenderContext = 'slide' | 'overview' | 'presenter' | 'previewNext';
400
420
  type LoadedSnippets = Record<string, string>;
401
421
  type ClicksElement = Element | string;
@@ -524,4 +544,4 @@ interface TocItem {
524
544
  title?: string;
525
545
  }
526
546
 
527
- export { type AppContext, type AppSetup, type BuildArgs, type BuiltinSlideTransition, type ClicksContext, type ClicksElement, type ClicksInfo, type ClicksMap, type ClicksRelativeEls, type CommonArgs, type DrawingsOptions, type ExportArgs, type FontOptions, type FrontmatterStyle, type KatexSetup, type LoadedSnippets, type MermaidOptions, type MermaidSetup, type MonacoSetup, type MonacoSetupReturn, type NavOperations, type PreparserExtensionFromHeadmatter, type PreparserExtensionLoader, type PreparserSetup, type RenderContext, type ResolvedClicksInfo, type ResolvedDrawingsOptions, type ResolvedExportOptions, type ResolvedFontOptions, type ShikiContext, type ShikiSetup, type ShikiSetupReturn, type ShortcutOptions, type ShortcutsSetup, type SlideInfo, type SlideInfoBase, type SlideInfoExtended, type SlideInfoWithPath, type SlidevConfig, type SlidevFeatureFlags, type SlidevMarkdown, type SlidevPreparserExtension, type SlidevThemeConfig, type SlidevThemeMeta, type TocItem, type UnoSetup, defineAppSetup, defineKatexSetup, defineMermaidSetup, defineMonacoSetup, definePreparserSetup, defineShikiSetup, defineShortcutsSetup, defineUnoSetup };
547
+ export { type AppContext, type AppSetup, type BuildArgs, type BuiltinSlideTransition, type ClicksContext, type ClicksElement, type ClicksInfo, type ClicksMap, type ClicksRelativeEls, type CommonArgs, type DrawingsOptions, type ExportArgs, type FontOptions, type FrontmatterStyle, type KatexSetup, type LoadedSnippets, type MermaidOptions, type MermaidSetup, type MonacoSetup, type MonacoSetupReturn, type NavOperations, type PreparserExtensionLoader, type PreparserSetup, type RenderContext, type ResolvedClicksInfo, type ResolvedDrawingsOptions, type ResolvedExportOptions, type ResolvedFontOptions, type ShikiContext, type ShikiSetup, type ShikiSetupReturn, type ShortcutOptions, type ShortcutsSetup, type SlideInfo, type SlideInfoBase, type SlidevConfig, type SlidevData, type SlidevFeatureFlags, type SlidevMarkdown, type SlidevPreparserExtension, type SlidevThemeConfig, type SlidevThemeMeta, type SourceSlideInfo, type TocItem, type UnoSetup, defineAppSetup, defineKatexSetup, defineMermaidSetup, defineMonacoSetup, definePreparserSetup, defineShikiSetup, defineShortcutsSetup, defineUnoSetup };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/types",
3
- "version": "0.48.0-beta.1",
3
+ "version": "0.48.0-beta.3",
4
4
  "description": "Shared types declarations for Slidev",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",