Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many events triggered with undocumented Event arg #19156

Open
cmeeren opened this issue Jul 8, 2019 · 3 comments
Open

Many events triggered with undocumented Event arg #19156

cmeeren opened this issue Jul 8, 2019 · 3 comments
Assignees

Comments

@cmeeren
Copy link

@cmeeren cmeeren commented Jul 8, 2019

I'm confused about events, specifically runtime vs. documented listener signatures. Many events are documented without an Event parameter, for example many of the BrowserWindow events such as closed, blur etc. But at runtime, these events are called with an Event parameter.

This made me think that maybe all events have Event as the first parameter, but some events, such as the autoUpdater error event is only called with Error, not Event (and is correctly documented).

Is this just a matter of incomplete documentation, or is there a logic to this? (I'm new to the JS world, so please bear with me if this is evident to everyone but me.)

(If anyone is wondering; I'm creating Electron bindings for Fable, an F# to JS compiler, and since F# is strongly typed I should get this right in the bindings.)

@codebytere

This comment has been minimized.

Copy link
Member

@codebytere codebytere commented Jul 9, 2019

If that's the case, we would welcome PRs to correct said documentation! I can also potentially dedicate some time to auditing and addressing this gap time permitting.

@codebytere codebytere self-assigned this Jul 9, 2019
@cmeeren

This comment has been minimized.

Copy link
Author

@cmeeren cmeeren commented Jul 9, 2019

So what you're saying is that the runtime behaviour is correct, and that if an event is called with Event even though no args are documented, then it's a bug in the documentation and I can count on the event always returning Event?

@cmeeren

This comment has been minimized.

Copy link
Author

@cmeeren cmeeren commented Jul 9, 2019

In any case: While I can write down the events I come across and can test, and even submit a doc PR time permitting, I'm new to Electron and don't have the infrastructure (e.g. for auto-update) or devices (e.g. for macOS-only events) to test all events. So ideally I'd like to get some official answers and not have to guess. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.