/** * Every string the document paints, with where it was written and what it * is — the authored side of the rendered pass's text matching (#344). * * The rendered PDF knows where each word landed and nothing about which * paragraph put it there. This inventory is the join key: a rendered finding * locates its words in the PDF, matches them back to one of these entries, * and reports at the entry's pointer. Walked over the expanded tree, so a * paragraph a block compiled is inventoried too; `prepareDocxQualityDocument` * then maps its pointer to the authored slot through the block source maps. * * An allowlist by component, unlike the placeholder walk that visits every * string: a colour, a style name or a file path is a string the page never * shows, and an entry the PDF cannot contain would read as clipped text. * * Two kinds of string are painted without being authored where they show. * A table of contents repeats the headings it collects — cached into the * field so headless LibreOffice shows them — and a native chart sets its * title and axis titles inside the drawing. Both are inventoried where they * render so a heading's first occurrence is not stolen by the contents page; * the contents entries are `optional`, since which headings a field collects * is the field's decision and an entry the page lacks is no defect. */ import type { QualityFact } from '@json-to-office/quality'; export type DocxTextRole = 'heading' | 'body' | 'list-item' | 'table-header' | 'table-cell' | 'statistic' | 'caption' | 'toc-entry' | 'chrome'; export interface DocxTextFact extends QualityFact { kind: 'docx/text'; text: string; role: DocxTextRole; /** Heading level, for `heading` entries. */ level?: number; /** Position in reading order across the whole document, from 0. */ order: number; /** * Set when the paragraph sits in a floating frame. Only the width is a * bound: a docx frame's height is a minimum the frame grows past, so the * rendered pass compares width alone. */ frame?: { widthPt: number; }; /** Header or footer text repeats on every page of its section. */ repeats?: boolean; /** Compiled by a block: `path` is the authored slot, not the paragraph. */ generated?: boolean; /** * Painted by the renderer from other authored text — a contents entry — * so its absence is not a defect and never a `missing` finding. */ optional?: boolean; } /** * Inventory the text of a component tree in reading order. `basePath` is the * pointer of the array `children` sits at; entries carry pointers to the * exact string so a finding lands where the author can edit it. */ export declare function collectDocxTextInventory(children: readonly unknown[], basePath?: string): DocxTextFact[]; //# sourceMappingURL=text-inventory.d.ts.map