/** One laid-out fragment of text within a line, styled by a single run. */ export interface LayoutFragment { text: string; xPx: number; widthPx: number; runIndex: number; bold?: boolean; italic?: boolean; fontFamily?: string; fontSizePt?: number; textScalePercent?: number; ligatures?: import('../ligatures.js').Ligatures; characterSpacingPx?: number; kerningThresholdPt?: number; /** An inline picture drawn in this fragment's box, bottom-aligned on the line. */ object?: import('./input.js').LayoutObject; color?: string; underline?: boolean; strike?: boolean; script?: 'super' | 'sub'; /** Top of the fragment's text box within the line, placing its baseline on the line's. */ topPx?: number; /** Height of the fragment's font box (ascent + descent), used as its CSS line height. */ boxHeightPx?: number; /** A tab's leader fill (dots, hyphens, a line…) drawn across its width. */ leader?: 'dot' | 'hyphen' | 'underscore' | 'heavy' | 'middleDot'; } /** One visual line of a paragraph, positioned within its block's box. */ export interface LayoutLine { yPx: number; heightPx: number; fragments: LayoutFragment[]; /** Distance from the line's top to its baseline. */ baselinePx?: number; /** Space skipped above this line to clear a picture wrapped top-and-bottom; `yPx` is below it. */ gapBeforePx?: number; /** Character range within the paragraph's concatenated run text, for hit-testing. */ sourceStart: number; sourceEnd: number; /** First unconsumed paragraph token, for reflow into a column of a different width. */ nextToken?: number; /** First token on this line, for reflowing a split table-cell paragraph. */ firstToken?: number; } export interface LayoutParagraphBox { kind: 'paragraph'; blockId: string; yPx: number; heightPx: number; lines: LayoutLine[]; /** Paragraph borders and shading, spanning the box's height at these horizontal bounds. */ frame?: LayoutParagraphFrame; } export interface LayoutParagraphFrame { leftPx: number; widthPx: number; borders?: import('./input.js').LayoutParagraphBorders; shading?: string; } /** Where a cell sits in its row and how it is drawn (borders, shading, padding). */ export interface LayoutCellGeometry { xPx: number; widthPx: number; paddingLeftPx: number; paddingRightPx: number; borders?: import('./input.js').LayoutCellBorders; shading?: string; verticalAlign?: 'top' | 'center' | 'bottom'; /** Height of the cell's content (with its top and bottom padding), for vertical alignment. */ contentHeightPx: number; } export interface LayoutTableRowBox { yPx: number; heightPx: number; /** True when this row is a repeated header copy rather than the row's first placement. */ repeated: boolean; cells: LayoutParagraphBox[][]; /** Per-cell position and appearance, parallel to `cells`. */ geometry?: LayoutCellGeometry[]; } export interface LayoutTableBox { kind: 'table'; blockId: string; /** Offset from the column's left edge (table indent or alignment). */ xPx?: number; yPx: number; heightPx: number; rows: LayoutTableRowBox[]; } export type LayoutBlockBox = LayoutParagraphBox | LayoutTableBox; export interface LayoutColumnBox { xPx: number; widthPx: number; blocks: LayoutBlockBox[]; } export interface LayoutPageBox { index: number; /** Index into the input sections this page belongs to. */ sectionIndex: number; /** Zero-based position of this page within its section (for first-page headers and numbering). */ pageInSection: number; widthPx: number; heightPx: number; marginTopPx: number; marginRightPx: number; marginBottomPx: number; marginLeftPx: number; columns: LayoutColumnBox[]; columnSeparator?: boolean; /** Floating pictures on this page, in page coordinates (CSS pixels from the sheet's top-left). */ floats?: LayoutFloatBox[]; /** Footnotes at the bottom of the page, in reference order; `yPx` values are within the area. */ footnotes?: LayoutFootnoteBox[]; } export interface LayoutFootnoteBox { id: string; /** Top of this note within the footnote area (below the separator). */ yPx: number; heightPx: number; paragraphs: LayoutParagraphBox[]; } export interface LayoutFloatBox { blockId: string; xPx: number; yPx: number; widthPx: number; heightPx: number; partName: string; contentType: string; behindText: boolean; /** `wp:wrapSquare`, `wrapTopAndBottom`… (`none` floats over or behind the text). */ wrap?: string; } export interface LayoutResult { pages: LayoutPageBox[]; /** Honest, human-readable notes on approximations relative to Word (see docs/parity-roadmap.md §3). */ approximations: string[]; } //# sourceMappingURL=result.d.ts.map