import type { Rect } from './framing.js'; import { type Layout, type PageImage, type PageSource } from './options.js'; export declare const VISUALLY_HIDDEN = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap"; export interface ContentState { pages: PageSource[]; visiblePages: number[]; layout: Layout; /** Shows the page images (the plain view) instead of only describing them. */ plain: boolean; /** Accessible name of one page. */ label: (page: number) => string; /** Paper colour behind transparent page images, as a CSS colour. */ paper: string; } export interface ContentEvents { /** Plain view: a page image loaded (once per image; images shown recently are reused). */ onLoad(page: number): void; onError(page: number, error: unknown): void; /** Plain view: every visible page has loaded or failed. */ onShown(): void; } /** * What's on the visible pages, as DOM. In 3D it's hidden and describes the pages for screen * readers (the canvas itself is hidden from them). In the plain view it shows the pages too. */ export declare class PageContent { private readonly events; readonly element: HTMLDivElement; private key; private shown; private readonly images; constructor(events: ContentEvents); /** Brings the DOM up to date; cheap when nothing changed. */ show(state: ContentState): void; /** Rebuilds the DOM on the next show(), loading the images again. */ refresh(): void; private imageFor; /** Plain view: where the pages go, in px relative to the root. `null` hides the content again. */ place(box: Rect | null): void; } /** Identifies a page image: URLs by value, everything else by identity. */ export declare function sourceKey(source: PageImage): string;