electron/docs/api/dock.md
Samuel Attard a96b6e2c96 build: move to the new docs parser (#18103)
* build: move to the new docs parser

* chore: remove the bad getTitle param doc

* build: update parser/ts gen deps + fix some docs issues highlighted by GH desktop

* chore: apply suggestions from code review

Co-Authored-By: MarshallOfSound <samuel.r.attard@gmail.com>

* chore: update docs for accidentally removed things

* chore: update docs/api/command-line.md

Co-Authored-By: MarshallOfSound <samuel.r.attard@gmail.com>
2019-05-06 08:29:01 -07:00

1.7 KiB
Raw Blame History

Class: Dock

Control your app in the macOS dock

Process: Main

The following example shows how to bounce your icon on the dock.

const { app } = require('electron')
app.dock.bounce()

Instance Methods

dock.bounce([type]) macOS

  • type String (optional) - Can be critical or informational. The default is informational

When critical is passed, the dock icon will bounce until either the application becomes active or the request is canceled.

When informational is passed, the dock icon will bounce for one second. However, the request remains active until either the application becomes active or the request is canceled.

Returns Integer an ID representing the request.

dock.cancelBounce(id) macOS

  • id Integer

Cancel the bounce of id.

dock.downloadFinished(filePath) macOS

  • filePath String

Bounces the Downloads stack if the filePath is inside the Downloads folder.

dock.setBadge(text) macOS

  • text String

Sets the string to be displayed in the docks badging area.

dock.getBadge() macOS

Returns String - The badge string of the dock.

dock.hide() macOS

Hides the dock icon.

dock.show() macOS

Returns Promise<void> - Resolves when the dock icon is shown.

dock.isVisible() macOS

Returns Boolean - Whether the dock icon is visible.

dock.setMenu(menu) macOS

Sets the application's [dock menu][dock-menu].

dock.getMenu() macOS

Returns Menu | null - The application's [dock menu][dock-menu].

dock.setIcon(image) macOS

Sets the image associated with this dock icon.