Fix type information for contents.sendInputEvent

docs: fix type information for contents.sendInputEvent (#19479)
Fix type information for contents.sendInputEventdocsfix type information contents sendinputevent

Committed by MarshallOfSound

commit message
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

Editor assessment

The subject pinpoints the defect: type information for contents.sendInputEvent was wrong. The docs type fits the generated-definitions fix. The body is genuinely instructive: the event parameter name collides with a reserved keyword in the TypeScript generator, so a future generator error is proposed to prevent recurrence, and the InputEvent type is split and documented for stronger type safety. The closing Fixes line cites the originating issue in the typescript-definitions repository. Subject, mechanism, prevention, and benefit are all present — an exemplar-level, fully explanatory message.

Browse categories

More docs examples · Back to search