import { BiDi } from "../../index"; import * as EventType from "./types"; import BrowsingContextEvents from "./events"; /** * The BrowsingContext class provides methods for managing navigation contexts in a user agent. */ export default class BrowsingContext { _ws: BiDi; _events: BrowsingContextEvents; /** * Constructs a new instance of the BrowsingContext. * @param {BiDi} BiDiConnection - The BiDi connection object to use. */ constructor(BiDiConnection: BiDi); /** * Gets BrowsingContext events. * @returns {BrowsingContextEvents} The BrowsingContext events. */ get events(): BrowsingContextEvents; /** * Makes the specified context the active context. * @param {EventType.BrowsingContextActivateParameters} context - The context to make active. */ activate(context: EventType.BrowsingContextActivateParameters): Promise; /** * Captures a screenshot of the specified browsing context. * @param {EventType.BrowsingContextCaptureScreenshotParameters} contextParameters - The context to capture a screenshot from. * @returns {EventType.CaptureScreenshotResult} The screenshot result. */ captureScreenshot(contextParameters: EventType.BrowsingContextCaptureScreenshotParameters): Promise; /** * Closes the specified top level browsing context. * @param {EventType.BrowsingContextCloseParameters} closeParams - The context to close. */ close(closeParams: EventType.BrowsingContextCloseParameters): Promise; /** * Creates a new top-level browsing context. * @param {EventType.BrowsingContextCreateParameters} createContext - The parameters to create a context with. * @returns {EventType.BrowsingContextCreateResult} The creation result. */ create(createContext: EventType.BrowsingContextCreateParameters): Promise; /** * Retrieves the tree of browsing contexts. * @param {EventType.BrowsingContextGetTreeParameters} BrowsingContextTreeParams - The parameters to get the context tree with. * @returns {EventType.BrowsingContextGetTreeResultType} The context tree. */ getTree(BrowsingContextTreeParams: EventType.BrowsingContextGetTreeParameters): Promise; /** * Handles a user prompt. * @param {EventType.BrowsingContextHandleUserPromptParameters} promptParameters - The parameters to handle the prompt with. */ handleUserPrompt(promptParameters: EventType.BrowsingContextHandleUserPromptParameters): Promise; /** * Locates nodes in a browsing context using a CSS or XPath selector. * @param {EventType.BrowsingContextLocateNodesParameters} locateNodeParams - The parameters to locate nodes with. * @returns {EventType.BrowsingContextLocateNodesResultType} The located nodes. */ locateNodes(locateNodeParams: EventType.BrowsingContextLocateNodesParameters): Promise; /** * Navigates a browsing context to a new location. * @param {EventType.BrowsingContextNavigateParameters} navigateParams - The parameters to navigate with. * @returns {EventType.BrowsingContextNavigateResultType} The navigation result. */ navigate(navigateParams: EventType.BrowsingContextNavigateParameters): Promise; /** * Prints the contents of a browsing context to a PDF. * @param {EventType.BrowsingContextPrintParams} printParameters - The parameters to print with. * @returns {EventType.BrowsingContextPrintResult} The print result. */ print(printParameters: EventType.BrowsingContextPrintParams): Promise; /** * Reloads the specified browsing context. * @param {EventType.BrowsingContextReloadParameters} reloadParams - The context to reload. * @returns {EventType.BrowsingContextReloadResultType} The reload result. */ reload(reloadParams: EventType.BrowsingContextReloadParameters): Promise; /** * Sets the viewport size for the specific browsing context. * @param {EventType.BrowsingContextSetViewportParameters} viewportParameters - The parameters to set the viewport with. */ setViewport(viewportParameters: EventType.BrowsingContextSetViewportParameters): Promise; /** * Traverses the history of a browsing context. * @param {EventType.BrowsingContextTraverseHistoryParameters} traverseHistoryParameters - The parameters to traverse history with. */ traverseHistory(traverseHistoryParameters: EventType.BrowsingContextTraverseHistoryParameters): Promise; }