/** * Manuscript Assembler * Combines chapters into a complete manuscript */ import type { ExportFormat } from '../types/novel.js'; export interface ManuscriptMetadata { title: string; author: string; genre?: string; copyright?: string; dedication?: string; acknowledgments?: string; about?: string; } export interface AssembleOptions { includeMetadata?: boolean; includeFrontMatter?: boolean; includeChapterNumbers?: boolean; sceneBreak?: string; chapterBreak?: string; filter?: { chapters?: number[]; status?: string[]; }; } export declare class ManuscriptAssembler { private projectPath; constructor(projectPath: string); /** * Assemble all chapters into a single manuscript */ assemble(metadata: ManuscriptMetadata, options?: AssembleOptions): Promise; /** * Load all chapter files, sorted by chapter number */ private loadChapters; /** * Parse chapter file to extract metadata and number */ private parseChapterFile; /** * Assemble a single chapter with its scenes */ private assembleChapter; /** * Process scene markers in chapter content */ private processScenes; /** * Build title page */ private buildTitlePage; /** * Build dedication page */ private buildDedication; /** * Build acknowledgments section */ private buildAcknowledgments; /** * Build about the author section */ private buildAboutAuthor; /** * Check whether pandoc is available on the system PATH. * Resolves to true if `pandoc --version` exits cleanly, false otherwise. */ private isPandocAvailable; /** * Export the manuscript in the requested format. * * - 'markdown': writes assembled markdown directly to outputPath. * - 'docx' | 'epub' | 'pdf': assemble markdown to a temp file then invoke * pandoc to convert it. If pandoc is not installed an error is thrown with * a helpful message that includes the manual pandoc command the user can run. * * @param projectId Project identifier (used to derive a temp markdown path). * @param format Target export format. * @param outputPath Destination file path (the caller decides extension). * @param metadata Manuscript front-matter (title, author, …). * @param options Assemble options (chapter filters, etc.). * @returns Resolved output path and format; may include an optional warning. */ exportFormatted(projectId: string, format: ExportFormat, outputPath: string, metadata: ManuscriptMetadata, options?: AssembleOptions): Promise<{ path: string; format: ExportFormat; warning?: string; }>; /** * Generate an export header block including title, author, genre, word count, * and a simple Table of Contents with estimated page numbers (250 words/page). * * @param metadata Manuscript metadata (title, author, genre). * @param filter Optional chapter filter (same as assemble). * @returns A formatted header string ready to prepend to the manuscript. */ generateExportHeader(metadata: ManuscriptMetadata, filter?: AssembleOptions['filter']): Promise; /** * Get manuscript statistics */ getStats(filter?: AssembleOptions['filter']): Promise<{ totalChapters: number; totalWords: number; totalCharacters: number; averageChapterLength: number; chapters: Array<{ number: number; title: string; wordCount: number; characterCount: number; }>; }>; /** * Export manuscript to file */ exportToFile(outputPath: string, metadata: ManuscriptMetadata, options?: AssembleOptions): Promise; } //# sourceMappingURL=manuscript-assembler.d.ts.map