import type { ArkmeOutgoingCallMediaType } from '../outgoing-call-contract.js'; import type { ArkmePluginOperation } from '../types.js'; import { requestDesktopCallMediaPermissions, type DesktopCallBridgeEvent } from './outgoing-call-bridge.js'; import { type OutgoingCallUiController } from './outgoing-call-ui-controller.js'; export type OutgoingCallPhase = 'idle' | 'listening' | 'incoming' | 'preparing' | 'bootstrapping' | 'calling' | 'active' | 'ending' | 'error'; export interface OutgoingCallRuntimeSnapshot { visible: boolean; retainFrame: boolean; phase: OutgoingCallPhase; assetBasePath: string; callRequestId: string; displayName: string; mediaType: ArkmeOutgoingCallMediaType; statusText: string; error: string; compact: boolean; fullscreen: boolean; } type ApiCall = (operation: ArkmePluginOperation | 'calls.outgoing.diag', params?: Record) => Promise; export interface OutgoingCallRuntimeOptions { api?: ApiCall; controller?: OutgoingCallUiController; randomId?: () => string; origin?: () => string; currentAvatar?: (imageRef: string) => string | undefined; loadAvatar?: (imageRef: string) => Promise; permissions?: typeof requestDesktopCallMediaPermissions; setInterval?: typeof globalThis.setInterval; clearInterval?: typeof globalThis.clearInterval; setTimeout?: typeof globalThis.setTimeout; clearTimeout?: typeof globalThis.clearTimeout; } export declare class OutgoingCallRuntime { private readonly api; private readonly controller; private readonly randomId; private readonly origin; private readonly currentAvatar; private readonly loadAvatar; private readonly permissions; private readonly startInterval; private readonly stopInterval; private readonly startTimeout; private readonly stopTimeout; private listeners; private snapshot; private frame; private prepared; private intent; private leaseCallRequestId; private bootstrapSent; private callSent; private generation; private pollTimer; private heartbeatTimer; private callStartFallbackTimer; private unsubscribeController; private claiming; private claimEpoch; private receiverUserId; private receiverScope; private receiverBootstrap; private receiverReady; private receiverError; private receiverRetryTimer; private receiverBootTimer; private unregisterReceiver; configureReceiver(userId: number | undefined, scope?: string): void; private clearReceiverTimers; private startReceiver; private receiverFailed; private ensureReceiver; private receiveIncoming; constructor(options?: OutgoingCallRuntimeOptions); readonly subscribe: (listener: () => void) => (() => void); readonly getSnapshot: () => OutgoingCallRuntimeSnapshot; configure(assetBasePath: string): void; mount(): void; attachFrame(frame: HTMLIFrameElement | null): void; handleWindowMessage(event: MessageEvent): void; handleBridgeMessage(message: DesktopCallBridgeEvent): void; pollToolIntent(): Promise; cancel(): void; dispose(): void; private start; private flushBootstrap; private flushCall; private resolvePermissions; private startHeartbeat; private scheduleCallStartFallback; private clearCallStartFallback; private resolveIntentCalling; private fail; private finishTerminal; private hideTerminalOverlay; private scheduleFinish; private finish; private releaseLease; private update; private callApi; private diag; private postHostDiag; private sanitizeParams; } export {}; //# sourceMappingURL=outgoing-call-runtime.d.ts.map