/** * File system utilities for Slidev Plugin */ /** * The cache directory name within .docusaurus */ export declare const SLIDEV_CACHE_DIR = "docusaurus-plugin-slidev"; /** * Built-in patterns always excluded from asset copying * These are always excluded regardless of user configuration */ export declare const BUILT_IN_ASSET_EXCLUDES: string[]; /** * Options for asset copying */ export interface AssetCopyOptions { /** User-defined patterns to exclude */ excludePatterns: string[]; /** User-defined patterns to include (whitelist mode) */ includePatterns?: string[]; /** Whether to copy subdirectories recursively */ recursive: boolean; /** Explicit asset paths from frontmatter (relative to .md file) */ explicitAssets?: string[]; } /** * Cleans up the output directory before building presentations * Removes all subdirectories and files but preserves .gitignore */ export declare function cleanupOutputDirectory(outputPath: string): void; /** * Cleans up Slidev-generated files in the source directory * Removes index.html and other build artifacts but preserves .md files */ export declare function cleanupSourceDirectory(sourcePath: string): void; /** * Creates a .gitignore file in the output directory * Content: ignore all files except .gitignore itself */ export declare function createGitignore(outputPath: string): void; /** * Gets the Slidev cache directory path within .docusaurus * This is used to isolate builds and prevent race conditions * @param siteDir The Docusaurus site root directory * @param pluginId The plugin instance ID (for multi-instance support) * @returns Path to the plugin's cache directory */ export declare function getSlidevCacheDir(siteDir: string, pluginId?: string): string; /** * Creates an isolated build directory for a single presentation * Copies the source .md file and assets to its own directory to prevent index.html conflicts * during parallel builds. * * @param sourceAbsolutePath Absolute path to the source .md file * @param presentationId The unique ID for this presentation * @param cacheDir The base cache directory * @param assetOptions Options for asset copying (optional, defaults to copy all assets) * @returns Path to the copied .md file in the isolated directory */ export declare function createIsolatedBuildDir(sourceAbsolutePath: string, presentationId: string, cacheDir: string, assetOptions?: AssetCopyOptions): string; /** * Cleans up the isolated build directory after a build completes * Removes Slidev artifacts (index.html, .slidev, dist) from the isolated directory * * @param isolatedDir The isolated build directory to clean */ export declare function cleanupIsolatedBuildDir(isolatedDir: string): void; /** * Cleans the entire Slidev cache directory * Should be called at the start of a build to ensure a clean state * * @param cacheDir The cache directory to clean */ export declare function cleanupSlidevCache(cacheDir: string): void; /** * Gets the Slidev build output directory path within .docusaurus cache * This is where built presentations are stored before being copied to final output * @param siteDir The Docusaurus site root directory * @param pluginId The plugin instance ID (for multi-instance support) * @returns Path to the plugin's build output directory */ export declare function getSlidevBuildOutputDir(siteDir: string, pluginId?: string): string; /** * Copies built presentations from cache directory to final output directory * This is called in the postBuild hook to copy presentations to the final build output * * @param cacheOutputDir The cache directory containing built presentations * @param finalOutputDir The final output directory (e.g., build/slides) */ export declare function copyBuiltPresentationsToOutput(cacheOutputDir: string, finalOutputDir: string): void; //# sourceMappingURL=fileSystem.d.ts.map