// Type definitions for PhantomJS bridge for NodeJS 3.2 // Project: https://github.com/sgentle/phantomjs-node // Definitions by: horiuchi , Random // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export function create(args?: string[]): Promise; export interface PhantomJS { createPage(): Promise; exit(returnValue?: number): void; } export interface WebPage { open(url: string): Promise; close(): Promise; evaluate(callback: () => R): Promise; evaluate(callback: (arg: T) => R, arg: T): Promise; evaluate(callback: (arg1: T1, arg2: T2) => R, arg1: T1, arg2: T2): Promise; evaluate(callback: (arg1: T1, arg2: T2, arg3: T3) => R, arg1: T1, arg2: T2, arg3: T3): Promise; evaluate(callback: (...args: any[]) => R, ...args: any[]): Promise; includeJs(url: string): Promise; injectJs(filename: string): Promise; sendEvent(mouseEventType: string, mouseX?: number, mouseY?: number, button?: string): Promise; sendEvent(keyboardEventType: string, key: string, null1?: void, null2?: void, modifier?: number): Promise; render(filename: string): Promise; render(filename: string, options?: { format?: string; quality?: string; }): Promise; renderBase64(type: string): Promise; setContent(html: string, url: string): Promise; property(key: string): Promise; property(key: string, value: T): Promise; setting(key: string): Promise; addCookie(cookie: ICookie): Promise; deleteCookie(cookieName: string): Promise; clearCookies(): Promise; } export interface ICookie { name: string, value: string, domain?: string, path: string, httponly?: boolean, secure?: boolean, expires?: Date } export interface IPaperSizeOptions { width?: string; height?: string; format?: string; orientation?: string; margin?: any; // string | { top?: string; left?: string; bottom?: string; right?: string; } }