import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraHighlight}from'../document-viewer/anchors.js'; /** Lifecycle state shared by page-addressed viewers and ``. */ export type LyraPageViewerStatus='idle'|'loading'|'ready'|'error'; /** * Atomic, readonly state for a page-addressed document. `identity` changes at the start of every * load transaction, including a same-URL or same-page-count replacement, so consumers can discard * cached thumbnails without trying to infer document identity from `src`. */ export interface LyraPageViewerSnapshot{readonly identity:number;readonly status:LyraPageViewerStatus;readonly page:number;readonly pageCount:number;} /** Detail for `lr-page-viewer-state-change`. */ export interface LyraPageViewerStateChangeDetail{readonly snapshot:LyraPageViewerSnapshot;} /** An externally rendered DOM thumbnail owned by the caller until `dispose()` is invoked. */ export interface PageThumbnailRenderHandle{dispose():void;} /** What `` needs from a wired viewer. New page-addressed viewers expose the atomic * `pageViewerSnapshot`/`lr-page-viewer-state-change` protocol. The optional snapshot preserves * compatibility with older structural sources that emit `lr-load`/`lr-page-change`. A source * provides at least one thumbnail method: the canvas method preserves the original PDF contract, * while `renderPageThumbnailToContainer()` supports renderer-owned DOM/SVG previews such as PPTX. * The rail owns and disposes every handle returned by the container method. */ export interface PageThumbnailSource extends EventTarget{page:number;readonly pageViewerSnapshot?:LyraPageViewerSnapshot;renderPageThumbnail?(page:number,canvas:HTMLCanvasElement,options?:{width?:number;}):Promise;renderPageThumbnailToContainer?(page:number,container:HTMLElement,options?:{width?:number;}):Promise;}export interface LyraPageRailEventMap{'lr-page-select':CustomEvent<{page:number;}>;} /** * `` — a virtualized vertical thumbnail rail for page-addressed documents, with * per-page highlight heat markers. Two modes: **wired** (`viewer`/`for` supply a live * `PageThumbnailSource`, e.g. `lr-pdf-viewer` -- thumbnails render lazily as rows materialize, and * the rail tracks page/count from the viewer's own events) and **mediated** (`page-count`/`page` are * host-bound directly, rows render a placeholder glyph -- still a fully functional pager). In wired * mode the viewer's `page` is the single source of truth. * Unmodified digit keys provide page-number type-ahead; Alt/Ctrl/Meta-modified digits remain * available to browser and application shortcuts and never alter the page. * * @customElement lr-page-rail * @event lr-page-select - A page row was activated (click, or Enter/Space on a focused row). * `detail: { page }`. In wired mode the rail also sets `viewer.page` itself. * @csspart base - The rail. * @csspart pages - The embedded `lr-virtual-list`. * @csspart page - One page button. * @csspart page-current - The page button for the current `page` (also carries `page`). * @csspart thumbnail - The thumbnail canvas/DOM-preview wrapper. * @csspart thumbnail-target - The canvas or renderer-owned DOM-preview target. * @csspart page-number - The visible page number. * @csspart heat - The heat-marker cluster. * @csspart heat-dot - One tone-colored heat marker (or the `+n` overflow marker). * @csspart heat-dot-accent - An accent-tone heat marker (also carries `heat-dot`). * @csspart heat-dot-success - A success-tone heat marker (also carries `heat-dot`). * @csspart heat-dot-warning - A warning-tone heat marker (also carries `heat-dot`). * @csspart heat-dot-danger - A danger-tone heat marker (also carries `heat-dot`). * @csspart heat-dot-neutral - A neutral-tone heat marker (also carries `heat-dot`). * @csspart heat-dot-overflow - The `+n` overflow marker (also carries `heat-dot`). * @cssprop [--lr-page-rail-height=var(--lr-size-24rem)] - Block size of the virtualized rail. * @cssprop [--lr-page-rail-current-bg=var(--lr-color-brand-quiet)] - Background of the * `[part="page-current"]` button for the current `page`. * @cssprop [--lr-page-rail-heat-accent-color=var(--lr-color-brand)] - Background of an * accent-tone (the default tone) `[part="heat-dot"]` marker. * @cssprop [--lr-page-rail-heat-success-color=var(--lr-color-success)] - Background of a * success-tone `[part="heat-dot-success"]` marker. * @cssprop [--lr-page-rail-heat-warning-color=var(--lr-color-warning)] - Background of a * warning-tone `[part="heat-dot-warning"]` marker. * @cssprop [--lr-page-rail-heat-danger-color=var(--lr-color-danger)] - Background of a * danger-tone `[part="heat-dot-danger"]` marker. * @cssprop [--lr-page-rail-heat-neutral-color=var(--lr-color-text-quiet)] - Background of a * neutral-tone `[part="heat-dot-neutral"]` marker. * @status stable * @since 4.0.0 */ export declare class LyraPageRail extends LyraElement{static styles:import("lit").CSSResultGroup[];viewer:PageThumbnailSource|null; /** Id of a `PageThumbnailSource` in the same root, the label/`htmlFor`-style alternative to * `viewer`. */ for:string; /** Mediated-mode page count. Ignored while a viewer is wired (`viewer` or a resolved `for`). */ pageCount:number; /** Current page: auto-tracked in wired mode, host-bound in mediated mode. */ page:number;private _highlights; /** Per-page heat-marker highlights. IDs are trimmed and must be nonempty; the first record for * an ID is retained and blank or later duplicate records are ignored. */ get highlights():readonly LyraHighlight[];set highlights(value:readonly LyraHighlight[]); /** Thumbnail CSS-px width, clamped to the container (320px-safe). */ thumbWidth:number; /** Overrides the computed accessible name. */ label:string;private resolvedPageCount;private thumbnailStates;private allocationWidth;private readonly thumbnailRefs;private readonly thumbnailTargets;private readonly thumbnailHandles;private boundViewer;private digitBuffer; /** The digit buffer's reset debounce. Every digit restarts it, so "1" then "2" jumps to page 12 * rather than page 2; the buffer clears only once the quiet window passes. Scheduled on -- and * cancelled through -- the realm this rail lives in at the time, so one adopted into another * document neither leaves a task behind on the old realm nor loses the ability to cancel the * new one. Supersession is the controller's own generation guard, replacing the * handle-and-window identity check the inline timer carried. */ private readonly digitBufferReset;private thumbnailGeneration;private resizeObserver?;private targetObserver?;private readonly pendingAnimationFrames;private pendingFocusPage;private focusRepairPending;private focusRepairGeneration;private pageSourceCount;private pageSource;private viewerSnapshotIdentity?;private viewerSnapshotStatus?;private readonly onViewerLoad;private readonly onViewerPageChange;private readonly onViewerStateChange;protected willUpdate(changed:PropertyValues):void;connectedCallback():void;disconnectedCallback():void;adoptedCallback():void;private resolveViewer;private observeForTarget;private unbindViewer;private applyViewerSnapshot;private lookupFor; /** `pageCount` normalized to a finite, non-negative integer before `effectivePageCount()`'s * mediated-mode fallback and every page-bounds/indexed-source calculation derived from it. */ private get safePageCount(); /** `page` normalized to a finite integer clamped into `[1, effectivePageCount()]` (or held at the * `1` default while no page count is known yet) -- guards `renderPageItem()`'s `aria-current` * comparison and the `lr-virtual-list` `active-item-id` binding from an out-of-range/NaN value, e.g. * a consumer setting a stale mediated-mode `page` before also updating `page-count`. */ private get safePage(); /** `thumbWidth` normalized to a finite, non-negative CSS px width before it reaches * `renderPageThumbnail()`'s `{ width }` option -- an invalid attribute value would otherwise ask * a wired viewer to rasterize a `NaN`/negative-width thumbnail. */ private get safeThumbWidth();private effectivePageCount;private createPageSource;private indexedPages;private thumbnailRef;protected updated(changed:PropertyValues):void;private renderedPageButton;private isCurrentFocusRepair;private focusRepairIndex;private finishFocusRepair;private waitForOwnerAnimationFrame;private cancelPendingAnimationFrames;private focusVirtualPage;private invalidateThumbnails;private disposeThumbnailHandle;private disposeThumbnailHandles;private loadThumbnail;private pageHighlightSummary;private onPageActivate; /** Discards an armed buffer reset. `cancel()`, never `dispose()`: `resetDigitBuffer()` runs on * disconnect, which here may be a re-parent, and a disposed controller would refuse every * later digit's reset for good. */ private cancelDigitTimer;private resetDigitBuffer;private onKeyDown;private renderPageItem;private stopVirtualListEvent;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-page-rail':LyraPageRail;}}