Currently, typings support is provided for the following syntax via DefinitelyTyped's chrome-remote-interface typings:
await client['Page.domContentEventFired']();
but it is less elegant and the client part shouldn't really be necessary. Unfortunately, it doesn't seem possible to provide typings for the former syntax via protocol-mapping.d.ts since it is not possible to split something like 'Page.domContentEventFired' into its component parts with the current version of TypeScript (4.3).
In the code, there are two forEach loops for emitApiEvent() so that all the on() overloads are kept together.
This pr extends the generator script to add
Promise
versions of events, e.g.:as a complement for
The motivation for this pr is to provide typings support for the following syntax:
Currently, typings support is provided for the following syntax via DefinitelyTyped's
chrome-remote-interface
typings:but it is less elegant and the
client
part shouldn't really be necessary. Unfortunately, it doesn't seem possible to provide typings for the former syntax viaprotocol-mapping.d.ts
since it is not possible to split something like'Page.domContentEventFired'
into its component parts with the current version of TypeScript (4.3).In the code, there are two
forEach
loops foremitApiEvent()
so that all theon()
overloads are kept together.Fixes #246.