/** * Configuration options for extract command operations. * * Controls the behaviour of the extract command, which writes inline base64 image data URIs out to * real image files. * * @category Commands */ export interface ExtractOptions { /** Directory the extracted image files are written to (default: alongside each markdown file) */ outputDir?: string; /** Perform a dry run without making actual changes */ dryRun?: boolean; /** Enable verbose output with detailed progress information */ verbose?: boolean; /** Output results in JSON format instead of the human-readable summary */ json?: boolean; } /** * Summary of an extract run, in the shape emitted by `--json`. * * @category Commands */ export interface ExtractSummary { /** Always "extract", so JSON consumers can identify the command */ command: "extract"; /** Whether the run completed without errors */ success: boolean; /** Whether this was a dry run, so no files were touched */ dryRun: boolean; /** Number of markdown files examined */ filesProcessed: number; /** Markdown files whose content was rewritten (empty in a dry run) */ filesModified: string[]; /** Number of inline data URIs rewritten to file links */ imagesExtracted: number; /** Image files created (empty in a dry run) */ imagesCreated: string[]; /** Error messages, one per failure */ errors: string[]; /** Warning messages */ warnings: string[]; } /** * CLI command handler for extract operations. * * Writes each inline base64 image data URI in the given markdown files out to a real image file and * rewrites the markdown to link to it. The image filename derives from the alt text when it yields * a usable slug, otherwise a per-file `img-1`, `img-2`, ... counter is used; the extension comes * from the data URI's mime type. * * @category Commands * * @example * ```bash # Extract every inline image, writing files next to the markdown markmv extract doc.md * * # Write images to a shared asset directory markmv extract docs/*.md --output-dir assets/ ```; * * @param patterns - File patterns to process (supports globs) * @param options - Command options * * @throws Will exit the process with code 1 if the operation fails */ export declare function extractCommand(patterns: string[], options: ExtractOptions): Promise; //# sourceMappingURL=extract.d.ts.map