` and each ``
* — paired with the text of the nearest heading PRECEDING it, or `undefined`
* when no heading does.
*
* One query returns the headings and the surfaces interleaved in document order,
* so a single walk over that list names all of them: the heading a surface
* belongs to is the last one seen before reaching it. Naming each surface by
* searching backwards from it instead would re-read the same prose once per
* surface, at a cost that grows with the product of the two.
*
* Blank headings never enter the list, so a decorative empty heading names
* nothing and the section above it is used instead. A heading INSIDE a surface
* (a `` or a table cell holding one) comes AFTER that surface in document
* order and so can never name it, though it does name later surfaces — exactly
* as being the last heading before them implies.
*
* Read in full before the pass wraps anything, and safely so: a name depends
* only on what PRECEDES its surface, and `ensureScrollWrapper` puts the wrapper
* in the table's own place, moving nothing else and leaving every heading where
* it was — so a name stays true whether its table is wrapped yet or not.
*/
export declare function labelledProseSurfaces(root: Element): LabelledProseSurface[];
/** A prose surface's scrolling box and the name it would take on its own. */
interface ProseSurfaceBox {
readonly surface: HTMLElement;
readonly name: string;
}
/**
* The same surfaces, each given a name no other one in the list carries.
*
* A name is only as useful as it is distinguishing, and one heading names every
* surface under it: two wide tables in one section, or two code blocks under no
* heading at all, would otherwise be two landmarks a reader hears identically
* and cannot choose between. A name more than one surface claims is therefore
* numbered, in document order, and a name only one surface claims is left alone.
*/
export declare function uniquelyNamed(boxes: readonly ProseSurfaceBox[]): TrackedSurface[];
export {};
//# sourceMappingURL=prose-regions.d.ts.map