-
Notifications
You must be signed in to change notification settings - Fork 227
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
protocol-dts-generator for devtools-protocol typescript types #90
Conversation
This is very cool. I tried to use it to add types to puppeteer and ran into trouble with events. Having a separate method per event makes it difficult to work with. Id expect the domains to extend Node's EventEmitter and have events defined like on(event: 'TargetInfoChanged', listener: (params: Target.TargetInfoChangedEvent) => void): this; Also every method is marked as optional on every domain. Maybe this should correspond to whether or not the method is experimental? Or have some other indication of experimental vs stable methods. |
@JoelEinbinder done. Yeah I left it as onXYZ because typescript would give better code completion, but they've fixed that since then. Happy to take feedback on what you'd like the ideal interface to be. do you simply want the interface to be .
|
scripts/protocol-dts-generator.ts
Outdated
@@ -0,0 +1,228 @@ | |||
import * as fs from 'fs' | |||
import * as path from 'path' | |||
import {IProtocol, Protocol as P} from './protocol' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protocol-schema
, now, eh?
FWIW I've found the overloaded All the info we need is in here, though, and as long as all the method definitions are on |
@JoelEinbinder @brendankenny Please let me know your preferences for the final interface and I'll make the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the protocol format you have now LGTM
@JoelEinbinder you happy with the look of this now? |
@nojvek the remaining TODOs are some good stuff. do you want to do those in this PR or the next one? Ideally we wouldn't delay it too much. |
I’m happy it being a v1 and work on documentaion and protocol steps in next PR How does the publish of npm modules work? I imagine some bot runs the script? |
@nojvek Yup. Done by a bot every hour. |
I created a PR to ensure the |
Fixes #55 (typescript definitions)
TODO List
types
entry in package.json