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
Provide .d.ts from puppeteer
NPM package
#5857
Comments
This was indeed one of the goals of the TypeScript migration. We're not quite there yet though. |
Yup, we will eventually. Right now |
yup, I'd love if puppeteer came with types straight out of the box. That'd be a much smoother experience for users 👍 |
Now that
I believe the type declarations are missing from |
The reason we haven't shipped types out of the box yet (or configured them) is because I think the types from the DefinitelyTyped repo are superior, so I don't want people to have a less-good experience. Especially the way the @types package defines all the $eval type functions is much better and gives much better errors. It's on my list to explore how best to pull those into our codebase - it's also something I'd welcome help with and be happy to pair on if anyone is interested. We could ship our types but only if then installing |
Is there then going to be DefinitelyTyped for version 4.0 also? It seems, currently 3.0 is the latest: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/puppeteer/index.d.ts For the time being, having neither (DefinitelyTyped nor |
Hi there! Still would like to hear what is currently the upgrade path to 4.0 using Typescript? If there's neither out-of-the-box types nor DefinitelyTyped types, how should one get the setup working? |
Hey @Pyppe I'm afraid you may have to manually define the types yourself. Not much changed from 3 to 4 besides the event emitter; you could always take the existing DefinitelyTyped types as your starting point? I appreciate that's non ideal but our focus is on shipping a version in the not-too-distant future that does provide types out the box so we're focusing on that rather than types for v4. You can track the progress of that in #6124 . I know @jsoverson was playing with our typedefs, so he might know a way of getting types + Puppeteer v4/5 working until we ship typedefs for real? |
@Pyppe I have one decent-sized project and multiple smaller ones ported to puppeteer 4.0. My projects directly benefited from the aligned types so I worked through it. I wouldn't recommend porting yet unless there is a compelling reason. Major version upgrades like these don't signify a swath of new, exciting features, just that there are breaking changes. |
We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days. |
We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it! |
It seems that you're migrating to TypeScript and almost all sources have been migrated. Do you have any plan to provide .d.ts files from Puppeteer NPM package (not
@types/puppeteer
)?The text was updated successfully, but these errors were encountered: