import { EventEmitter } from 'node:events'; import { type Logger } from 'zapo-js'; import { type BinaryNode } from 'zapo-js/transport'; import { type CallOfferOptions, EndCallReason, type WaVoipDeps, type WaVoipStores } from '../types.js'; import { CallInfo } from './call-state.js'; export interface WaCallManagerConfig { deps: WaVoipDeps; stores: WaVoipStores; logger?: Logger; maxConcurrentCalls?: number; useOriginalRelayPort?: boolean; } export declare class WaCallManager extends EventEmitter { private readonly deps; private readonly stores; private readonly logger; private readonly maxConcurrentCalls; private readonly useOriginalRelayPort; private readonly calls; constructor(config: WaCallManagerConfig); startCall(options: CallOfferOptions): Promise; acceptCall(callId: string): Promise; rejectCall(callId: string, reason?: EndCallReason): Promise; endCall(callId: string, reason?: EndCallReason): Promise; setMute(callId: string, muted: boolean): void; loadAudio(callId: string, audioPath: string): Promise; setExternalAudioMode(callId: string, enabled: boolean): void; feedLiveAudio(callId: string, data: Float32Array): number; feedLiveVideo(callId: string, data: Uint8Array, timestampUs: number): number; getLiveBufferMs(callId: string): number; getFeedWatermarksMs(): { pauseMs: number; resumeMs: number; }; getCall(callId: string): CallInfo | null; getCalls(): readonly CallInfo[]; handleCallOffer(node: BinaryNode, peerJid: string): Promise; handleCallAccept(node: BinaryNode, peerJid: string): Promise; handleCallPreaccept(node: BinaryNode, peerJid: string): Promise; handleCallTransport(node: BinaryNode, peerJid: string): Promise; handleCallAck(node: BinaryNode): Promise; handleCallRelaylatency(node: BinaryNode, peerJid: string): Promise; handleRelayElection(node: BinaryNode): void; handleCallMuteV2(node: BinaryNode, peerJid: string): Promise; handleCallTerminate(node: BinaryNode, peerJid?: string): Promise; destroy(): void; private get activeCallCount(); private createSession; private getSessionOrThrow; private resolveSessionFromNode; private resolveSessionForOfferAck; private emitState; private resolvePeerLid; private resolvePeerDeviceJids; private maybeUnblockWaitingCalls; private activateWaitingIncoming; }