@types/puppeteer
Advanced tools
Comparing version 1.6.4 to 1.8.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for puppeteer 1.6 | ||
// Type definitions for puppeteer 1.8 | ||
// Project: https://github.com/GoogleChrome/puppeteer#readme | ||
@@ -6,2 +6,3 @@ // Definitions by: Marvin Hagemeister <https://github.com/marvinhagemeister> | ||
// Konstantin Simon Maria Möllers <https://github.com/ksm2> | ||
// Simon Schick <https://github.com/SimonSchick> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -357,9 +358,9 @@ // TypeScript Version: 2.8 | ||
export interface ClickOptions { | ||
/** defaults to left */ | ||
/** @default MouseButtons.Left */ | ||
button?: MouseButtons; | ||
/** defaults to 1 */ | ||
/** @default 1 */ | ||
clickCount?: number; | ||
/** | ||
* Time to wait between mousedown and mouseup in milliseconds. | ||
* Defaults to 0. | ||
* @default 0 | ||
*/ | ||
@@ -480,2 +481,14 @@ delay?: number; | ||
/** | ||
* Navigation options for `page.goto`. | ||
*/ | ||
export interface DirectNavigationOptions extends NavigationOptions { | ||
/** | ||
* Referer header value. | ||
* If provided it will take preference over the referer header value set by | ||
* [page.setExtraHTTPHeaders()](#pagesetextrahttpheadersheaders). | ||
*/ | ||
referer?: string; | ||
} | ||
export type PDFFormat = | ||
@@ -539,7 +552,10 @@ | "Letter" | ||
/** | ||
* Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty | ||
* string, which means print all pages. | ||
* Paper ranges to print, e.g., '1-5, 8, 11-13'. | ||
* @default '' which means print all pages. | ||
*/ | ||
pageRanges?: string; | ||
/** Paper format. If set, takes priority over width or height options. Defaults to 'Letter'. */ | ||
/** | ||
* Paper format. If set, takes priority over width or height options. | ||
* @default 'Letter' | ||
*/ | ||
format?: PDFFormat; | ||
@@ -561,2 +577,9 @@ /** Paper width, accepts values labeled with units. */ | ||
}; | ||
/** | ||
* Give any CSS @page size declared in the page priority over what is declared in width and | ||
* height or format options. | ||
* @default false which will scale the content to fit the paper size. | ||
*/ | ||
preferCSSPageSize?: boolean; | ||
} | ||
@@ -594,3 +617,3 @@ | ||
/** | ||
* The encoding of the image, can be either base64 or binary. Defaults to binary | ||
* The encoding of the image, can be either base64 or binary. | ||
* @default binary | ||
@@ -993,2 +1016,9 @@ */ | ||
export interface RemoteInfo { | ||
/** the IP address of the remote server */ | ||
ip: string; | ||
/** the port used to connect to the remote server */ | ||
port: number; | ||
} | ||
/** Response class represents responses which are received by page. */ | ||
@@ -1011,2 +1041,4 @@ export interface Response { | ||
ok(): boolean; | ||
/** Returns remote connection info */ | ||
remoteAddress(): RemoteInfo; | ||
/** A matching Request object. */ | ||
@@ -1016,2 +1048,4 @@ request(): Request; | ||
status(): number; | ||
/** Contains the status text of the response (e.g. usually an "OK" for a success). */ | ||
statusText(): string; | ||
/** Promise which resolves to a text representation of response body. */ | ||
@@ -1023,2 +1057,23 @@ text(): Promise<string>; | ||
export interface WaitForSelectorOptions { | ||
/** | ||
* Wait for element to be present in DOM and to be visible, | ||
* i.e. to not have display: none or visibility: hidden CSS properties. | ||
* @default false | ||
*/ | ||
visible?: boolean; | ||
/** | ||
* Wait for element to not be found in the DOM or to be hidden, | ||
* i.e. have display: none or visibility: hidden CSS properties. | ||
* @default false | ||
*/ | ||
hidden?: boolean; | ||
/** | ||
* Maximum time to wait for in milliseconds. | ||
* Pass 0 to disable timeout. | ||
* @default 30000 (30 seconds). | ||
*/ | ||
timeout?: number; | ||
} | ||
export interface FrameBase extends Evalable { | ||
@@ -1125,14 +1180,18 @@ /** | ||
waitFor( | ||
// fn can be an abritary function | ||
// tslint:disable-next-line ban-types | ||
selectorOrFunctionOrTimeout: string | number | Function, | ||
options?: any, | ||
...args: any[] | ||
): Promise<any>; | ||
/** | ||
* Waits for a certain amount of time before resolving. | ||
* @param duration The time to wait for. | ||
*/ | ||
waitFor(duration: number): Promise<void>; | ||
/** | ||
* Shortcut for waitForSelector and waitForXPath | ||
*/ | ||
waitFor(selector: string, options?: WaitForSelectorOptions): Promise<ElementHandle>; | ||
/** | ||
* Shortcut for waitForFunction. | ||
*/ | ||
waitFor(selector: ((...args: any[]) => any) | string, options?: WaitForSelectorOptions, ...args: any[]): Promise<any>; | ||
waitForFunction( | ||
// fn can be an abritary function | ||
// tslint:disable-next-line ban-types | ||
fn: string | Function, | ||
fn: string | ((...args: any[]) => any), | ||
options?: PageFnOptions, | ||
@@ -1144,3 +1203,3 @@ ...args: any[] | ||
selector: string, | ||
options?: { visible?: boolean; hidden?: boolean; timeout?: number } | ||
options?: WaitForSelectorOptions, | ||
): Promise<ElementHandle>; | ||
@@ -1150,3 +1209,3 @@ | ||
xpath: string, | ||
options?: { visible?: boolean; hidden?: boolean; timeout?: number } | ||
options?: WaitForSelectorOptions, | ||
): Promise<ElementHandle>; | ||
@@ -1194,5 +1253,5 @@ } | ||
*/ | ||
metrics: { title: string, metrics: any }; | ||
metrics: { title: string, metrics: Metrics }; | ||
/** Emitted when an uncaught exception happens within the page. */ | ||
pageerror: string; | ||
pageerror: Error; | ||
/** | ||
@@ -1216,6 +1275,24 @@ * Emitted when a page issues a request. The request object is read-only. | ||
export interface PageCloseOptions { | ||
/** Defaults to `false`. Whether to run the before unload page handlers. */ | ||
/** | ||
* Whether to run the before unload page handlers. | ||
* @default false | ||
*/ | ||
runBeforeUnload?: boolean; | ||
} | ||
export interface GeoOptions { | ||
/** | ||
* Latitude between -90 and 90. | ||
*/ | ||
latitude: number; | ||
/** | ||
* Longitude between -180 and 180. | ||
*/ | ||
longitude: number; | ||
/** | ||
* Non-negative accuracy value. | ||
*/ | ||
accuracy?: number; | ||
} | ||
/** Page provides methods to interact with a single tab in Chromium. One Browser instance might have multiple Page instances. */ | ||
@@ -1276,3 +1353,3 @@ export interface Page extends EventEmitter, FrameBase { | ||
/** Emulates given device metrics and user agent. This method is a shortcut for `setUserAgent` and `setViewport`. */ | ||
emulate(options: Partial<EmulateOptions>): Promise<void>; | ||
emulate(options: EmulateOptions): Promise<void>; | ||
@@ -1322,3 +1399,3 @@ /** Emulates the media. */ | ||
*/ | ||
goBack(options?: Partial<NavigationOptions>): Promise<Response | null>; | ||
goBack(options?: NavigationOptions): Promise<Response | null>; | ||
@@ -1329,3 +1406,3 @@ /** | ||
*/ | ||
goForward(options?: Partial<NavigationOptions>): Promise<Response | null>; | ||
goForward(options?: NavigationOptions): Promise<Response | null>; | ||
@@ -1337,3 +1414,3 @@ /** | ||
*/ | ||
goto(url: string, options?: Partial<NavigationOptions>): Promise<Response | null>; | ||
goto(url: string, options?: DirectNavigationOptions): Promise<Response | null>; | ||
@@ -1360,3 +1437,3 @@ /** Returns the virtual keyboard. */ | ||
*/ | ||
pdf(options?: Partial<PDFOptions>): Promise<Buffer>; | ||
pdf(options?: PDFOptions): Promise<Buffer>; | ||
@@ -1429,2 +1506,7 @@ /** | ||
/** | ||
* Sets the page's geolocation. | ||
*/ | ||
setGeolocation(options: GeoOptions): Promise<void>; | ||
/** | ||
* Determines whether JavaScript is enabled on the page. | ||
@@ -1547,2 +1629,8 @@ * @param enable Whether or not to enable JavaScript on the page. | ||
/** | ||
* Returns the default browser context. | ||
* The default browser context can not be closed. | ||
*/ | ||
defaultBrowserContext(): BrowserContext; | ||
/** Promise which resolves to a new Page object. */ | ||
@@ -1587,2 +1675,20 @@ newPage(): Promise<Page>; | ||
export type Permission = | ||
'geolocation' | | ||
'midi' | | ||
'midi-sysex' | | ||
'notifications' | | ||
'push' | | ||
'camera' | | ||
'microphone' | | ||
'background-sync' | | ||
'ambient-light-sensor' | | ||
'accelerometer' | | ||
'gyroscope' | | ||
'magnetometer' | | ||
'accessibility-events' | | ||
'clipboard-read' | | ||
'clipboard-write' | | ||
'payment-handler'; | ||
/** | ||
@@ -1620,2 +1726,7 @@ * BrowserContexts provide a way to operate multiple independent browser sessions. | ||
/** | ||
* Clears all permission overrides for the browser context. | ||
*/ | ||
clearPermissionOverrides(): Promise<void>; | ||
/** Closes the browser context. All the targets that belong to the browser context will be closed. */ | ||
@@ -1633,2 +1744,13 @@ close(): Promise<void>; | ||
/** | ||
* | ||
* @param origin The origin to grant permissions to, e.g. "https://example.com". | ||
* @param permissions An array of permissions to grant. | ||
* All permissions that are not listed here will be automatically denied. | ||
*/ | ||
overridePermissions(origin: string, permissions: Permission[]): Promise<void>; | ||
/** Promise which resolves to an array of all open pages. */ | ||
pages(): Promise<Page[]>; | ||
/** An array of all active targets inside the browser context. */ | ||
@@ -1673,9 +1795,21 @@ targets(): Target[]; | ||
export interface LaunchOptions { | ||
/** Whether to open chrome in appMode. Defaults to false. */ | ||
/** | ||
* Whether to open chrome in appMode. | ||
* @default false | ||
*/ | ||
appMode?: boolean; | ||
/** Whether to ignore HTTPS errors during navigation. Defaults to false. */ | ||
/** | ||
* Whether to ignore HTTPS errors during navigation. | ||
* @default false | ||
*/ | ||
ignoreHTTPSErrors?: boolean; | ||
/** Do not use `puppeteer.defaultArgs()` for launching Chromium. Defaults to false. */ | ||
ignoreDefaultArgs?: boolean; | ||
/** Whether to run Chromium in headless mode. Defaults to true. */ | ||
/** | ||
* Do not use `puppeteer.defaultArgs()` for launching Chromium. | ||
* @default false | ||
*/ | ||
ignoreDefaultArgs?: boolean | string[]; | ||
/** | ||
* Whether to run Chromium in headless mode. | ||
* @default true | ||
*/ | ||
headless?: boolean; | ||
@@ -1706,15 +1840,20 @@ /** | ||
/** | ||
* Specify device scale factor (can be thought of as dpr). Defaults to 1. | ||
* Specify device scale factor (can be thought of as dpr). | ||
* @default 1 | ||
*/ | ||
deviceScaleFactor?: number; | ||
/** | ||
* Whether the meta viewport tag is taken into account. Defaults to false. | ||
* Whether the meta viewport tag is taken into account. | ||
* @default false | ||
*/ | ||
isMobile?: boolean; | ||
/** | ||
* Specifies if viewport supports touch events. Defaults to false. | ||
* | ||
* Specifies if viewport supports touch events. | ||
* @default false | ||
*/ | ||
hasTouch?: boolean; | ||
/** | ||
* Specifies if viewport is in landscape mode. Defaults to false. | ||
* Specifies if viewport is in landscape mode. | ||
* @default false | ||
*/ | ||
@@ -1728,11 +1867,21 @@ isLandscape?: boolean; | ||
args?: string[]; | ||
/** Close chrome process on Ctrl-C. Defaults to true. */ | ||
/** | ||
* Close chrome process on Ctrl-C. | ||
* @default true | ||
*/ | ||
handleSIGINT?: boolean; | ||
/** Close chrome process on SIGTERM. Defaults to true. */ | ||
/** | ||
* Close chrome process on SIGTERM. | ||
* @default true | ||
*/ | ||
handleSIGTERM?: boolean; | ||
/** Close chrome process on SIGHUP. Defaults to true. */ | ||
/** | ||
* Close chrome process on SIGHUP. | ||
* @default true | ||
*/ | ||
handleSIGHUP?: boolean; | ||
/** | ||
* Maximum time in milliseconds to wait for the Chrome instance to start. | ||
* Defaults to 30000 (30 seconds). Pass 0 to disable timeout. | ||
* Pass 0 to disable timeout. | ||
* @default 30000 (30 seconds). | ||
*/ | ||
@@ -1742,3 +1891,4 @@ timeout?: number; | ||
* Whether to pipe browser process stdout and stderr into process.stdout and | ||
* process.stderr. Defaults to false. | ||
* process.stderr. | ||
* @default false | ||
*/ | ||
@@ -1748,10 +1898,42 @@ dumpio?: boolean; | ||
userDataDir?: string; | ||
/** Specify environment variables that will be visible to Chromium. Defaults to process.env. */ | ||
env?: any; | ||
/** Whether to auto-open DevTools panel for each tab. If this option is true, the headless option will be set false. */ | ||
/** | ||
* Specify environment variables that will be visible to Chromium. | ||
* @default `process.env`. | ||
*/ | ||
env?: { | ||
[key: string]: string | boolean | number; | ||
}; | ||
/** | ||
* Whether to auto-open DevTools panel for each tab. If this option is true, the headless option will be set false. | ||
*/ | ||
devtools?: boolean; | ||
/** Connects to the browser over a pipe instead of a WebSocket. Defaults to false. */ | ||
/** | ||
* Connects to the browser over a pipe instead of a WebSocket. | ||
* @default false | ||
*/ | ||
pipe?: boolean; | ||
} | ||
export interface DefaultArgsOptions { | ||
/** | ||
* Whether to run browser in headless mode. | ||
* @default true unless the devtools option is true. | ||
*/ | ||
headless?: boolean; | ||
/** | ||
* Additional arguments to pass to the browser instance. | ||
* The list of Chromium flags can be found here. | ||
*/ | ||
args?: string[]; | ||
/** | ||
* Path to a User Data Directory. | ||
*/ | ||
userDataDir?: string; | ||
/** | ||
* Whether to auto-open a DevTools panel for each tab. | ||
* If this option is true, the headless option will be set false. | ||
*/ | ||
devtools?: boolean; | ||
} | ||
export interface ConnectOptions { | ||
@@ -1777,3 +1959,3 @@ /** A browser websocket endpoint to connect to. */ | ||
*/ | ||
send(method: string, params?: object): Promise<any>; | ||
send(method: string, params?: object): Promise<object>; | ||
} | ||
@@ -1789,5 +1971,11 @@ | ||
export interface StartCoverageOptions { | ||
/** Whether to reset coverage on every navigation. Defaults to `true`. */ | ||
/** | ||
* Whether to reset coverage on every navigation. | ||
* @default true | ||
*/ | ||
resetOnNavigation?: boolean; | ||
/** Whether anonymous scripts generated by the page should be reported. Defaults to `false`. */ | ||
/** | ||
* Whether anonymous scripts generated by the page should be reported. | ||
* @default false | ||
*/ | ||
reportAnonymousScripts?: boolean; | ||
@@ -1805,3 +1993,3 @@ } | ||
/** The default flags that Chromium will be launched with */ | ||
export function defaultArgs(): string[]; | ||
export function defaultArgs(options?: DefaultArgsOptions): string[]; | ||
/** Path where Puppeteer expects to find bundled Chromium */ | ||
@@ -1808,0 +1996,0 @@ export function executablePath(): string; |
{ | ||
"name": "@types/puppeteer", | ||
"version": "1.6.4", | ||
"version": "1.8.0", | ||
"description": "TypeScript definitions for puppeteer", | ||
@@ -21,2 +21,7 @@ "license": "MIT", | ||
"githubUsername": "ksm2" | ||
}, | ||
{ | ||
"name": "Simon Schick", | ||
"url": "https://github.com/SimonSchick", | ||
"githubUsername": "SimonSchick" | ||
} | ||
@@ -31,7 +36,6 @@ ], | ||
"dependencies": { | ||
"@types/events": "*", | ||
"@types/node": "*" | ||
}, | ||
"typesPublisherContentHash": "addd22a9ad0a299a580e52e4114a243ab36eb3c69cff06180e5234bafaa4b4a7", | ||
"typesPublisherContentHash": "505a6098dbdf863e2e95c57b214022dfb9c995262e6e866eaa5f503f86f00b75", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -11,7 +11,7 @@ # Installation | ||
Additional Details | ||
* Last updated: Fri, 14 Sep 2018 17:45:34 GMT | ||
* Dependencies: events, child_process, node | ||
* Last updated: Wed, 03 Oct 2018 17:56:18 GMT | ||
* Dependencies: node | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Marvin Hagemeister <https://github.com/marvinhagemeister>, Christopher Deutsch <https://github.com/cdeutsch>, Konstantin Simon Maria Möllers <https://github.com/ksm2>. | ||
These definitions were written by Marvin Hagemeister <https://github.com/marvinhagemeister>, Christopher Deutsch <https://github.com/cdeutsch>, Konstantin Simon Maria Möllers <https://github.com/ksm2>, Simon Schick <https://github.com/SimonSchick>. |
Sorry, the diff of this file is not supported yet
66936
1
5
1764
- Removed@types/events@*
- Removed@types/events@3.0.3(transitive)