You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Remove white space
* Fix browser definition to interface
There was an error with the definition which didn't reflect how it was
meant to be used -- the browser named export should be worked without
having to new up a new Browser instance and it should allow access to
its methods.
* Fix evaluate and evaluateHandle definitions
* Refactor class defs to interfaces and unexport
We should work with interface types instead of classes, since working
with a class infers that the type can be instantiated with the new
operator. With the k6 browser module we currently do not need to new
up an instance of any type that the module works with.
We need to correctly reflect that the k6 browser module only exports
browser and not the other types that were being exported. This also
does a better a job of showing us how to get to some of the other types
when working with browser e.g. page, response, request etc.
* Remove export {} and export all types/interfaces
There is a valid use case for wanting to work with the types that are
declared, which is to be able to do the following:
```js
async function doSomethingWithPage(page: Page): Promise<void> {
```
If we didn't export the types then we would have to work with the `any`
keyword like so:
```js
async function doSomethingWithPage(page: any): Promise<void> {
```
The change is to remove `export {}` and to export all types explicitly.
Resolves: DefinitelyTyped#66347 (comment)
0 commit comments