mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-01-30 05:27:30 +00:00
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
// Type definitions for Electron v0.37.2
|
|
// Project: http://electron.atom.io/
|
|
// Definitions by: jedmao <https://github.com/jedmao/>, rhysd <https://rhysd.github.io>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
declare namespace Electron {
|
|
|
|
interface GlobalShortcut {
|
|
/**
|
|
* Registers a global shortcut of accelerator.
|
|
* @param accelerator Represents a keyboard shortcut. It can contain modifiers
|
|
* and key codes, combined by the "+" character.
|
|
* @param callback Called when the registered shortcut is pressed by the user.
|
|
* @returns {}
|
|
*/
|
|
register(accelerator: string, callback: Function): void;
|
|
/**
|
|
* @param accelerator Represents a keyboard shortcut. It can contain modifiers
|
|
* and key codes, combined by the "+" character.
|
|
* @returns Whether the accelerator is registered.
|
|
*/
|
|
isRegistered(accelerator: string): boolean;
|
|
/**
|
|
* Unregisters the global shortcut of keycode.
|
|
* @param accelerator Represents a keyboard shortcut. It can contain modifiers
|
|
* and key codes, combined by the "+" character.
|
|
*/
|
|
unregister(accelerator: string): void;
|
|
/**
|
|
* Unregisters all the global shortcuts.
|
|
*/
|
|
unregisterAll(): void;
|
|
}
|
|
}
|