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
puppeteer.HTTPRequest resourceType() returns string instead of a resource type enum #6854
Closed
davidbielik opened this issue
Feb 10, 2021
· 1 comment
· Fixed by #6882, #6891, juicyfx/juicy#697 or concourse/concourse#6685 · May be fixed by TheDogenode/torrent-aio-bot#6
Closed
puppeteer.HTTPRequest resourceType() returns string instead of a resource type enum #6854
davidbielik opened this issue
Feb 10, 2021
· 1 comment
· Fixed by #6882, #6891, juicyfx/juicy#697 or concourse/concourse#6685 · May be fixed by TheDogenode/torrent-aio-bot#6
Comments
jackfranklin
added a commit
that referenced
this issue
Feb 12, 2021
Thanks! Marking as closed as #6882 will resolve this which will be in the next release. |
jackfranklin
added a commit
that referenced
this issue
Feb 16, 2021
We can use the new `Lowercase` util in TS4 to avoid duplicating the type and instead lowercase it. Note we still need to do the work so callbacks are typed correctly: ```ts page.on('request', request => { }) ``` Right now `request` is `any`, whereas it should be a `puppeteer.HTTPRequest`. You can manually set the type for now, and I will work on adding types for events so that this is done automatically by the compiler in a future release. Fixes #6854.
jschfflr
pushed a commit
that referenced
this issue
Feb 17, 2021
We can use the new `Lowercase` util in TS4 to avoid duplicating the type and instead lowercase it. Note we still need to do the work so callbacks are typed correctly: ```ts page.on('request', request => { }) ``` Right now `request` is `any`, whereas it should be a `puppeteer.HTTPRequest`. You can manually set the type for now, and I will work on adding types for events so that this is done automatically by the compiler in a future release. Fixes #6854.
This was referenced Mar 11, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
Tell us about your environment:
I want to ask about difference while migrating from
@types/puppeteer
to the included definitions (thank you btw!)In the past (with DefinitelyTyped), request resource types were defined ("document", "xhr", etc.):
Now, it returns
string
. I see there is apuppeteer.Protocol.Network.ResourceType
(although those are not lowercased).Is there a type we can use for this instead of
string
? Same forrequest.method()
which also now returnsstring
instead of the old DefinitelyTypedpuppeteer.HttpMethod
.Thank you!
The text was updated successfully, but these errors were encountered: