import type { PostextConfig, TableModel } from '../types.js'; import type { WordBlock, WordDocument, WordMedia, WordParagraph, WordTable, WordTabStop } from './model.js'; import { type CharacterTarget, type ParagraphTarget, type WordTemplate } from './template.js'; export type ChapterMode = 'single' | 'split'; export interface ImportedPicture { id: string; media: WordMedia; name?: string; alt?: string; caption?: string; /** The picture's printed extent in the document, EMU (914 400 an * inch): with the file's pixels it gives the resolution the author * set it at (`pictureResolution`). */ widthEmu?: number; heightEmu?: number; } /** The resolution a Word picture was printed at (#631): its pixel width * over its extent in inches, rounded to two decimals; undefined without * an extent or pixels. Hosts store it as `Resource.bitmap.fileResolution`, * in preference to the file's own metadata. */ export declare function pictureResolution(pic: Pick, pixelWidth: number): number | undefined; export interface ImportedTable { id: string; model: TableModel; caption?: string; } export interface ImportedChapter { title: string; markdown: string; } export interface ImportResult { chapters: ImportedChapter[]; pictures: ImportedPicture[]; tables: ImportedTable[]; /** Pictures in formats the Sandbox cannot show (EMF, WMF, TIFF). */ skippedPictures: string[]; /** Footnotes on headings (a heading prints a marker as text): dropped. */ droppedHeadingNotes: number; } export interface ImportSettings { template: WordTemplate; config: PostextConfig; /** One chapter, or a new chapter at every level-1 heading (and at every * `Postext Chapter` paragraph of a Sandbox export). */ chapters: ChapterMode; /** Resource ids already taken (the project's). */ existingIds: ReadonlySet; /** Title of text before the first chapter break. */ untitledChapter: string; } /** The tab stops a Word paragraph has (#622): its style chain's, base * first, then its own; a `clear` removes the stop at its position. Sorted, * the alignments Postext sets only. */ export declare function paragraphTabs(doc: WordDocument, p: WordParagraph): WordTabStop[]; /** The target of a paragraph style: the template's, else a guess. */ export declare function paragraphTargetOf(doc: WordDocument, styleId: string, template: WordTemplate, config: PostextConfig): ParagraphTarget; /** The target of a character style: the template's, else a guess. */ export declare function characterTargetOf(doc: WordDocument, name: string, template: WordTemplate, config: PostextConfig): CharacterTarget; /** A caption without its typed label (Postext numbers resources). */ export declare function stripCaptionLabel(text: string): string; /** A Word table as a Postext table model: merged cells as spans (covered * cells point at the cell covering them), the header rows, the column * widths as weights and the cell fills. */ export declare function tableModel(t: WordTable, text: (blocks: WordBlock[]) => string): TableModel; /** Convert a read Word document to Postext chapters and resources. */ export declare function wordToPostext(doc: WordDocument, settings: ImportSettings): ImportResult; //# sourceMappingURL=toMarkdown.d.ts.map