mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Move getBadgeCount and setBadgeCount under app (#14882)
This commit is contained in:
committed by
Masahiro Wakame
parent
3ceff45bba
commit
ad604728f7
30
electron/index.d.ts
vendored
30
electron/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Electron v1.4.8
|
||||
// Project: http://electron.atom.io/
|
||||
// Definitions by: jedmao <https://github.com/jedmao/>, rhysd <https://rhysd.github.io>, Milan Burda <https://github.com/miniak/>, aliib <https://github.com/aliib>
|
||||
// Definitions by: jedmao <https://github.com/jedmao/>, rhysd <https://rhysd.github.io>, Milan Burda <https://github.com/miniak/>, aliib <https://github.com/aliib>, Daniel Perez Alvarez <https://github.com/unindented>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -398,6 +398,20 @@ declare namespace Electron {
|
||||
* This method can only be called before app is ready.
|
||||
*/
|
||||
disableHardwareAcceleration(): void;
|
||||
/**
|
||||
* Sets the counter badge for current app. Setting the count to 0 will hide the badge.
|
||||
*
|
||||
* @returns True when the call succeeded, otherwise returns false.
|
||||
*
|
||||
* Note: This API is only available on macOS and Linux.
|
||||
*/
|
||||
setBadgeCount(count: number): boolean;
|
||||
/**
|
||||
* @returns The current value displayed in the counter badge.
|
||||
*
|
||||
* Note: This API is only available on macOS and Linux.
|
||||
*/
|
||||
getBadgeCount(): number;
|
||||
/**
|
||||
* @returns whether current desktop environment is Unity launcher. (Linux)
|
||||
*
|
||||
@@ -505,20 +519,6 @@ declare namespace Electron {
|
||||
* Note: This API is only available on macOS.
|
||||
*/
|
||||
getBadge(): string;
|
||||
/**
|
||||
* Sets the counter badge for current app. Setting the count to 0 will hide the badge.
|
||||
*
|
||||
* @returns True when the call succeeded, otherwise returns false.
|
||||
*
|
||||
* Note: This API is only available on macOS and Linux.
|
||||
*/
|
||||
setBadgeCount(count: number): boolean;
|
||||
/**
|
||||
* @returns The current value displayed in the counter badge.
|
||||
*
|
||||
* Note: This API is only available on macOS and Linux.
|
||||
*/
|
||||
getBadgeCount(): number;
|
||||
/**
|
||||
* Hides the dock icon.
|
||||
*
|
||||
|
||||
@@ -232,7 +232,8 @@ app.dock.setBadge('foo');
|
||||
var id = app.dock.bounce('informational');
|
||||
app.dock.cancelBounce(id);
|
||||
app.dock.setIcon('/path/to/icon.png');
|
||||
app.dock.setBadgeCount(app.dock.getBadgeCount() + 1);
|
||||
|
||||
app.setBadgeCount(app.getBadgeCount() + 1);
|
||||
|
||||
app.setUserTasks([
|
||||
<Electron.Task>{
|
||||
|
||||
Reference in New Issue
Block a user