@@ -213,7 +213,7 @@ type Download interface {
213213// ElementHandles are auto-disposed when their origin frame gets navigated.
214214// ElementHandle instances can be used as an argument in page.$eval(selector, pageFunction[, arg]) and page.evaluate(pageFunction[, arg]) methods.
215215type ElementHandle interface {
216- AsElement () ElementHandle
216+ JSHandle
217217 // This method returns the bounding box of the element, or `null` if the element is not visible. The bounding box is
218218 // calculated relative to the main frame viewport - which is usually the same as the browser window.
219219 // Scrolling affects the returned bonding box, similarly to
@@ -486,7 +486,7 @@ type Frame interface {
486486 // the promise to resolve and return its value.
487487 // A string can also be passed in instead of a function.
488488 // JSHandle instances can be passed as an argument to the `frame.evaluateHandle`:
489- EvaluateHandle (expression string , options ... interface {}) (interface {} , error )
489+ EvaluateHandle (expression string , options ... interface {}) (JSHandle , error )
490490 // Returns the return value of `pageFunction`
491491 // The method finds an element matching the specified selector within the frame and passes it as a first argument to
492492 // `pageFunction`. See Working with selectors for more details. If no elements match the
@@ -669,7 +669,7 @@ type JSHandle interface {
669669 // If the function passed to the `jsHandle.evaluateHandle` returns a Promise, then `jsHandle.evaluateHandle` would wait
670670 // for the promise to resolve and return its value.
671671 // See page.evaluateHandle(pageFunction[, arg]) for more details.
672- EvaluateHandle (expression string , options ... interface {}) (interface {} , error )
672+ EvaluateHandle (expression string , options ... interface {}) (JSHandle , error )
673673 // The method returns a map with **own property names** as keys and JSHandle instances for the property values.
674674 GetProperties () (map [string ]JSHandle , error )
675675 // Fetches a single property from the referenced object.
@@ -757,10 +757,10 @@ type Mouse interface {
757757// This example logs a message for a single page `load` event:
758758// To unsubscribe from events use the `removeListener` method:
759759type Page interface {
760+ EventEmitter
760761 Mouse () Mouse
761762 Keyboard () Keyboard
762763 Touchscreen () Touchscreen
763- EventEmitter
764764 // Adds a script which would be evaluated in one of the following scenarios:
765765 // Whenever the page is navigated.
766766 // Whenever the child frame is attached or navigated. In this case, the script is evaluated in the context of the newly attached frame.
@@ -875,7 +875,7 @@ type Page interface {
875875 // promise to resolve and return its value.
876876 // A string can also be passed in instead of a function:
877877 // JSHandle instances can be passed as an argument to the `page.evaluateHandle`:
878- EvaluateHandle (expression string , options ... interface {}) (interface {} , error )
878+ EvaluateHandle (expression string , options ... interface {}) (JSHandle , error )
879879 // The method finds an element matching the specified selector within the page and passes it as a first argument to
880880 // `pageFunction`. If no elements match the selector, the method throws an error. Returns the value of `pageFunction`.
881881 // If `pageFunction` returns a Promise, then `page.$eval` would wait for the promise to resolve and return its value.
@@ -891,7 +891,7 @@ type Page interface {
891891 ExpectDownload (cb func () error ) (Download , error )
892892 ExpectEvent (event string , cb func () error , predicates ... interface {}) (interface {}, error )
893893 ExpectFileChooser (cb func () error ) (FileChooser , error )
894- ExpectLoadState (state string , cb func () error ) ( ConsoleMessage , error )
894+ ExpectLoadState (state string , cb func () error ) error
895895 ExpectNavigation (cb func () error , options ... PageWaitForNavigationOptions ) (Response , error )
896896 ExpectPopup (cb func () error ) (Page , error )
897897 ExpectRequest (url interface {}, cb func () error , options ... interface {}) (Request , error )
@@ -1269,6 +1269,7 @@ type Video interface {
12691269// event is emitted on the page object to signal a worker creation. `close` event is emitted on the worker object when the
12701270// worker is gone.
12711271type Worker interface {
1272+ EventEmitter
12721273 // Returns the return value of `pageFunction`
12731274 // If the function passed to the `worker.evaluate` returns a Promise, then `worker.evaluate` would wait for the promise
12741275 // to resolve and return its value.
@@ -1283,4 +1284,6 @@ type Worker interface {
12831284 // the promise to resolve and return its value.
12841285 EvaluateHandle (expression string , options ... interface {}) (JSHandle , error )
12851286 URL () string
1287+ WaitForEvent (event string , predicate ... interface {}) interface {}
1288+ ExpectEvent (event string , cb func () error , predicates ... interface {}) (interface {}, error )
12861289}
0 commit comments