ZoomDropdownUI Class
Represents a dropdown in the PDF viewer toolbar that allows users to select different zoom levels.
export declare class ZoomDropdownUI implements VisibilityElement, EventElement<ZoomDropdownEventMap>
- Inheritance:
-
ZoomDropdownUI
Remarks
This component provides functionality for zoom level selection through user input, handling zoom changes and validation.
Properties
isVisible
The current visibility state of the element.
get isVisible(): boolean;
set isVisible(value: boolean);
Parameters
-
value
The new visibility state (true to show, false to hide).
isOpened
Whether the dropdown is opened or closed.
get isOpened(): boolean;
set isOpened(value: boolean);
Parameters
-
value
The visibility state to set.
Methods
addEventListener(K, (event: ZoomDropdownEventMap[K]) => void)
Adds an event listener for the specified event type.
addEventListener<K extends keyof ZoomDropdownEventMap>(type: K, listener: (event: ZoomDropdownEventMap[K]) => void): void;
Parameters
-
type
The event type/name to listen for.
-
listener
The callback function that will be invoked when the event is emitted.
select("pageFit" | "pageWidth" | (typeof constants.zoomPercentageDropdownValues)[number])
Selects a zoom level from the dropdown.
select(value: "pageFit" | "pageWidth" | (typeof constants.zoomPercentageDropdownValues)[number]): void;
Parameters
-
value
The zoom level to apply
toggleOpen
Toggles the open/closed state of the dropdown.
toggleOpen(): void;