// Generated by typings // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/c2a54db3e9247d3881668c3ca80e5b5284961db6/jsdom/index.d.ts declare module 'jsdom' { // Type definitions for jsdom 2.0.0 // Project: https://github.com/tmpvar/jsdom // Definitions by: Asana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// /// import EventEmitter = NodeJS.EventEmitter; /** * The do-what-I-mean API. * * Example: * jsdom.env(html, function (errors, window) { * // free memory associated with the window * window.close(); * }); * * @param urlOrSource may be a URL, file name, or HTML fragment * @param scriptUrlsOrSources a string or array of strings, containing file names or URLs that will be inserted as * @param config Configuration object * @param callback */ export function env(urlOrHtml: string, scripts: string, config: Config, callback?: Callback): void; export function env(urlOrHtml: string, scripts: string, callback: Callback): void; export function env(urlOrHtml: string, scripts: string[], config: Config, callback?: Callback): void; export function env(urlOrHtml: string, scripts: string[], callback: Callback): void; export function env(urlOrHtml: string, callback: Callback): void; export function env(urlOrHtml: string, config: Config, callback?: Callback): void; export function env(config: Config, callback?: Callback): void; export function serializeDocument(doc: Document): string; export interface VirtualConsole extends EventEmitter { sendTo(console: Console): VirtualConsole; } export interface VirtualConsoleOptions { } export interface WindowProperties { parsingMode?: string; // html, xml, auto, undefined contentType?: string; parser?: any; url?: string; referrer?: string; cookieJar?: CookieJar; cookie?: string; resourceLoader?: any; deferClose?: boolean; concurrentNodeIterators?: number; virtualConsole?: VirtualConsole; created?: (something: any, window: Window) => any; features?: FeatureOptions; top?: Window; } // tough-cookie export interface CookieJar { } export function createVirtualConsole(options?: VirtualConsoleOptions): VirtualConsole; export function getVirtualConsole(window: Window): VirtualConsole; export function createCookieJar(): CookieJar; export function nodeLocation(node: Node): any; export function reconfigureWindow(window: Window, newProps: WindowProperties): void; export function changeURL(window: Window, url: string): void; export function jQueryify(window: Window, jqueryUrl: string, callback: (window: Window, jquery: JQuery) => any): void; export var debugMode: boolean; export interface DocumentWithParentWindow extends Document { parentWindow: Window; } /** * The jsdom.jsdom method does less things automatically; it takes in only HTML source, and does not let you to * separately supply script that it will inject and execute. It just gives you back a document object, * with usable document.parentWindow, and starts asynchronously executing any