import type { CaptchaType, CountryCode, LiveURLStreamType, MediaType, Method, OperatorType, PDFPageFormat, ProxyNetwork, ResourceType, ScreenshotType, WaitForFunctionPolling, WaitUntilGoto, WaitUntilHistory } from './enums.js'; import type { CleanInput, CookieInput, HTMLRewriteInput, HeaderInput, ScreenshotClip } from './inputs.js'; import type { TransportFactory } from '../transport.js'; export interface AuthenticateOptions { /** * The origin of the requests needing authentication, specified as a full * HTTP origin in `protocol://host(:port)` format (e.g. * `https://example.com`). If not provided, every request needing * authentication will use the provided credentials. */ origin?: string; } export interface NavigationOptions { /** The maximum amount of time, in milliseconds, to wait for the page to load, overriding any defaults. Default timeout is 30 seconds, or 30000. */ timeout?: number; /** * When to consider the page fully-loaded and proceed with further execution * * @default load */ waitUntil?: WaitUntilHistory; } export interface CheckboxOptions { /** * Whether or not to scroll to the element prior to clicking, defaults to true * * @default true */ scroll?: boolean; /** How long to wait for the element to appear before timing out on the handler, overriding any defaults. Default timeout is 30 seconds, or 30000. */ timeout?: number; /** * Whether or not to check/uncheck the element only if it's visible * * @default false */ visible?: boolean; /** * Whether or not to wait for the element to present in the DOM * * @default true */ wait?: boolean; } export interface ClickOptions { /** * Whether or not to scroll to the element prior to clicking, defaults to true * * @default true */ scroll?: boolean; /** How long to wait for the element to appear before timing out on the click handler, overriding any defaults. Default timeout is 30 seconds, or 30000. */ timeout?: number; /** * Whether or not to click the element only if it's visible * * @default false */ visible?: boolean; /** * Whether or not to wait for the element to present in the DOM * * @default true */ wait?: boolean; } export interface SetContentOptions { /** The maximum amount of time, in milliseconds, to wait for the content to load, overriding any defaults. Default timeout is 30 seconds, or 30000. */ timeout?: number; /** When to consider the page fully-loaded and proceed with further execution, used in conjunction with the value parameter */ waitUntil?: WaitUntilHistory; /** Wait for every listed lifecycle event. Use this instead of waitUntil when preserving an ordered REST array contract. */ waitUntilAll?: WaitUntilHistory[]; } export interface SetCookieOptions { /** The cookies to set on the page */ cookies?: CookieInput[]; } export interface EvaluateOptions { /** A timeout to wait for the script to finish evaluating, overriding any defaults. Useful for async scripts that may be longer running. Default timeout is 30 seconds, or 30000. */ timeout?: number; /** * The URL of the script you'd like to evaluate. This code gets wrapped in an async function so you can use `return` at the end as well as `await` and other async * concepts. You can return any stringified value from this function */ url?: string; } export interface GotoOptions { /** The maximum amount of time, in milliseconds, to wait for the page to load, overriding any defaults. Default timeout is 30 seconds, or 30000. */ timeout?: number; /** * When to consider the page fully-loaded and proceed with further execution * * @default load */ waitUntil?: WaitUntilGoto; /** Wait for every listed lifecycle event. This preserves Puppeteer waitUntil array semantics. */ waitUntilAll?: WaitUntilGoto[]; /** The Referer header to send with the navigation request */ referer?: string; /** The referrer policy to use for the navigation request */ referrerPolicy?: string; /** Request remote IP/port fields. Enable only when the target BQL schema supports them. */ remoteResponseMetadata?: boolean; } export interface HTMLOptions { /** The DOM selector of the given element you want to return the HTML of */ selector?: string; /** The maximum amount of time, in milliseconds, to wait for the selector to appear, overriding any defaults. Default timeout is 30 seconds, or 30000. */ timeout?: number; /** * Whether or not to return the HTML content of the element only if it's visible * * @default false */ visible?: boolean; /** Specifies conditions for "cleaning" HTML, useful for minimizing the amount of markup returned for cases like LLMs and more. See nested options for parameters. */ clean?: CleanInput; /** Rewrites captured resource URLs to archive-relative paths before returning HTML. */ rewrite?: HTMLRewriteInput; } export interface SetExtraHTTPHeadersOptions { /** The HTTP headers to set on the page */ headers?: HeaderInput[]; } export interface HoverOptions { /** * Whether or not to scroll to the element, defaults to true * * @default true */ scroll?: boolean; /** How long to wait for the element to appear before timing out, overriding any defaults. Default timeout is 30 seconds, or 30000. */ timeout?: number; /** * Whether or not to hover on the element only if it's visible * * @default false */ visible?: boolean; /** * Whether or not to wait for the element to present in the DOM * * @default true */ wait?: boolean; /** The X coordinate, in pixels, to hover on the page */ x?: number; /** The Y coordinate, in pixels, to hover on the page */ y?: number; } export interface JavaScriptEnabledOptions { /** Whether or not to enable JavaScript on the page */ enabled?: boolean; } export interface LiveURLOptions { /** The maximum time allowed for the browser to remain alive. Once the time is reached, the end-user will receive a prompt that the session has closed */ timeout?: number; /** * Whether the session is interactable or not. Set to "false" to not allow click and mouse events to be forwarded through to the end-user * * @default true */ interactable?: boolean; /** * The binary-type of the streamed imaged. "jpeg" will consumer lower bandwidth and useful low bandwidth networks and devices. "png" is a much higher quality but will consume considerably more bandwidth. * * Use "jpeg" when setting a custom quality * * @default jpeg */ type?: LiveURLStreamType; /** * The quality of the stream, represented as number from 1 - 100. Only used when "type" is "jpeg". Default is 70. * * @default 70 */ quality?: number; /** * Whether or not to resize the underlying browser to match the end-user's screen size. When `false` the underlying browser will retain it's current viewport, and the end users's screen wil maintain the appropriate aspect ratio. * * @default true */ resizable?: boolean; /** * Whether to show the browser interface and tabs in the live URL. When `false` (default), only the browser content is shown. When `true`, navigation bar and tabs are displayed. * * @default false */ showBrowserInterface?: boolean; /** * Whether to compress each frame of the streamed image data. When `true` (default), frames are compressed to reduce bandwidth usage. Set to `false` to disable compression for lower latency at the cost of increased bandwidth usage. * * @default true */ compressed?: boolean; /** * Whether to emulate HTML components such as `