docs: fix type information for contents.sendInputEvent (#19479)
The `event` type and keyword is reserved by the typescript generator, in the future we should throw an error from the generator if someone uses a reserved interface like that. This also splits and documents the InputEvent type way better so that TS users get strong type safety. Fixes electron/typescript-definitions#36
This commit is contained in:
parent
48f2807473
commit
12bbbef688
7 changed files with 42 additions and 31 deletions
6
docs/api/structures/input-event.md
Normal file
6
docs/api/structures/input-event.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
# InputEvent Object
|
||||
|
||||
* `modifiers` String[] - An array of modifiers of the event, can
|
||||
be `shift`, `control`, `alt`, `meta`, `isKeypad`, `isAutoRepeat`,
|
||||
`leftButtonDown`, `middleButtonDown`, `rightButtonDown`, `capsLock`,
|
||||
`numLock`, `left`, `right`.
|
6
docs/api/structures/keyboard-input-event.md
Normal file
6
docs/api/structures/keyboard-input-event.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
# KeyboardInputEvent Object extends `InputEvent`
|
||||
|
||||
* `type` String - The type of the event, can be `keyDown`, `keyUp` or `char`.
|
||||
* `keyCode` String - The character that will be sent
|
||||
as the keyboard event. Should only use the valid key codes in
|
||||
[Accelerator](../accelerator.md).
|
12
docs/api/structures/mouse-input-event.md
Normal file
12
docs/api/structures/mouse-input-event.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
# MouseInputEvent Object extends `InputEvent`
|
||||
|
||||
* `type` String - The type of the event, can be `mouseDown`,
|
||||
`mouseUp`, `mouseEnter`, `mouseLeave`, `contextMenu`, `mouseWheel` or `mouseMove`.
|
||||
* `x` Integer
|
||||
* `y` Integer
|
||||
* `button` String (optional) - The button pressed, can be `left`, `middle`, `right`.
|
||||
* `globalX` Integer (optional)
|
||||
* `globalY` Integer (optional)
|
||||
* `movementX` Integer (optional)
|
||||
* `movementY` Integer (optional)
|
||||
* `clickCount` Integer (optional)
|
11
docs/api/structures/mouse-wheel-input-event.md
Normal file
11
docs/api/structures/mouse-wheel-input-event.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
# MouseWheelInputEvent Object extends `MouseInputEvent`
|
||||
|
||||
* `type` String - The type of the event, can be `mouseWheel`.
|
||||
* `deltaX` Integer (optional)
|
||||
* `deltaY` Integer (optional)
|
||||
* `wheelTicksX` Integer (optional)
|
||||
* `wheelTicksY` Integer (optional)
|
||||
* `accelerationRatioX` Integer (optional)
|
||||
* `accelerationRatioY` Integer (optional)
|
||||
* `hasPreciseScrollingDeltas` Boolean (optional)
|
||||
* `canScroll` Boolean (optional)
|
Loading…
Add table
Add a link
Reference in a new issue