interface TextRun { text: string; bold?: boolean; italic?: boolean; underline?: boolean; size?: number; family?: string; color?: string; background?: string; } interface Paragraph { type: 'paragraph'; runs: TextRun[]; alignment: 'left' | 'center' | 'right' | 'justify'; spaceAbove: number; spaceBelow: number; lineSpacing: number; leftIndent: number; rightIndent: number; tabSet?: string; } interface TableCell { paragraphs: Paragraph[]; borders: number; colSpan?: number; rowSpan?: number; width?: number; foreground?: string; background?: string; } interface TableRow { cells: TableCell[]; height?: number; } interface Table { type: 'table'; rows: TableRow[]; width?: number; } type Block = Paragraph | Table; interface PageFormat { mediaSizeName: number; width: number; height: number; margins: { top: number; right: number; bottom: number; left: number; }; orientation: 'portrait' | 'landscape'; headerOffset: number; footerOffset: number; } interface DocumentMetadata { verificationCode: string; serial: string; } interface DocumentModel { pageFormat: PageFormat; metadata: DocumentMetadata; header: Paragraph[]; footer: Paragraph[]; body: Block[]; rawText: string; } interface RawUdfFiles { contentXml: string; propertiesXml: string; signBuffer: Buffer | null; } declare function extractUdf(input: string | Buffer): Promise; interface ParsedContent { rawText: string; pageFormat: Record; elementsNode: Record; stylesNode: unknown; } declare function parseContentXml(xml: string): ParsedContent; declare function parsePropertiesXml(xml: string): Record; declare function buildDocumentModel(rawText: string, pageFormat: Record, elementsNode: Record, stylesNode: unknown, metadata: { verificationCode: string; serial: string; }): DocumentModel; declare function renderText(model: DocumentModel): string; declare function renderHTML(model: DocumentModel): string; declare function renderMarkdown(model: DocumentModel): string; declare function renderPDF(model: DocumentModel): Promise; declare function renderDOCX(model: DocumentModel): Promise; type OutputFormat = 'pdf' | 'docx' | 'html' | 'txt' | 'md'; declare function parseUdf(input: string | Buffer): Promise; declare function convertUdf(input: string | Buffer, format: OutputFormat): Promise; export { type Block, type DocumentModel, type OutputFormat, type PageFormat, type Paragraph, type Table, type TextRun, buildDocumentModel, convertUdf, extractUdf, parseContentXml, parsePropertiesXml, parseUdf, renderDOCX, renderHTML, renderMarkdown, renderPDF, renderText };