/** * Thumbnail side panel controller. * * Manages the collapsible left panel that displays page thumbnails. * Each thumbnail is a small canvas rendering of a PDF page. Clicking a * thumbnail navigates the main viewer to the corresponding page. */ export default class ThumbnailPanel { /** Button that toggles the panel open/closed. */ private readonly thumbnailPanelToggle; /** The left panel container element. */ private readonly thumbnailPanel; /** The main page container element (layout adjusts when the panel opens/closes). */ private readonly pagegContainer; /** The scrollable container that holds all thumbnail nodes. */ private readonly thumbnailsPanel; /** All rendered thumbnail DOM nodes in page order. */ private readonly thumbnailNodes; /** The currently active (highlighted) thumbnail node. */ private activeThumbnailNode; /** Callback invoked when a thumbnail is clicked. */ private selectListener; /** * Initializes the thumbnail panel by rendering thumbnails for all pages * and setting up toggle and click event listeners. * * @param context - The root element containing the panel-related elements. * @param pages - Array of pdf.js page proxy objects to render as thumbnails. */ constructor(context: HTMLElement, pages: any[]); /** * Opens the thumbnail panel and adjusts the page container layout. */ open(): void; /** * Closes the thumbnail panel and adjusts the page container layout. */ close(): void; /** * Highlights the thumbnail for the specified page and scrolls it into view if necessary. * * @param pageNum - The 1-based page number to activate. */ activatePage(pageNum: number): void; /** * Renders a canvas thumbnail for each PDF page and appends them to the thumbnail panel. * * @param pages - Array of pdf.js page proxy objects. * @returns Array of the created thumbnail container DOM nodes. */ private renderThumbnails; /** * Registers a callback that is invoked when a thumbnail is clicked. * * @param listener - Callback receiving the 1-based page number of the selected thumbnail. * @returns This instance for chaining. */ onSelect(listener: (pageNum: number) => void): ThumbnailPanel; }