Skip to content
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

feat(types): add types for `$eval` #6135

Merged
merged 1 commit into from Jul 2, 2020
Merged

feat(types): add types for `$eval` #6135

merged 1 commit into from Jul 2, 2020

Conversation

@jackfranklin
Copy link
Collaborator

jackfranklin commented Jul 1, 2020

This pulls in the types (based on the DefinitelyTyped repo) for page.$eval (and the $eval method on other classes). The $eval method is quite hard to type due to the way we wrap and unwrap ElementHandles that are passed to / returned from the pageFunction that users provide.

Longer term we can improve the types by providing type overloads as DefinitelyTyped does but I've deferred that for now (see the TODO in the code for more details).

Note that I've split up the commits for easier reviewing, so you can avoid all the docs changes.

Part of #6124

@jackfranklin jackfranklin changed the title Update the documentation. feat(types): feat(types): add types for `$eval` Jul 1, 2020
@jackfranklin jackfranklin changed the title feat(types): feat(types): add types for `$eval` feat(types): add types for `$eval` Jul 1, 2020
This pulls in the types (based on the DefinitelyTyped repo) for
`page.$eval` (and the `$eval` method on other classes). The `$eval`
method is quite hard to type due to the way we wrap and unwrap
ElementHandles that are passed to / returned from the `pageFunction`
that users provide.

Longer term we can improve the types by providing type overloads as
DefinitelyTyped does but I've deferred that for now (see the `TODO` in
the code for more details).
@jackfranklin jackfranklin force-pushed the types-eval branch from fce67f2 to ee3f446 Jul 2, 2020
@jackfranklin jackfranklin merged commit 6474edb into main Jul 2, 2020
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
Details
cla/google All necessary CLAs are signed
@jackfranklin jackfranklin deleted the types-eval branch Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.