import type { ConsoleMessageType, CookieSameSite, Method, ResourceType } from './enums.js'; /** Response returned after a captcha has been solved */ export interface CaptchaResponse { /** If a captcha was found or not */ found: boolean | null; /** If a captcha was found, whether or not it was solved */ solved: boolean | null; /** The total time it took to find, and solve, the captcha */ time: number | null; /** The solved token of the response, if any is provided */ token: string | null; /** Error message if something went wrong, providing guidance on how to fix the issue */ error: string | null; } /** Response returned after setting up the proxy patterns */ export interface ProxyResponse { time: number | null; } /** Response returned after having clicked on an element */ export interface ClickResponse { /** The selector text if specified */ selector: string | null; /** The amount of time, in milliseconds, elapsed since the start of clicking to completion */ time: number | null; /** The X coordinate of the click, in pixels, on the page */ x: number | null; /** The Y coordinate of the click, in pixels, on the page */ y: number | null; } /** The response returned after setting or getting cookies */ export interface CookieResponse { /** A standard cookie object with the values of the set cookies */ cookies: StandardCookie[] | null; /** The time it took to set and return the cookies */ time: number | null; } /** Default response for all methods */ export interface DefaultResponse { /** The default timeout for all methods. Default timeout is 30 seconds, or 30000. */ timeout: number | null; } /** Response from window switching operation */ export interface SwitchWindowResponse { success: boolean; error: string | null; title: string | null; url: string | null; navigation: HTTPResponse | null; } /** Response returned after evaluating a script */ export interface EvaluateResponse { /** The time it took for the evaluate call to happen */ time: number | null; /** The returned value of the script, if any */ value: string | null; } /** HTML content of a page */ export interface HTMLResponse { /** The content of the page's HTML */ html: string | null; /** The amount of time, in milliseconds, elapsed since the start of content retrieval to completion */ time: number | null; } /** An object representing the header's name and underlying value */ export interface HTTPHeaders { name: string | null; value: string | null; } /** The response returned after setting HTTP headers */ export interface HTTPHeadersResponse { /** The HTTP headers that were set */ headers: HTTPHeaders[] | null; /** The time it took to set the HTTP headers */ time: number | null; } /** The response returned after setting the User-Agent */ export interface UserAgentResponse { /** The User-Agent string that was set */ userAgent: string | null; /** The time it took to set the User-Agent */ time: number | null; } /** Response returned after a navigation event */ export interface HTTPResponse { /** The remote IP address that served the initial page-load response */ ip: string | null; /** The remote port that served the initial page-load response */ port: number | null; /** The status code response of the initial page-load */ status: number | null; /** The amount of time, in milliseconds, elapsed since the start of navigation to completion */ time: number | null; /** The status text of the response from the initial page-load. Generally 'ok' */ text: string | null; /** The final URL of the page after any potential redirects or URL rewrites */ url: string | null; } /** An object representing the header's name and underlying value */ export interface RequestHeader { name: string | null; value: string | null; } /** Response returned from the request API */ export interface RequestResponse { /** The final URL of the request */ url: string | null; /** The HTTP method of the request */ method: Method | null; /** The type of request that was made */ type: ResourceType | null; /** The headers of the request */ headers: RequestHeader[] | null; } /** Response returned from the response API */ export interface ResponseResponse { /** The HTTP status code of the response */ status: number | null; /** The final URL of the response */ url: string | null; /** The HTTP method of the request that facilitated the response */ method: Method | null; /** The type of response that was received */ type: ResourceType | null; /** The response headers returned */ headers: RequestHeader[] | null; /** The body of the response, represented as a string when possible or base64 for binary-type requests like images */ body: string | null; /** Whether the response body is base64 encoded. */ base64Encoded: boolean; } /** Response returned after having hovered over an element */ export interface HoverResponse { /** The selector text */ selector: string | null; /** The amount of time, in milliseconds, elapsed since the start to completion */ time: number | null; /** The X coordinate in pixels, on the page */ x: number | null; /** The Y coordinate in pixels, on the page */ y: number | null; } /** The response returned after enabling or disabling JavaScript on the page */ export interface JavaScriptResponse { /** Whether or not JavaScript is enabled on the page */ enabled: boolean | null; /** The time it took to perform this action */ time: number | null; } export interface Attribute { name: string | null; value: string | null; } /** Response returned from a Map Selector */ export interface MapSelectorResponse { /** The innerHTML of the selected DOM Node */ innerHTML: string | null; /** The innerText of the selected DOM Node, eg, the raw textual content */ innerText: string | null; /** The ID attribute's value, if any, of the node */ id: string | null; /** The class attribute's value, if any, of the node represented as an array of strings */ class: string[] | null; } /** The response returned after generating a PDF */ export interface PDFResponse { /** Base64 encoded PDF content */ base64: string | null; /** The size of the resulting PDF in bytes */ size: number | null; /** The time it took to generate the PDF */ time: number | null; } /** The response from the Live-URL query */ export interface LiveURLResponse { /** A unique ID representing the session. Useful for storing and associations in other APIs */ liveURLId: string | null; /** The fully-qualified URL to share with the end-user to allow them to live-stream the browser */ liveURL: string | null; } /** The response returned after querying the page for a selector */ export interface QuerySelectorResponse { /** The Element.childElementCount read-only property returns the number of child elements of this element */ childElementCount: number | null; /** The className property of the Element interface gets and sets the value of the class attribute of the specified element */ className: string | null; /** The id property of the Element interface represents the element's identifier, reflecting the id global attribute */ id: string | null; /** The Element property innerHTML gets the HTML or XML markup contained within the element */ innerHTML: string | null; /** The Element property innerText gets the text contained within the element */ innerText: string | null; /** The Element.localName read-only property returns the local part of the qualified name of an element */ localName: string | null; /** The outerHTML attribute of the Element DOM interface gets the serialized HTML fragment describing the element including its descendants. It can also be set to replace the element with nodes parsed from the given string */ outerHTML: string | null; } /** The response received after attempting to reconnect a BrowserQL session */ export interface ReconnectionResponse { /** The fully-qualified URL to reconnect future BrowserQL sessions, eg: https://chrome.browserless.io/bql/$id. Please note that token information is not returned by this API and might be required */ browserQLEndpoint: string | null; /** The fully-qualified URL of the browserWSEndpoint which can be used with other libraries like playwright or puppeteer. Please note that token information is not returned by this API and might be required */ browserWSEndpoint: string | null; /** The fully-qualified URL of the devtools resources for loading Chrome's developer tools remotely */ devtoolsFrontendUrl: string | null; /** The underlying page's webSocketDebuggerUrl, useful for hooking libraries that operate on a page and not a browser object */ webSocketDebuggerUrl: string | null; } /** The response received after stopping session recording */ export interface StopSessionRecordingResponse { /** Whether the recording was successfully stopped and uploaded */ success: boolean | null; /** Error message if the operation failed */ error: string | null; } /** The response parameters for the reject mutation */ export interface RejectResponse { time: number | null; enabled: boolean | null; } /** Response returned after having scrolling inside the page */ export interface ScrollResponse { /** The CSS selector of the element on the page you want to scroll to */ selector: string | null; /** The amount of time, in milliseconds, elapsed since the start of scrolling to completion */ time: number | null; /** The X coordinate, in pixels, to scroll to */ x: number | null; /** The Y coordinate, in pixels, to scroll to */ y: number | null; } /** The response returned after generating a Screenshot */ export interface ScreenshotResponse { /** The base64 encoded image of the screenshot */ base64: string | null; /** The format of the screenshot */ format: string | null; /** The time it took to take the screenshot */ time: number | null; } /** The response returned after selecting a value from a dropdown or multiple select element */ export interface SelectResponse { /** The selector of the element you selected from */ selector: string | null; /** The amount of time, in milliseconds, elapsed since the start of selecting to completion */ time: number | null; /** The value or values you selected from the select element */ value: string | string[] | null; } /** A standard cookie */ export interface StandardCookie { /** Cookie domain */ domain: string | null; /** Cookie expiration date, session cookie if not set */ expires: number | null; /** True if cookie is http-only */ httpOnly: boolean | null; /** Cookie name */ name: string; /** Cookie path */ path: string | null; /** Cookie SameSite type */ sameSite: CookieSameSite | null; /** True if cookie is secure */ secure: boolean | null; /** Cookie value */ value: string; /** The request-URI to associate with the setting of the cookie. This value can affect the default domain, path, source port, and source scheme values of the created cookie */ url: string | null; } /** Text content of a page */ export interface TextResponse { /** The textual content of the page */ text: string | null; /** The amount of time, in milliseconds, elapsed since the start of text retrieval to completion */ time: number | null; } /** Response returned after the page's title has been set or get */ export interface TitleResponse { /** The title of the current page */ title: string | null; } /** Response returned after having typed into an element */ export interface TypeResponse { /** The selector of the element you typed into */ selector: string | null; /** The textual content that was typed */ text: string | null; /** The amount of time, in milliseconds, elapsed since the start of typing to completion */ time: number | null; /** The X coordinate of the element, in pixels, on the page */ x: number | null; /** The Y coordinate of the element, in pixels, on the page */ y: number | null; } /** * Response returned after attempting to fill a credential resolved from a * 1Password integration. The resolved value is never included in the response. */ export interface LoadSecretResponse { /** Whether the credential was resolved and filled into the target element. */ ok: boolean; /** * Error code when ok is false: DomainNotAllowed, SelectorNotFound, * NoFocusedElement, TargetNotFillable, CredentialNotResolved, * CredentialIntegrationExpired, VaultUnreachable, or AuditWriteFailed. */ error: string | null; /** Human-readable explanation when ok is false. */ message: string | null; /** The amount of time, in milliseconds, the operation took. */ time: number | null; } /** Response returned after the URL of the page has been set or get */ export interface URLResponse { /** The URL of the current page */ url: string | null; } /** Response returned after a particular network request has been sent */ export interface WaitForRequestResponse { /** The period of time elapsed, in milliseconds, waited for */ time: number | null; /** The URL parameter used to match the response with */ url: string | null; } /** Response returned after a particular network response has been received */ export interface WaitForResponseResponse { /** The period of time elapsed, in milliseconds, waited for */ time: number | null; /** The status code response of the response */ status: number | null; /** The URL parameter used to match the response with */ url: string | null; } /** Response returned after a particular selector has been found in the DOM */ export interface WaitForSelectorResponse { /** The height, in pixels, of the element */ height: number | null; /** The selector waited for */ selector: string | null; /** The period of time elapsed, in milliseconds, waited for */ time: number | null; /** The position, in pixels, top of the viewport */ y: number | null; /** The position, in pixels, left of the viewport */ x: number | null; /** The width, in pixels, of the element */ width: number | null; } /** Response returned after having waited for a selector to appear in the DOM */ export interface WaitForTimeoutResponse { /** The period of time elapsed, in milliseconds, waited for */ time: number | null; } /** Response returned after having waited for a JavaScript predicate to become truthy */ export interface WaitForFunction { /** The period of time elapsed, in milliseconds, waited for */ time: number | null; } /** Response returned after having waited for an event to fire on the page */ export interface WaitForEvent { /** The period of time elapsed, in milliseconds, waited for */ time: number | null; } /** Response returned after setting the viewport */ export interface ViewportResponse { /** The width of the viewport in pixels */ width: number | null; /** The height of the viewport in pixels */ height: number | null; /** The device scale factor */ deviceScaleFactor: number | null; /** Whether the device is in mobile mode */ mobile: boolean | null; /** Whether the viewport supports touch events */ hasTouch: boolean | null; /** Whether the viewport is in landscape orientation */ landscape: boolean | null; /** The time it took to set the viewport */ time: number | null; } /** Response returned after emulating a CSS media type */ export interface EmulateMediaTypeResponse { /** The media type that was emulated */ type: string | null; /** The period of time elapsed, in milliseconds */ time: number | null; } /** Response returned after injecting a script tag */ export interface AddScriptTagResponse { /** The period of time elapsed, in milliseconds */ time: number | null; } /** Response returned after injecting a style tag */ export interface AddStyleTagResponse { /** The period of time elapsed, in milliseconds */ time: number | null; } /** Response returned after registering a request-fulfillment interceptor */ export interface FulfillResponse { /** The period of time elapsed, in milliseconds */ time: number | null; } /** Response returned after converting the page content to Markdown */ export interface MarkdownResponse { /** The page content converted to Markdown */ markdown: string | null; /** The period of time elapsed, in milliseconds */ time: number | null; } /** The source location a console message originated from. */ export interface ConsoleMessageLocation { url: string | null; lineNumber: number | null; columnNumber: number | null; } /** * A console message emitted by the page. Mirrors puppeteer's ConsoleMessage, * sourced from CDP Runtime.consoleAPICalled and Runtime.exceptionThrown. */ export interface ConsoleMessage { /** The kind of console message. */ type: ConsoleMessageType | null; /** The joined, human-readable message text (equivalent to puppeteer's msg.text()). */ text: string | null; /** Each console argument, JSON-encoded and in order (equivalent to msg.args()). */ args: string[] | null; /** The source location the message originated from. */ location: ConsoleMessageLocation | null; /** Wall-clock milliseconds since the Unix epoch when the message was emitted. */ timestamp: number | null; } //# sourceMappingURL=responses.d.ts.map