BasicButtonUI Class
Represents a basic button component that can emit events and be clicked.
export declare abstract class BasicButtonUI implements VisibilityElement, EventElement<ButtonEventMap>
- Inheritance:
-
BasicButtonUI
- Derived
Remarks
This abstract class provides the foundation for creating button components in the PDF viewer.
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).
Methods
click
Simulates a click on the button.
click(): Promise<void>;
Remarks
This method emits a buttonClicking event. If the event's default action is not prevented, it calls the abstract onClick method to handle the actual click logic.
addEventListener(K, (event: ButtonEventMap[K]) => void)
Adds an event listener for the specified event type.
addEventListener<K extends keyof ButtonEventMap>(type: K, listener: (event: ButtonEventMap[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.