import * as Corti from "../../api/index.js"; import { TranscribeClient } from "../../api/resources/transcribe/client/Client.js"; import { type ProxyOptions } from "../utils/encodeHeadersAsWsProtocols.js"; import { CustomTranscribeSocket } from "./CustomTranscribeSocket.js"; export type CustomTranscribeConnectArgs = { /** When provided, connect() resolves after CONFIG_ACCEPTED or rejects on failure. */ configuration?: Corti.TranscribeConfig; /** * When true (default), connect() resolves after CONFIG_ACCEPTED or rejects on failure. * When false, returns socket immediately; config errors are dispatched as ErrorEvent. */ awaitConfiguration?: boolean; /** * When provided, bypasses normal URL construction and auth. The WebSocket connects * directly to proxy.url. Useful for proxy backends that handle auth themselves. */ proxy?: ProxyOptions; } & Partial>; export declare class CustomTranscribe extends TranscribeClient { private readonly _encodeHeadersAsWsProtocols; private readonly _analytics; constructor(options: TranscribeClient.Options & { encodeHeadersAsWsProtocols?: boolean; analytics?: Record; }); connect(args?: CustomTranscribeConnectArgs): Promise; /** * Sends configuration on open, then resolves after CONFIG_ACCEPTED. * Rejects and closes socket on CONFIG_DENIED / CONFIG_TIMEOUT / * connection error / ended. */ private _connectWithConfigAck; /** * Sends configuration on open and returns the socket immediately. * Config errors are dispatched as ErrorEvent and the socket is closed. */ private _connectWithConfigListeners; /** Resolves on CONFIG_ACCEPTED; rejects on rejection types, socket error, or ended. */ private _buildConfigAckPromise; }