donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
57 lines • 2.5 kB
TypeScript
import { Browser, BrowserContext } from 'playwright';
import { BrowserDevice } from '../models/BrowserDevice';
import { BrowserStorageState } from './BrowserStorageState';
import { BrowserConfig } from './BrowserConfig';
export declare class BrowserFramework {
readonly browserConfig: BrowserConfig;
readonly browser: Browser;
readonly browserContext: BrowserContext;
private readonly browserBaseData?;
private static readonly DEFAULT_DEVICE_NAME;
private constructor();
/**
* Closes the browser and browser context. If the browser is a BrowserBase
* instance, it will also release the session.
*/
close(): Promise<void>;
/**
* Loads all the pre-canned browser device configurations from the local
* filesystem.
*
* The returned map keys the devices by their name (ex: 'Desktop Firefox').
*
* See `assets/devices.json` for details.
*/
static getSupportedDevices(): Map<string, BrowserDevice>;
static create(browserConfig: BrowserConfig, outputDir: string, storageState?: BrowserStorageState): Promise<BrowserFramework>;
/**
* Connects to an existing Chromium browser using the Chrome DevTools Protocol (CDP) at the given
* URL. If the URL contains "${env.VARIABLE_NAME}", then it will be expanded to the value of the
* specified environment variable.
*/
private static forRemoteBrowser;
/**
* If {@link storageState} is present, must be an object conforming to what is returned by
* {@link BrowserContext.storageState()}.
*/
private static forDevice;
/**
* Creates a BrowserBase session. If the project ID
* contains "${env.VARIABLE_NAME}", then it will be expanded to the value of
* the specified environment variable. Using this method requires the
* BROWSERBASE_API_KEY environment variable to be set.
*
* The returned browserBaseData object conforms to the response of the session
* creation API endpoint. See...
* https://docs.browserbase.com/reference/api/create-a-session#response-id
*/
private static forBrowserBase;
/**
* Establishes a BrowserBase session. The returned structure matches the
* response structore from the BrowserBase session API. See...
* https://docs.browserbase.com/reference/api/create-a-session#response-id
*/
private static establishBrowserBaseSession;
private static expandEnvVariables;
}
//# sourceMappingURL=BrowserFramework.d.ts.map