cloudflare
Version:
The official TypeScript library for the Cloudflare API
95 lines • 2.92 kB
TypeScript
import { APIResource } from "../../../../core/resource.js";
import { APIPromise } from "../../../../core/api-promise.js";
import { RequestOptions } from "../../../../internal/request-options.js";
export declare class BaseLiveView extends APIResource {
static readonly _key: readonly ['browserRendering', 'devtools', 'browser', 'liveView'];
/**
* Generates time-limited URLs to view a remote browser session. Set
* `guardrails: { mode: 'readonly' }` to create a view-only link.
*
* @example
* ```ts
* const liveView =
* await client.browserRendering.devtools.browser.liveView.create(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* { account_id: 'account_id' },
* );
* ```
*/
create(sessionID: string, params: LiveViewCreateParams, options?: RequestOptions): APIPromise<LiveViewCreateResponse>;
}
export declare class LiveView extends BaseLiveView {
}
export interface LiveViewCreateResponse {
/**
* Target ID
*/
id: string;
/**
* URL to open the live view in a browser
*/
devtoolsFrontendUrl: string;
options: LiveViewCreateResponse.Options;
/**
* WebSocket URL for CDP connection
*/
webSocketDebuggerUrl: string;
}
export declare namespace LiveViewCreateResponse {
interface Options {
/**
* UI mode for the live view
*/
mode: 'devtools' | 'tab' | 'full';
/**
* Connection guardrails applied to this link
*/
guardrails?: Options.Guardrails;
}
namespace Options {
/**
* Connection guardrails applied to this link
*/
interface Guardrails {
mode: 'readonly';
}
}
}
export interface LiveViewCreateParams {
/**
* Path param: Account ID.
*/
account_id: string;
/**
* Body param: How long the live view URLs remain valid, in milliseconds. Default:
* 5 minutes. Max: 60 minutes.
*/
expiresInMs?: number;
/**
* Body param: Connection guardrails. Use `{ mode: 'readonly' }` to generate a
* view-only link.
*/
guardrails?: LiveViewCreateParams.Guardrails;
/**
* Body param: UI mode: 'devtools' (Chrome DevTools), 'tab' (single tab view),
* 'full' (multi-tab browser)
*/
mode?: 'devtools' | 'tab' | 'full';
/**
* Body param: Target ID (page) to connect to. If omitted, auto-resolves to the
* first active page.
*/
targetId?: string;
}
export declare namespace LiveViewCreateParams {
/**
* Connection guardrails. Use `{ mode: 'readonly' }` to generate a view-only link.
*/
interface Guardrails {
mode: 'readonly';
}
}
export declare namespace LiveView {
export { type LiveViewCreateResponse as LiveViewCreateResponse, type LiveViewCreateParams as LiveViewCreateParams, };
}
//# sourceMappingURL=live-view.d.ts.map