import { UiTraceRecord } from "./uiTrace.mjs"; //#region src/web/lib/browserTelemetry.d.ts export type BrowserPerformanceEventName = 'web.browser.ready' | 'web.browser.protocol_ready' | 'web.browser.session_socket_ready' | 'web.browser.reconnect' | 'web.browser.update_required' | 'web.browser.backlog' | 'web.browser.transcript_page' | 'web.browser.transcript_render' | 'web.browser.telemetry_drop'; type BrowserErrorSource = 'window_error' | 'unhandled_rejection' | 'session_socket'; export interface BrowserPerformanceEvent { name: BrowserPerformanceEventName; duration_ms?: number; count?: number; } /** * Stops browser telemetry for this page: queued events are dropped and new ones are ignored. A page with no * Po host behind it to receive them (a self-hosted Worker's shell) calls this before anything records. */ export declare function disableBrowserTelemetry(): void; export declare function browserReadyDuration(): number; export declare function recordBrowserPerformance(event: BrowserPerformanceEvent): void; /** The `uiTrace` sink for the cockpit: each rollup rides the same batched, capped queue. */ export declare function recordBrowserUiTrace(records: readonly UiTraceRecord[]): void; export declare function recordBrowserError(source: BrowserErrorSource, thrown: unknown, sessionId?: string | null): void; interface ErrorReportingOptions { target?: EventTarget; sessionId?: () => string | null; } /** * Reports what the cockpit throws, so a view that dies stops dying silently. * * React re-throws an uncaught render failure through `reportError`, so the * window listener covers the timeline going blank as well as ordinary async * throws. The reports are queued through the same batch, backoff, and drop * counter as performance events; a page that is failing repeatedly must not * turn into a request loop. */ export declare function installBrowserErrorReporting(options?: ErrorReportingOptions): () => void; export declare function flushBrowserTelemetry(): Promise; //#endregion export {}; //# sourceMappingURL=browserTelemetry.d.mts.map