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

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 +44 -20
  2. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -341,29 +341,43 @@ 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
  }
377
+ /**
378
+ * Editable fields for a slide
379
+ */
380
+ type SlidePatch = Partial<Pick<SlideInfoBase, 'content' | 'note'>>;
367
381
  /**
368
382
  * Metadata for "slidev" field in themes' package.json
369
383
  */
@@ -380,14 +394,25 @@ interface SlidevFeatureFlags {
380
394
  mermaid: boolean;
381
395
  }
382
396
  interface SlidevMarkdown {
383
- slides: SlideInfo[];
397
+ filepath: string;
384
398
  raw: string;
399
+ /**
400
+ * All slides in this markdown file
401
+ */
402
+ slides: SourceSlideInfo[];
403
+ }
404
+ interface SlidevData {
405
+ /**
406
+ * Slides that should be rendered (disabled slides excluded)
407
+ */
408
+ slides: SlideInfo[];
409
+ entry: SlidevMarkdown;
385
410
  config: SlidevConfig;
386
- features: SlidevFeatureFlags;
387
411
  headmatter: Record<string, unknown>;
388
- filepath?: string;
389
- entries?: string[];
412
+ features: SlidevFeatureFlags;
390
413
  themeMeta?: SlidevThemeMeta;
414
+ markdownFiles: Record<string, SlidevMarkdown>;
415
+ watchFiles: string[];
391
416
  }
392
417
  interface SlidevPreparserExtension {
393
418
  name: string;
@@ -395,8 +420,7 @@ interface SlidevPreparserExtension {
395
420
  transformSlide?: (content: string, frontmatter: any) => Promise<string | undefined>;
396
421
  }
397
422
  type PreparserExtensionLoader = (headmatter?: Record<string, unknown>, filepath?: string) => Promise<SlidevPreparserExtension[]>;
398
- type PreparserExtensionFromHeadmatter = (headmatter: any, exts: SlidevPreparserExtension[], filepath?: string) => Promise<SlidevPreparserExtension[]>;
399
- type RenderContext = 'slide' | 'overview' | 'presenter' | 'previewNext';
423
+ type RenderContext = 'none' | 'slide' | 'overview' | 'presenter' | 'previewNext';
400
424
  type LoadedSnippets = Record<string, string>;
401
425
  type ClicksElement = Element | string;
402
426
  type ClicksRelativeEls = Map<ClicksElement, number>;
@@ -524,4 +548,4 @@ interface TocItem {
524
548
  title?: string;
525
549
  }
526
550
 
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 };
551
+ 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 SlidePatch, 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.10",
4
4
  "description": "Shared types declarations for Slidev",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",