import { Browser } from '../../client.js'; import type { BrowserClientConfig } from '../../types.js'; import type { NavigateParams, ClickParams, TypeParams, GetTextParams, GetHtmlParams, ScreenshotParams, EvaluateParams, CookieParams, WaitForSelectorParams, FillParams, IsVisibleParams } from './types.js'; /** * Playwright-based browser automation client for AWS Bedrock AgentCore Browser service. * * Extends Browser with full browser automation capabilities using Playwright. * Provides methods for navigation, interaction, content extraction, and JavaScript execution. * * Sessions are automatically created on first use and Playwright connections are * managed internally. * * @example * ```typescript * const browser = new PlaywrightBrowser({ region: 'us-east-1' }) * * // Direct usage (auto-creates session) * await browser.navigate({ url: 'https://example.com' }) * await browser.click({ selector: 'button' }) * const text = await browser.getText({ selector: 'h1' }) * * // Explicit session management * await browser.startSession({ sessionName: 'my-session' }) * await browser.navigate({ url: 'https://example.com' }) * await browser.stopSession() * ``` */ export declare class PlaywrightBrowser extends Browser { private _playwrightBrowser; private _playwrightPage; /** * Creates a new PlaywrightBrowser instance. * * @param config - Configuration options for the client */ constructor(config: BrowserClientConfig); /** * Stops the active browser session and closes Playwright connections. */ stopSession(): Promise; /** * Navigates to a URL. * Automatically creates a session and connects if needed. * * @param params - Navigation parameters */ navigate(params: NavigateParams): Promise; /** * Clicks an element on the page. * * @param params - Click parameters */ click(params: ClickParams): Promise; /** * Types text into an input element. * * @param params - Type parameters */ type(params: TypeParams): Promise; /** * Gets text content from an element or the page. * * @param params - GetText parameters * @returns Text content */ getText(params?: GetTextParams): Promise; /** * Gets HTML content from an element or the page. * * @param params - GetHtml parameters * @returns HTML content */ getHtml(params?: GetHtmlParams): Promise; /** * Takes a screenshot of the page. * * @param params - Screenshot parameters * @returns Screenshot as base64 string or Buffer */ screenshot(params?: ScreenshotParams): Promise; /** * Evaluates JavaScript code in the page context. * * @param params - Evaluate parameters * @returns Result of the evaluation */ evaluate(params: EvaluateParams): Promise; /** * Navigates back in browser history. */ back(): Promise; /** * Navigates forward in browser history. */ forward(): Promise; /** * Refreshes the current page. */ refresh(): Promise; /** * Gets all cookies. * * @returns Array of cookies */ getCookies(): Promise; /** * Sets cookies. * * @param params - Cookie parameters */ setCookies(params: CookieParams): Promise; /** * Presses a keyboard key. * * @param key - Key name (e.g., 'Enter', 'Tab', 'Escape') */ pressKey(key: string): Promise; /** * Waits for an element to be present in the DOM. * * @param params - WaitForSelector parameters */ waitForSelector(params: WaitForSelectorParams): Promise; /** * Fills an input element with text (clears existing value first). * More reliable than type() for forms. * * @param params - Fill parameters */ fill(params: FillParams): Promise; /** * Checks if an element is visible on the page. * * @param params - IsVisible parameters * @returns true if element is visible, false otherwise */ isVisible(params: IsVisibleParams): Promise; /** * Ensures a session exists and Playwright is connected. */ private _ensureConnected; /** * Connects to the browser via Playwright WebSocket. */ private _connectPlaywright; } //# sourceMappingURL=client.d.ts.map