import { type CortiAuth, CortiClient } from "@corti/sdk"; import type { ReactiveController, ReactiveControllerHost } from "lit"; import type { ProxyOptions } from "../types.js"; export interface SocketControllerHost extends ReactiveControllerHost { dispatchEvent: (event: Event) => void; _accessToken?: string; _analytics?: Record; _authConfig?: CortiAuth.AuthTokenDerivable; _region?: string; _tenantName?: string; _socketUrl?: string; _socketProxy?: ProxyOptions; } export type SocketControllerWebSocket = { readyState: number; close(): void; on(event: "message", handler: (message: { type: string; }) => void): void; on(event: "error", handler: (error: Error) => void): void; on(event: "close", handler: (event: unknown) => void): void; send(data: Blob | ArrayBufferLike | string): void; sendEnd(message: { type: "end"; }): void; }; export type SocketControllerCallbacks = { onMessage?: (message: TMessage) => void; onError?: (error: Error) => void; onClose?: (event: unknown) => void; onNetworkActivity?: (direction: "sent" | "received", data: unknown) => void; }; export type SocketControllerOutboundItem = Blob | { type: string; }; export declare abstract class SocketController implements ReactiveController { #private; readonly host: SocketControllerHost; protected abstract _connectThroughProxy(config: TConfig, proxy: ProxyOptions): Promise; protected abstract _connectThroughAuth(client: CortiClient, config: TConfig): Promise; constructor(host: SocketControllerHost); connect(config: TConfig, callbacks: SocketControllerCallbacks): Promise; hostDisconnected(): void; isConnectionOpen(): boolean; isConnecting(): boolean; waitForConnection(): Promise; mediaRecorderHandler: (data: Blob) => void; pause(): Promise; stopRecording(): Promise; closeConnection(onClose?: (event: unknown) => void): Promise; cleanup(): void; }