import { DappeteerElementHandle } from "./element";
import { DappeteerBrowser } from "./browser";
export interface DappeteerPage
{
$(selector: string): Promise;
$eval(selector: string, evalFn: (e: HTMLElement) => Promise | T): Promise;
$$eval(selector: string, evalFn: (e: HTMLElement[]) => Promise | T[]): Promise;
$$(selector: string): Promise;
getSource(): P;
url(): string;
browser(): DappeteerBrowser;
bringToFront(): Promise;
goto(url: string, options?: {
timeout?: number;
waitUntil?: "load" | "domcontentloaded" | "networkidle" | "commit";
}): Promise;
title(): Promise;
close(options?: {
runBeforeUnload?: boolean;
}): Promise;
reload(): Promise;
setViewport(opts: {
height: number;
width: number;
}): Promise;
waitForResponse(urlOrPredicate: string | ((res: Response) => boolean | Promise), options?: {
timeout?: number;
}): Promise;
waitForSelector(selector: string, opts?: Partial<{
visible: boolean;
detached: boolean;
hidden: boolean;
timeout: number;
}>): Promise;
waitForSelectorIsGone(selector: string, opts?: Partial<{
timeout: number;
}>): Promise;
waitForXPath(xpath: string, opts?: Partial<{
visible: boolean;
timeout: number;
}>): Promise;
waitForTimeout(timeout: number): Promise;
evaluate(evaluateFn: (params: Params) => Result | string, params?: Params): Promise;
screenshot(path: string): Promise;
waitForFunction(pageFunction: Function | string, params?: Params): Promise;
exposeFunction(name: string, callback: Function | {
default: Function;
}): Promise;
waitForNavigation(options?: {
timeout: number;
}): any;
type(selector: string, text: string, options?: {
delay: number;
}): Promise;
}
export declare type Unboxed = Arg extends DappeteerElementHandle ? T : Arg extends [infer A0] ? [Unboxed] : Arg extends [infer A0, infer A1] ? [Unboxed, Unboxed] : Arg extends [infer A0, infer A1, infer A2] ? [Unboxed, Unboxed, Unboxed] : Arg extends [infer A0, infer A1, infer A2, infer A3] ? [Unboxed, Unboxed, Unboxed, Unboxed] : Arg extends Array ? Array> : Arg extends object ? {
[Key in keyof Arg]: Unboxed;
} : Arg;
export declare type Serializable = number | string | boolean | null | BigInt | Serializable[] | {
[k: string]: Serializable;
};
export interface Response {
/**
* An object with the response HTTP headers. The header names are lower-cased. Note that this method does not return
* security-related headers, including cookie-related ones. You can use
* [response.allHeaders()](https://playwright.dev/docs/api/class-response#response-all-headers) for complete list of
* headers that include `cookie` information.
*/
headers(): {
[key: string]: string;
};
/**
* Returns the JSON representation of response body.
*
* This method will throw if the response body is not parsable via `JSON.parse`.
*/
json(): Promise;
/**
* Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
*/
ok(): boolean;
/**
* Contains the status code of the response (e.g., 200 for a success).
*/
status(): number;
/**
* Contains the status text of the response (e.g. usually an "OK" for a success).
*/
statusText(): string;
/**
* Returns the text representation of response body.
*/
text(): Promise;
/**
* Contains the URL of the response.
*/
url(): string;
}