refactor: Split 'Event' docs/types into more specific Event types (#17038)
* Event = Base event type (with preventDefault) * IpcMainEvent = Event that ipcMain emits (with sender, reply, etc.) * IpcRendererEvent = Event that ipcRenderer emits (with sender, senderId, etc.) * KeyboardEvent = Event that we emit with keyboard flags (ctrlKey, altKey, etc.) This will dramatically improve peoples TS experience with IPC events
This commit is contained in:
parent
ef2e7d95fe
commit
3b74837020
22 changed files with 515 additions and 285 deletions
|
@ -70,11 +70,7 @@ The `Tray` module emits the following events:
|
|||
|
||||
#### Event: 'click'
|
||||
|
||||
* `event` Event
|
||||
* `altKey` Boolean
|
||||
* `shiftKey` Boolean
|
||||
* `ctrlKey` Boolean
|
||||
* `metaKey` Boolean
|
||||
* `event` [KeyboardEvent](structures/keyboard-event.md)
|
||||
* `bounds` [Rectangle](structures/rectangle.md) - The bounds of tray icon.
|
||||
* `position` [Point](structures/point.md) - The position of the event.
|
||||
|
||||
|
@ -82,22 +78,14 @@ Emitted when the tray icon is clicked.
|
|||
|
||||
#### Event: 'right-click' _macOS_ _Windows_
|
||||
|
||||
* `event` Event
|
||||
* `altKey` Boolean
|
||||
* `shiftKey` Boolean
|
||||
* `ctrlKey` Boolean
|
||||
* `metaKey` Boolean
|
||||
* `event` [KeyboardEvent](structures/keyboard-event.md)
|
||||
* `bounds` [Rectangle](structures/rectangle.md) - The bounds of tray icon.
|
||||
|
||||
Emitted when the tray icon is right clicked.
|
||||
|
||||
#### Event: 'double-click' _macOS_ _Windows_
|
||||
|
||||
* `event` Event
|
||||
* `altKey` Boolean
|
||||
* `shiftKey` Boolean
|
||||
* `ctrlKey` Boolean
|
||||
* `metaKey` Boolean
|
||||
* `event` [KeyboardEvent](structures/keyboard-event.md)
|
||||
* `bounds` [Rectangle](structures/rectangle.md) - The bounds of tray icon.
|
||||
|
||||
Emitted when the tray icon is double clicked.
|
||||
|
@ -147,33 +135,21 @@ Emitted when a drag operation ends on the tray or ends at another location.
|
|||
|
||||
#### Event: 'mouse-enter' _macOS_
|
||||
|
||||
* `event` Event
|
||||
* `altKey` Boolean
|
||||
* `shiftKey` Boolean
|
||||
* `ctrlKey` Boolean
|
||||
* `metaKey` Boolean
|
||||
* `event` [KeyboardEvent](structures/keyboard-event.md)
|
||||
* `position` [Point](structures/point.md) - The position of the event.
|
||||
|
||||
Emitted when the mouse enters the tray icon.
|
||||
|
||||
#### Event: 'mouse-leave' _macOS_
|
||||
|
||||
* `event` Event
|
||||
* `altKey` Boolean
|
||||
* `shiftKey` Boolean
|
||||
* `ctrlKey` Boolean
|
||||
* `metaKey` Boolean
|
||||
* `event` [KeyboardEvent](structures/keyboard-event.md)
|
||||
* `position` [Point](structures/point.md) - The position of the event.
|
||||
|
||||
Emitted when the mouse exits the tray icon.
|
||||
|
||||
#### Event: 'mouse-move' _macOS_
|
||||
|
||||
* `event` Event
|
||||
* `altKey` Boolean
|
||||
* `shiftKey` Boolean
|
||||
* `ctrlKey` Boolean
|
||||
* `metaKey` Boolean
|
||||
* `event` [KeyboardEvent](structures/keyboard-event.md)
|
||||
* `position` [Point](structures/point.md) - The position of the event.
|
||||
|
||||
Emitted when the mouse moves in the tray icon.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue