import { WebDriver, WebElement } from "../"; import { BrowsingContextInfo } from "./browsingContextTypes"; import { CaptureScreenshotParameters } from "./captureScreenshotParameters"; import CreateContextParameters from "./createContextParameters"; import { ReferenceValue, RemoteValue, SerializationOptions } from "./protocolValue"; interface LocatorMapValue { type: "css" | "innerText" | "xpath"; value: string; ignoreCase?: boolean; matchType?: string; maxDepth?: number; } declare class Locator { static TYPE: { CSS: "css"; INNER_TEXT: "innerText"; XPATH: "xpath"; }; constructor( type: string, ignoreCase: string, matchType: string, maxDepth: number, ); static css(value: string): Locator; static xpath(value: string): Locator; static innerText( value: string, ignoreCase?: boolean, matchType?: string, maxDepth?: number, ): Locator; toMap(): Map; } type readinessState = "none" | "interactive" | "complete"; declare class BrowsingContext { private _driver: WebDriver; private _id: string; constructor(driver: WebDriver); get id(): string | undefined; init(options: { browsingContextId?: string; type?: "window" | "tab"; createParameters?: string; }): Promise; create(type: "window" | "tab", createParameters?: CreateContextParameters): Promise; navigate(url: string, readinessState?: readinessState): Promise; getTree(maxDepth?: number): Promise; getTopLevelContexts(): Promise; close(): Promise; printPage(options?: any): Promise; captureScreenshot( captureScreenshotParameters?: CaptureScreenshotParameters, ): Promise; captureBoxScreenshot( x: number, y: number, width: number, height: number, ): Promise; captureElementScreenshot( sharedId: string, handle?: string, ): Promise; activate(): Promise; handleUserPrompt( accept?: boolean, userText?: string, ): Promise; reload( ignoreCache?: boolean, readinessState?: readinessState, ): Promise; setViewport( width: number, height: number, devicePixelRatio?: number, ): Promise; traverseHistory(delta: number): Promise; forward(): Promise; back(): Promise; locateNodes( locator: Locator, maxNodeCount?: number, sandbox?: string, serializationOptions?: SerializationOptions, startNodes?: ReferenceValue[], ): Promise>; locateNode( locator: Locator, sandbox?: string, serializationOptions?: SerializationOptions, startNodes?: ReferenceValue[], ): Promise>; locateElement(locator: Locator): Promise; locateElements(locator: Locator): Promise; } declare class NavigateResult { private _url: string; private _navigationId: number; constructor(url: string, navigationId: number); get url(): string; get navigationId(): number; } declare class PrintResult { private _data: any; constructor(data: any); get data(): any; } declare function getBrowsingContextInstance( driver: WebDriver, options: { browsingContextId?: string; type?: "window" | "tab"; createParameters?: CreateContextParameters; }, ): Promise; export = getBrowsingContextInstance;