export declare const TENCENT_API_HOST = "asr.tencentcloudapi.com"; export declare const TENCENT_API_VERSION = "2019-06-14"; export declare const TENCENT_API_SERVICE = "asr"; export declare const TENCENT_RECORDING_MAX_AUDIO_BYTES: number; export declare const TENCENT_REALTIME_HOST = "asr.cloud.tencent.com"; export declare const TENCENT_REALTIME_PATH = "/asr/v2"; export interface TencentRecordingAsrOptions { readonly audio: Uint8Array; readonly appId: string; readonly secretId: string; readonly secretKey: string; readonly engineType: string; readonly signal: AbortSignal; readonly fetch?: typeof globalThis.fetch; /** Injectable wall clock in milliseconds for deterministic tests. */ readonly now?: () => number; } export interface TencentRealtimeAsrOptions { readonly appId: string; readonly secretId: string; readonly secretKey: string; readonly engineType: string; readonly signal?: AbortSignal; readonly now?: () => number; readonly webSocketFactory?: (url: string) => TencentWebSocket; } export interface TencentRealtimeTranscript { readonly text: string; readonly final: boolean; } export interface TencentWebSocket { readonly readyState: number; binaryType: string; send(data: ArrayBuffer | ArrayBufferView | string): void; close(code?: number, reason?: string): void; addEventListener(type: string, listener: (event: TencentWebSocketEvent) => void): void; removeEventListener(type: string, listener: (event: TencentWebSocketEvent) => void): void; } interface TencentWebSocketEvent { readonly data?: unknown; readonly error?: unknown; readonly code?: number; readonly reason?: string; } export declare function tencentRecordingRequestBody(options: { audio: Uint8Array; engineType: string; }): Record; export declare function tencentApi3Signature(options: { action: string; body: string; secretId: string; secretKey: string; timestamp: number; host?: string; service?: string; }): string; export declare function tencentRealtimeQuery(options: { appId: string; secretId: string; secretKey: string; engineType: string; timestamp: number; voiceId?: string; nonce?: number; }): Record; export declare function tencentRealtimeUrl(options: { appId: string; secretId: string; secretKey: string; engineType: string; timestamp: number; voiceId?: string; nonce?: number; }): string; export declare function transcribeTencentCloudRecording(options: TencentRecordingAsrOptions): Promise; export declare class TencentRealtimeAsrSession { private readonly options; private socket; private opened; private closed; private ended; private final; private transcript; private interim; private readonly stableSentences; private lastError; private readonly messageWaiters; constructor(options: TencentRealtimeAsrOptions); open(): Promise; sendAudio(audio: Uint8Array, signal?: AbortSignal): Promise; finish(signal?: AbortSignal): Promise; snapshot(): TencentRealtimeTranscript; close(): void; private readonly onOpen; private readonly onMessage; private readonly onError; private readonly onClose; private setError; private rebuildTranscript; private requireSocket; private waitFor; private notifyWaiters; } export {};