Ende.Dock
interface · desktop apps only
interface Ende.Dock extends DockEventHandlersclass · desktop apps only
class Ende.Dock extends EventTargetApp-level dock / taskbar handle.
A "reopen" event fires on macOS when the user clicks the dock icon;
the default behavior of showing the last hidden window is swallowed,
so listeners decide what (if anything) to do.
Constructors
constructor
new Dock()Methods
setBadge
setBadge(text: string | null): voidSet a short text badge on the app's dock icon (macOS) or taskbar
icon (Windows), or prefix the focused window's title on Linux.
Pass null or an empty string to clear the badge.
bounce
bounce(critical?: boolean): voidBounce the dock icon (macOS), flash the focused window's taskbar button (Windows), or set the urgency hint on the focused window (Linux).
When critical is false (the default) this triggers a single
bounce; when true it bounces continuously until the app is
focused.
setMenu
setMenu(menu: MenuItem[] | null): voidSet a custom right-click menu on the app's dock icon. Pass
null to remove any menu previously set.
macOS only. Click events are delivered as "menuclick" events on
Ende.dock. No-op on Windows and Linux.
setVisible
setVisible(visible: boolean): voidShow or hide the app's dock icon.
macOS only — controls the app's activation policy. No-op on Windows and Linux.
addEventListener
addEventListener<K extends keyof DockEventMap>(type: K, listener: (this: Dock, ev: DockEventMap[K]) => any, options?: boolean | AddEventListenerOptions): voidaddEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): voidremoveEventListener
removeEventListener<K extends keyof DockEventMap>(type: K, listener: (this: Dock, ev: DockEventMap[K]) => any, options?: boolean | EventListenerOptions): voidremoveEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): voidEnde.dock
variable · desktop apps only
const Ende.dock: DockApp-level dock / taskbar singleton.