2018-01-11 03:33:22 +00:00
|
|
|
import { Connection as RealConnection, CDPSession as RealCDPSession } from './Connection.js';
|
2018-05-10 20:26:08 +00:00
|
|
|
import { Browser as RealBrowser, BrowserContext as RealBrowserContext} from './Browser.js';
|
2018-08-06 18:31:33 +00:00
|
|
|
import {Target as RealTarget} from './Target.js';
|
|
|
|
import {Page as RealPage} from './Page.js';
|
|
|
|
import {TaskQueue as RealTaskQueue} from './TaskQueue.js';
|
2017-10-10 05:31:40 +00:00
|
|
|
import {Mouse as RealMouse, Keyboard as RealKeyboard, Touchscreen as RealTouchscreen} from './Input.js';
|
|
|
|
import {Frame as RealFrame, FrameManager as RealFrameManager} from './FrameManager.js';
|
2018-08-16 23:16:27 +00:00
|
|
|
import {JSHandle as RealJSHandle, ElementHandle as RealElementHandle, ExecutionContext as RealExecutionContext} from './ExecutionContext.js';
|
2018-03-12 18:34:33 +00:00
|
|
|
import { NetworkManager as RealNetworkManager, Request as RealRequest, Response as RealResponse } from './NetworkManager.js';
|
2017-10-10 05:31:40 +00:00
|
|
|
import * as child_process from 'child_process';
|
2018-04-04 21:06:21 +00:00
|
|
|
declare global {
|
|
|
|
module Puppeteer {
|
|
|
|
export class Connection extends RealConnection {}
|
2018-04-08 00:58:52 +00:00
|
|
|
export class CDPSession extends RealCDPSession {
|
|
|
|
on<T extends keyof Protocol.Events>(event: T, listener: (arg: Protocol.Events[T]) => void): this;
|
|
|
|
send<T extends keyof Protocol.CommandParameters>(message: T, parameters?: Protocol.CommandParameters[T]): Promise<Protocol.CommandReturnValues[T]>;
|
|
|
|
}
|
2018-04-04 21:06:21 +00:00
|
|
|
export class Mouse extends RealMouse {}
|
|
|
|
export class Keyboard extends RealKeyboard {}
|
|
|
|
export class Touchscreen extends RealTouchscreen {}
|
|
|
|
export class TaskQueue extends RealTaskQueue {}
|
|
|
|
export class Browser extends RealBrowser {}
|
2018-05-10 20:26:08 +00:00
|
|
|
export class BrowserContext extends RealBrowserContext {}
|
2018-04-04 21:06:21 +00:00
|
|
|
export class Target extends RealTarget {}
|
|
|
|
export class Frame extends RealFrame {}
|
|
|
|
export class FrameManager extends RealFrameManager {}
|
|
|
|
export class NetworkManager extends RealNetworkManager {}
|
|
|
|
export class ElementHandle extends RealElementHandle {}
|
|
|
|
export class JSHandle extends RealJSHandle {}
|
|
|
|
export class ExecutionContext extends RealExecutionContext {}
|
|
|
|
export class Page extends RealPage { }
|
|
|
|
export class Response extends RealResponse { }
|
|
|
|
export class Request extends RealRequest { }
|
2017-10-10 05:31:40 +00:00
|
|
|
|
2018-04-04 21:06:21 +00:00
|
|
|
export interface ConnectionTransport extends NodeJS.EventEmitter {
|
|
|
|
send(string);
|
|
|
|
close();
|
|
|
|
}
|
2017-10-10 05:31:40 +00:00
|
|
|
|
2018-08-01 23:23:03 +00:00
|
|
|
export interface ChildProcess extends child_process.ChildProcess { }
|
2018-02-26 20:10:06 +00:00
|
|
|
|
2018-08-01 23:23:03 +00:00
|
|
|
export type Viewport = {
|
|
|
|
width: number;
|
|
|
|
height: number;
|
|
|
|
deviceScaleFactor?: number;
|
|
|
|
isMobile?: boolean;
|
|
|
|
isLandscape?: boolean;
|
|
|
|
hasTouch?: boolean;
|
|
|
|
}
|
2018-04-04 21:06:21 +00:00
|
|
|
}
|
2018-05-10 20:26:08 +00:00
|
|
|
}
|