/** * The rail beside the book that the thumbnail and outline lists both sit in. * * It exists to solve one problem shared by every such panel: the container's measured box is what * the renderer sizes the book from and what pointer hit-testing maps into, so a panel must not * live inside it. Instead the book (and its docked toolbar, if any) is wrapped in a flex row with * the panel as its sibling, and `destroy` unwinds that again. * * The rail is absolutely positioned inside a holder that stretches to the book's height, so a * long list scrolls internally instead of running past the bottom of the book. * * On a wide screen the rail flanks the book and the book shrinks to make room (see styles.ts). On * a narrow one there is no room to flank, so the rail becomes a drawer over the book and a scrim * dims the page behind it; tapping the scrim or pressing Escape dismisses it through `onDismiss`. */ /** Shared options a toolbar threads into every panel constructor. */ export interface PanelOptions { /** Called when the reader dismisses the narrow-screen drawer (scrim tap or Escape). */ onDismiss?: () => void; } /** The book's painted box inside the container, in container px (see Zine.getPageBox). */ type PageBox = { x: number; y: number; width: number; height: number; }; export declare class Sidebar { #private; /** The scrolling list; panels append their rows here. */ readonly root: HTMLElement; constructor(doc: Document, container: HTMLElement, options: { className: string; label: string; width: number; /** Called when the reader dismisses the drawer (scrim tap or Escape). Omit to disable both. */ onDismiss?: () => void; /** Reading direction; the drawer slides in from the right instead of the left when true. */ rtl?: boolean; /** Float over the book's edge instead of flanking it (so the book never resizes). Panels * whose width is fixed and modest — the outline and search rails — prefer this; the wider * thumbnail rail flanks so both stay fully visible. Only affects wide screens: below the * breakpoint every panel is a drawer regardless. */ overlay?: boolean; /** The book's painted box in container px. The rail stands exactly as tall as the page rather * than the whole container, which is taller whenever the page is letterboxed (its aspect not * matching the container's) or a docked toolbar padded the wrap. Re-read on every resize. */ pageBox?: () => PageBox | null; /** aria-label for the drawer's close button. Defaults to 'Close'. */ closeLabel?: string; }); /** Resize the rail, e.g. once a thumbnail list knows whether it needs one column or two. */ setWidth(px: number): void; destroy(): void; } export {};