/** * Type definitions for the Docusaurus Slidev Plugin */ /** * Plugin configuration options */ export interface PluginOptions { /** * Directory to scan for Slidev markdown files * Also determines the URL path where presentations are served * e.g., './slidev' -> '/slidev/', './presentations' -> '/presentations/' * @default './slidev' */ path: string; /** * @deprecated Use `path` instead. Will be removed in a future version. * Alias for `path` - directory to scan for Slidev markdown files */ sourceDir?: string; /** * Global theme override for all presentations * Example: '@slidev/theme-seriph' * @default undefined */ theme?: string; /** * Enable PDF download functionality in presentations * Requires playwright-chromium to be installed * @default false */ download: boolean; /** * URL path for the auto-generated overview page * Matches Docusaurus convention for route configuration * @default '/slidev' */ routeBasePath: string; /** * @deprecated Use `routeBasePath` instead. Will be removed in a future version. * Alias for `routeBasePath` */ overviewPath?: string; /** * Custom title for the overview page * @default 'Slidev Presentations' */ pageTitle?: string; /** * @deprecated Use `pageTitle` instead. Will be removed in a future version. * Alias for `pageTitle` */ overviewTitle?: string; /** * Custom tagline/description for the overview page * @default 'Interactive presentation overview' */ pageTagline?: string; /** * @deprecated Use `pageTagline` instead. Will be removed in a future version. * Alias for `pageTagline` */ overviewTagline?: string; /** * Plugin ID for multiple instances * @default 'default' */ id?: string; /** * Timeout in seconds for building each presentation * If a build takes longer than this, it will be terminated * @default 120 */ buildTimeout?: number; /** * Enable verbose logging for Slidev build output * Useful for debugging build issues * @default false */ verbose?: boolean; /** * Maximum number of parallel Slidev builds * Higher values speed up builds but use more system resources * Set to 1 for sequential builds (legacy behavior) * @default 4 (capped at CPU count) */ maxParallelBuilds?: number; /** * Glob patterns for assets to exclude from copying * Merged with built-in defaults * @default [] */ assetExcludePatterns?: string[]; /** * Glob patterns for assets to include * When set, only matching files are copied (whitelist mode) * @default undefined (copy all non-excluded) */ assetIncludePatterns?: string[]; /** * Whether to recursively copy subdirectories * - true: Copy entire directory tree * - false: Only copy files in same directory as .md file * @default true */ assetCopyRecursive?: boolean; } /** * Metadata extracted from a Slidev presentation */ export interface PresentationMetadata { /** * Unique identifier for the presentation * Generated from file path: 'module-01/slides.md' -> 'module-01-slides' */ id: string; /** * Title from frontmatter * Falls back to filename if not specified */ title: string; /** * Description from frontmatter */ description?: string; /** * Theme specified in frontmatter */ theme?: string; /** * Author from frontmatter */ author?: string; /** * Relative path to the source markdown file */ sourcePath: string; /** * Absolute path to the source markdown file */ sourceAbsolutePath: string; /** * URL path where the presentation will be served * Example: '/slides/module-01-slides/' */ url: string; /** * Output directory for the built presentation */ outputPath: string; /** * URL path to the preview HTML file * Example: '/slides/module-01-slides/preview.html' */ previewUrl?: string; /** * Manual sort position override from frontmatter * If not specified, sorting falls back to sourcePath then title */ position?: number; /** * Category path if presentation is inside a directory * Empty string for root-level presentations * Example: 'advanced' or 'workshops/intro' */ category?: string; /** * Explicit asset paths from frontmatter (normalized to array) * Paths are relative to the .md file's directory */ assets?: string[]; } /** * Slidev frontmatter configuration * These are extracted from the YAML frontmatter in .md files */ export interface SlidevFrontmatter { theme?: string; title?: string; description?: string; author?: string; highlighter?: string; transition?: string; background?: string; class?: string; /** * Manual sort position override * Lower numbers appear first in the overview * Supports decimals for fine-grained ordering (e.g., 2.5) */ position?: number; fonts?: { sans?: string; serif?: string; mono?: string; }; /** * Explicit asset paths to copy for this presentation * Paths are relative to the .md file's directory * When defined, ONLY these paths are copied (plus built-in excludes still apply) * @default undefined (automatic mode: copy all assets) */ assets?: string | string[]; [key: string]: any; } /** * Category metadata from _category_.yml or _category_.json files * Used to configure directory groupings in the overview */ export interface CategoryMetadata { /** * Directory path relative to sourceDir (e.g., 'advanced', 'workshops/intro') */ path: string; /** * Display name for the category * Falls back to directory name if not specified */ label: string; /** * Description shown in the category card/header */ description?: string; /** * Sort position for the category * Lower numbers appear first * @default 99 */ position: number; /** * Number of presentations in this category */ count: number; /** * URL path to navigate to this category's view */ url: string; } /** * Build result for a single presentation */ export interface BuildResult { /** * Presentation ID */ id: string; /** * Whether the build was successful */ success: boolean; /** * Error message if build failed */ error?: string; /** * Build duration in seconds */ duration?: number; } /** * Plugin content data * This is made available globally via Docusaurus */ export interface PluginContentData { /** * List of all discovered presentations */ presentations: PresentationMetadata[]; /** * List of all discovered categories (directories with presentations) */ categories: CategoryMetadata[]; /** * Plugin configuration */ config: PluginOptions; /** * Whether the site is running in development mode */ isDev: boolean; } //# sourceMappingURL=index.d.ts.map