/** * Word's All Markup print with comments and formatting in balloons (issue #1300), behind * `commentColumnPlacement: "balloons"`. * * Word keeps the paper size: it shrinks the page, together with a grey markup area on its right, * until both fit the paper. Each comment, reply and formatting change gets a balloon in that area, * level with its line where there is room and tied to it by a leader line; insertions and * deletions stay inline. Here the page box itself is left paper-sized, and only a layer inside it * is shrunk, so PageMap pages, print sizing and the export's audits all still see the paper, and * PageMap fragments land where the shrunken text prints. */ import type { PageDimensions } from "./page-geometry.js"; /** * Word's balloon setting (View.MarkupMode), which decides what the balloons hold. `"mixed"` is * Word's default, "Show Only Comments and Formatting in Balloons": comments and formatting changes. * `"inline"` is "Show All Revisions Inline": comments only, so a formatting change keeps its change * bar and gets no balloon, and a page with no comment prints at full size. Word's third setting, * "Show Revisions in Balloons", also moves deletions into balloons; it is not reproduced. */ export type MarkupMode = "mixed" | "inline"; export declare const MARKUP_MODES: readonly MarkupMode[]; /** The balloon font when the document names none: Word's own. */ export interface MarkupBalloonFont { family: string; sizePt: number; stack?: string; } export declare const DEFAULT_BALLOON_FONT: MarkupBalloonFont; /** One margin comment from the converter's registry. */ export interface MarkupBalloonComment { id: string; parentId?: string; author?: string; initials?: string; color?: string; fontFamily?: string; fontStack?: string; /** w:date as the author's clock read it, for the printed heading of a comment cut short. */ dateAsWritten?: string; paragraphs: string[]; } export interface MarkupBalloonPage { dimensions: PageDimensions; element: HTMLElement; } /** * Reads the margin registry: notes in document order, a thread's replies nested in (so after) its * root, plus the class prefix the converter gave comment markup. */ export declare function readMarkupBalloonComments(registry: Element | null): { comments: MarkupBalloonComment[]; commentPrefix: string; }; /** * The converter's margin-note registry inside `root`: the comments the balloons show. Null when the * comments are rendered another way (as endnotes, or not at all), or there are none. */ export declare function marginNoteRegistry(root: ParentNode): Element | null; /** * Turns the balloon rules on or off for one pagination's staging and page containers. On, they go in * before anything is measured, because they change line breaks: Word prints no comment reference * mark, and paints the commented range itself (see `layoutMarkupBalloons`). Those two rules apply * only when the comments are in the balloons; comments listed as endnotes keep their marks and * highlights, since the list is reached through them. The rules apply only inside elements carrying * the scope attribute, so a later pagination in the same document is not affected, and turning them * off for its containers clears any attribute left behind. */ export declare function scopeMarkupBalloons(document: Document, containers: HTMLElement[], on: boolean, commentPrefix?: string, cssPrefix?: string): void; /** What a balloon layout could not print in full. */ export interface MarkupBalloonResult { /** Comments whose balloons were cut short to fit beside their page. */ truncatedCommentIds: string[]; /** Formatting balloons cut short to fit. */ truncatedFormatting: number; /** Comments marked on a page that got no balloon at all. */ unplacedCommentIds: string[]; /** * Every comment whose balloon was cut short, once each, in the order their balloons print: what a * page listing their full text needs. With `numberCutBoxes`, entry n's box reads "… [n]". */ cutComments: CutComment[]; } /** A comment whose balloon was cut short. */ export interface CutComment { commentId: string; /** The page its balloon is on, counted from 1. */ pageNumber: number; /** Its balloon's label without the colon, as `Commented [AB3]`. */ label: string; author?: string; dateAsWritten?: string; color: string; fill: string; textFont?: string; textFontStack?: string; paragraphs: string[]; } /** Lays out every page's markup area. Call once, on the finished page tree. */ export declare function layoutMarkupBalloons(options: { document: Document; pages: MarkupBalloonPage[]; comments: MarkupBalloonComment[]; commentPrefix: string; cssPrefix: string; font?: MarkupBalloonFont; /** Number each cut comment's box, "… [n]", for a listing of their full text (Word's Print to PDF). */ numberCutBoxes?: boolean; /** Word's balloon setting; default "mixed". */ markupMode?: MarkupMode; }): MarkupBalloonResult; export declare function fontStack(family: string, resolved?: string): string; //# sourceMappingURL=markup-balloons.d.ts.map