/** What picking needs to know about the page's layout (faked in unit tests). */ export interface Look { box(el: Element): { left: number; top: number; width: number; height: number; }; /** The element draws something of its own — a background, border or shadow — so it reads as a block. */ drawn(el: Element): boolean; /** The element lays out its children as flex or grid, so with several children it visibly groups them. */ grouped(el: Element): boolean; viewport(): { width: number; height: number; }; /** * How the element sits in the page, for the keyboard's tree: its computed `display` and `position`, whether it * clips what overflows it (hidden or clip, never a scroll box), and whether it is set not to respond to the * pointer. Optional: without it every block counts. */ flow?(el: Element): Flow; } export interface Flow { display: string; position: string; clips: boolean; off: boolean; } /** * What comment mode leaves to the page: areas the author marked to ignore, where an add-on draws in the page (§11b), and a deck framework's own controls * (reveal.js's arrows, progress bar and slide number), which keep working without being marked. */ export declare const IGNORED = "[data-pipeup-ignore],pipeup-place,.reveal>:is(.controls,.progress,.slide-number)"; /** `el` is a block a click would choose: big enough to see, and marked, obvious, drawn or grouping things. */ export declare function isBlock(el: Element, look: Look): boolean; /** The obvious block under `from`: what the outline glides to in comment mode. */ export declare function pickBlock(from: Element, root: Element, look: Look): Element | null; /** The next block out from `el` with a different box (wrappers the same size are skipped). */ export declare function parentBlock(el: Element, root: Element, look: Look): Element | null; /** The real page: boxes from layout, "drawn" and "grouped" from computed styles. */ export declare function pageLook(): Look; /** A block in the keyboard's tree: the block around it, and its level (0 with no block inside it). */ export interface Block { el: Element; up: Block | null; level: number; } /** * Every block under `root` in page order, each with the block around it as `parentBlock` finds it: wrappers the * same size fold into the innermost, unless the outer one is marked (`data-pipeup-id`) and the inner one isn't. * Ignored areas, subtrees hidden from screen readers or clipped out of sight, and subtrees `keep` rejects * (hidden, on another slide), are left out. The keyboard stops only where a reviewer would click: never on what * doesn't take the pointer, on the parts inside a control (the control is the stop), on words styled inside a * line of text, or on tiny decorations; what the author marked always counts. */ export declare function blockTree(root: Element, look: Look, keep?: (el: Element) => boolean): Block[]; /** The blocks Tab visits at level `k`: at that level or below, with no block of that level around them. */ export declare const row: (tree: readonly Block[], k: number) => Block[]; /** The blocks directly inside `b`, in page order. */ export declare const childBlocks: (tree: readonly Block[], b: Block) => Block[];