进程:

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

    dock.bounce([type]) macOS

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

    Returns Integer - an ID representing the request.

    当传入的是 critical 时, dock 中的应用将会开始弹跳, 直到这个应用被激活或者这个请求被取消。

    Nota Bene: This method can only be used while the app is not focused; when the app is focused it will return -1.

    dock.cancelBounce(id) macOS

    • id Integer

    取消这个 id 对应的请求。

    dock.downloadFinished(filePath) macOS

    • filePath String

    如果 filePath 位于 Downloads 文件夹中,则弹出下载队列。

    dock.setBadge(text) macOS

    • text String

    设置应用在 dock 中显示的字符串。

    macOS

    dock.hide() macOS

    隐藏 dock 中的图标。

    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

    • menu

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

    dock.getMenu() macOS

    dock.setIcon(image) macOS

    设置作为应用在 dock 中显示的图标