import { CookieJar } from 'cookiejar'; import { Response as FetchResponse } from 'node-fetch-commonjs'; declare global { interface Window { prototype: Window; } interface Document { prototype: Document; } interface MutationObserver { prototype: MutationObserver; new(callback: MutationCallback): MutationObserver; } } declare module "@expressen/tallahassee" { export class BrowserTab { /** Cheerio context */ get $(): cheerio.Cheerio; get jar(): CookieJar; get response(): FetchResponse; get _pending(): Promise; window: Window; document: Document; navigateTo(uri: string, headers?: Record, statusCode?: number): Promise; load(markup: string): BrowserTab; focusIframe(element: HTMLElement, src: string): Promise; runScript(script: HTMLElement): void; runScripts(context?: Node): void; mutated(targetNode: Node, config?: { childList?: boolean, attributes?: boolean }): Promise; } export class WebPage { navigateTo(uri: string, headers?: Record, statusCode?: number): Promise; load(markup: string): Promise; submit(uri: string, options?: Record): Promise; fetch(uri: string, requestOptions?: Record): Promise; } class Browser { constructor(origin: any, options?: Record); constructor(options?: Record); navigateTo(uri: string, headers?: Record, statusCode?: number): Promise; load(markup: string): Promise; } interface DOMInterface { Document: Document; HTMLCollection: HTMLCollection; IntersectionObserver: IntersectionObserver; MutationObserver: MutationObserver; Window: Window; Storage: Storage; } export const DOM: DOMInterface; export = Browser; }