Ende.Dock

interface · desktop apps only

interface Ende.Dock extends DockEventHandlers

class · desktop apps only

class Ende.Dock extends EventTarget

App-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): void

Set 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): void

Bounce 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): void

Set 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): void

Show 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): void
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void

removeEventListener

removeEventListener<K extends keyof DockEventMap>(type: K, listener: (this: Dock, ev: DockEventMap[K]) => any, options?: boolean | EventListenerOptions): void
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void

Ende.dock

variable · desktop apps only

const Ende.dock: Dock

App-level dock / taskbar singleton.