UNPKG

happy-dom

Version:

Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.

65 lines 2.15 kB
/// <reference types="node" /> /// <reference types="node" /> import IBrowserPageViewport from '../types/IBrowserPageViewport.cjs'; import VirtualConsolePrinter from '../../console/VirtualConsolePrinter.cjs'; import IBrowserFrame from './IBrowserFrame.cjs'; import IBrowserContext from './IBrowserContext.cjs'; import { Script } from 'vm'; import IGoToOptions from './IGoToOptions.cjs'; import Response from '../../fetch/Response.cjs'; import IReloadOptions from './IReloadOptions.cjs'; import IOptionalBrowserPageViewport from './IOptionalBrowserPageViewport.cjs'; /** * Browser page. */ export default interface IBrowserPage { readonly virtualConsolePrinter: VirtualConsolePrinter; readonly mainFrame: IBrowserFrame; readonly context: IBrowserContext; readonly console: Console; readonly frames: IBrowserFrame[]; readonly viewport: IBrowserPageViewport; content: string; url: string; /** * Aborts all ongoing operations and destroys the page. */ close(): Promise<void>; /** * Returns a promise that is resolved when all resources has been loaded, fetch has completed, and all async tasks such as timers are complete. */ waitUntilComplete(): Promise<void>; /** * Returns a promise that is resolved when the page has navigated and the response HTML has been written to the document. */ waitForNavigation(): Promise<void>; /** * Aborts all ongoing operations. */ abort(): Promise<void>; /** * Evaluates code or a VM Script in the page's context. */ evaluate(script: string | Script): any; /** * Sets the viewport. * * @param viewport Viewport. */ setViewport(viewport: IOptionalBrowserPageViewport): void; /** * Go to a page. * * @param url URL. * @param [options] Options. */ goto(url: string, options?: IGoToOptions): Promise<Response | null>; /** * Reloads the current page. * * @param [options] Options. * @returns Response. */ reload(options: IReloadOptions): Promise<Response | null>; } //# sourceMappingURL=IBrowserPage.d.ts.map