This diff adds types for autoUpdater module and other properties used in the later diffs. They are taken from the official electron documentation. Documentation
Details
Run flow in the desktop workspace. Also run flow including diffs later on in the stack
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
desktop/flow-typed/npm/electron_v22.0.0.js | ||
---|---|---|
217 ↗ | (On Diff #21139) | This can be assigned to return a value from the callback, so I've removed the read-only modifier. |
desktop/flow-typed/npm/electron_v22.0.0.js | ||
---|---|---|
188–192 ↗ | (On Diff #21139) | The doc says that
So maybe other props should be marked as optional? |
217 ↗ | (On Diff #21139) | Not really sure about this change. It depends on the usage, but we should be able to keep this read only and construct a new object / assign a type just before the return. But it's also possible that the purpose is to return the value by mutating an argument - this is an ugly pattern, but if the lib works that way, we have to reflect that in the types. |
Marked props available only on macOS as optional, thanks for catching that. I've also added a few additional events, because I will be using some of them in the next diffs.
desktop/flow-typed/npm/electron_v22.0.0.js | ||
---|---|---|
217 ↗ | (On Diff #21139) |
Yeah, that's how it works for sync communication, unfortunately. |
After more testing it seems that autoUpdater methods have to be binded to the object so I've changed the typings from type to class.