@types/puppeteer
Advanced tools
Comparing version 0.13.0 to 0.13.1
@@ -10,2 +10,4 @@ // Type definitions for puppeteer 0.13 | ||
import { EventEmitter } from "events"; | ||
/** Keyboard provides an api for managing a virtual keyboard. */ | ||
@@ -785,9 +787,27 @@ export interface Keyboard { | ||
/** Page provides methods to interact with a single tab in Chromium. One Browser instance might have multiple Page instances. */ | ||
export interface Page extends FrameBase { | ||
export interface Page extends EventEmitter, FrameBase { | ||
/** | ||
* Adds the listener function to the end of the listeners array for the event named `eventName`. | ||
* No checks are made to see if the listener has already been added. Multiple calls passing the same combination of | ||
* `eventName` and listener will result in the listener being added, and called, multiple times. | ||
* @param event The name of the event. | ||
* @param handler The callback function. | ||
*/ | ||
on<K extends keyof PageEventObj>( | ||
event: K, | ||
eventName: K, | ||
handler: (e: PageEventObj[K], ...args: any[]) => void | ||
): void; | ||
): this; | ||
/** | ||
* Adds a one time listener function for the event named `eventName`. | ||
* The next time `eventName` is triggered, this listener is removed and then invoked. | ||
* @param event The name of the event. | ||
* @param handler The callback function. | ||
*/ | ||
once<K extends keyof PageEventObj>( | ||
eventName: K, | ||
handler: (e: PageEventObj[K], ...args: any[]) => void | ||
): this; | ||
/** | ||
* Provide credentials for http authentication. | ||
@@ -1033,9 +1053,27 @@ * To disable authentication, pass `null`. | ||
/** A Browser is created when Puppeteer connects to a Chromium instance, either through puppeteer.launch or puppeteer.connect. */ | ||
export interface Browser { | ||
export interface Browser extends EventEmitter { | ||
/** | ||
* Adds the listener function to the end of the listeners array for the event named `eventName`. | ||
* No checks are made to see if the listener has already been added. Multiple calls passing the same combination of | ||
* `eventName` and listener will result in the listener being added, and called, multiple times. | ||
* @param event The name of the event. | ||
* @param handler The callback function. | ||
*/ | ||
on<K extends keyof BrowserEventObj>( | ||
event: K, | ||
eventName: K, | ||
handler: (e: BrowserEventObj[K], ...args: any[]) => void | ||
): void; | ||
): this; | ||
/** | ||
* Adds a one time listener function for the event named `eventName`. | ||
* The next time `eventName` is triggered, this listener is removed and then invoked. | ||
* @param event The name of the event. | ||
* @param handler The callback function. | ||
*/ | ||
once<K extends keyof BrowserEventObj>( | ||
eventName: K, | ||
handler: (e: BrowserEventObj[K], ...args: any[]) => void | ||
): this; | ||
/** | ||
* Closes browser with all the pages (if any were opened). | ||
@@ -1042,0 +1080,0 @@ * The browser object itself is considered to be disposed and can not be used anymore. |
{ | ||
"name": "@types/puppeteer", | ||
"version": "0.13.0", | ||
"version": "0.13.1", | ||
"description": "TypeScript definitions for puppeteer", | ||
@@ -27,4 +27,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "bb1d34def34050cfa6244d9bcafb9b97e14968f9098d7617b1386b54b134e04d", | ||
"typesPublisherContentHash": "29ebed8530ba05b5cba9352075df6fd232485728ca0297612307e75329c02474", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,4 +11,4 @@ # Installation | ||
Additional Details | ||
* Last updated: Tue, 14 Nov 2017 16:31:10 GMT | ||
* Dependencies: node | ||
* Last updated: Tue, 21 Nov 2017 18:21:30 GMT | ||
* Dependencies: events, node | ||
* Global values: none | ||
@@ -15,0 +15,0 @@ |
42608
1057