@slidev/types 0.48.0-beta.2 → 0.48.0-beta.4

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 -20
  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 SlideInfo {
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,15 +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;
391
- subSlides?: Record<string, SlidevMarkdown>;
410
+ markdownFiles: Record<string, SlidevMarkdown>;
411
+ watchFiles: string[];
392
412
  }
393
413
  interface SlidevPreparserExtension {
394
414
  name: string;
@@ -396,7 +416,6 @@ interface SlidevPreparserExtension {
396
416
  transformSlide?: (content: string, frontmatter: any) => Promise<string | undefined>;
397
417
  }
398
418
  type PreparserExtensionLoader = (headmatter?: Record<string, unknown>, filepath?: string) => Promise<SlidevPreparserExtension[]>;
399
- type PreparserExtensionFromHeadmatter = (headmatter: any, exts: SlidevPreparserExtension[], filepath?: string) => Promise<SlidevPreparserExtension[]>;
400
419
  type RenderContext = 'slide' | 'overview' | 'presenter' | 'previewNext';
401
420
  type LoadedSnippets = Record<string, string>;
402
421
  type ClicksElement = Element | string;
@@ -525,4 +544,4 @@ interface TocItem {
525
544
  title?: string;
526
545
  }
527
546
 
528
- 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.2",
3
+ "version": "0.48.0-beta.4",
4
4
  "description": "Shared types declarations for Slidev",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",