export type WordStyleType = 'paragraph' | 'character' | 'table' | 'numbering'; export interface WordStyle { id: string; /** The style's name as stored (`heading 1`, `Quote`, `Box Title`). Built-in * styles carry Word's English name whatever the UI language. */ name: string; type: WordStyleType; basedOn?: string; /** Run formatting the style itself sets (character styles map to marks by * default from these). */ bold?: boolean; italic?: boolean; smallCaps?: boolean; script?: 'sup' | 'sub'; /** Numbering a list style carries (`List Bullet`, `List Number`). */ numId?: string; ilvl?: number; /** `w:outlineLvl` (0-based): a heading level the style declares. */ outlineLevel?: number; /** `w:tabs`: the tab stops the style sets or clears (#622). */ tabs?: WordTabStop[]; /** `w:spacing` of the style's run properties: the character spacing, in * twentieths of a point (negative condenses; #932). */ letterSpacing?: number; /** `w:sz` of the style's run properties, in half-points. */ fontSizeHalfPoints?: number; } /** A tab stop of a Word paragraph or style (`w:tab` in `w:tabs`, #622): * `val` its alignment (`left`, `right`, `center`, `decimal`, `start`, * `end`; `clear` removes an inherited stop at `pos`), `pos` in twips from * the start of the text, `leader` Word's leader word (`dot`, `hyphen`, * `underscore`, `middleDot`, `heavy`, `none`). */ export interface WordTabStop { val: string; pos: number; leader?: string; } export interface WordTextRun { type: 'text'; text: string; /** Direct formatting (undefined: not set on the run). */ bold?: boolean; italic?: boolean; smallCaps?: boolean; script?: 'sup' | 'sub'; /** Character style name, when the run has one. */ charStyle?: string; /** Live link target. */ href?: string; /** The run sets a font, size, colour, highlight, underline or caps by * hand: direct formatting Postext drops (quality report). */ manual?: boolean; /** Hidden text (`w:vanish`). */ hidden?: boolean; } export type WordRun = WordTextRun | { type: 'break'; kind: 'line' | 'page' | 'column'; } | { type: 'tab'; } | { type: 'note'; kind: 'footnote' | 'endnote'; id: string; } | { type: 'math'; tex: string; display: boolean; } | { type: 'image'; rId: string; name?: string; alt?: string; widthEmu?: number; heightEmu?: number; } | { type: 'index'; term: string[]; main?: boolean; see?: string; }; export interface WordParagraph { type: 'paragraph'; /** Paragraph style id ('' = the document's default). */ styleId: string; runs: WordRun[]; /** Word numbering on the paragraph (direct or from its style). */ list?: { numId: string; ilvl: number; }; pageBreakBefore?: boolean; /** The paragraph sets alignment, indents or spacing by hand. */ manualLayout?: boolean; /** `w:tabs` set on the paragraph itself (#622). */ tabs?: WordTabStop[]; /** Paragraphs of text boxes anchored in this paragraph. */ textBoxes?: WordBlock[]; } export interface WordCell { blocks: WordBlock[]; colSpan: number; /** `w:vMerge`: 'restart' opens a vertical merge, 'continue' is covered. */ vMerge?: 'restart' | 'continue'; shading?: string; } export interface WordTable { type: 'table'; rows: WordCell[][]; /** Rows marked to repeat as the header (`w:tblHeader`). */ headerRows: number; /** Grid column widths (twips), when the table declares them. */ widths?: number[]; } export type WordBlock = WordParagraph | WordTable; export interface WordNumberingLevel { /** `bullet`, `decimal`, `lowerLetter`, `upperRoman`… */ format: string; start: number; } export interface WordNumbering { /** numId → abstract id and per-level start overrides. */ nums: Map; }>; abstracts: Map>; } export interface WordMedia { path: string; bytes: Uint8Array; contentType: string; } export interface WordDocument { blocks: WordBlock[]; styles: Map; /** Id of the default paragraph style (`Normal`). */ defaultParagraphStyle: string; /** `w:docDefaults` size, half-points: the size of text whose styles set none. */ defaultFontSizeHalfPoints?: number; numbering: WordNumbering; footnotes: Map; endnotes: Map; /** Relationship id → picture. */ media: Map; /** Core properties. */ title?: string; author?: string; /** The import template a Postext export embeds (`customXml`), as stored. */ embeddedTemplate?: unknown; /** Revision marks and comments met while reading (quality report). */ revisions: { insertions: number; deletions: number; comments: number; }; } /** A paragraph's style name ('Normal' when unset). */ export declare function paragraphStyleName(doc: WordDocument, p: WordParagraph): string; /** Plain text of a paragraph's runs (tabs and breaks as spaces). */ export declare function paragraphText(p: WordParagraph): string; //# sourceMappingURL=model.d.ts.map