import { Observable } from "rxjs"; import { DeviceConnectionStatus, EventInfoWithConversationId, HeadsetEvents, HoldEventInfo, MutedEventInfo, VendorImplementation, WebHidPermissionRequest } from "softphone-vendor-headsets"; export type OrchestrationState = 'notStarted' | 'negotiating' | 'alternativeClient' | 'hasControls'; export type ExpandedDeviceConnectionStatus = DeviceConnectionStatus | OrchestrationState; type Events = { [HeadsetEvents.implementationChanged]: VendorImplementation; [HeadsetEvents.deviceHoldStatusChanged]: HoldEventInfo; [HeadsetEvents.deviceMuteStatusChanged]: MutedEventInfo; [HeadsetEvents.deviceAnsweredCall]: EventInfoWithConversationId; [HeadsetEvents.deviceEndedCall]: EventInfoWithConversationId; [HeadsetEvents.deviceRejectedCall]: EventInfoWithConversationId; [HeadsetEvents.loggableEvent]: unknown; [HeadsetEvents.webHidPermissionRequested]: WebHidPermissionRequest; [HeadsetEvents.deviceConnectionStatusChanged]: ExpandedDeviceConnectionStatus; }; export type ExpandedConsumedHeadsetEvents = T extends keyof Events ? { event: T; payload: Events[T]; } : never; export interface ISdkHeadsetService { headsetEvents$: Observable; currentSelectedImplementation: VendorImplementation; updateAudioInputDevice(newMicId: string): void; showRetry(): boolean; retryConnection(micLabel: string): Promise; setRinging(callInfo: { conversationId: string; contactName?: string; }, hasOtherActiveCalls: boolean): Promise; outgoingCall(callInfo: { conversationId: string; contactName?: string; }): Promise; endCurrentCall(conversationId: string, hasOtherActiveCalls: boolean): Promise; endAllCalls(): Promise; answerIncomingCall(conversationId: string, autoAnswer: boolean): Promise; rejectIncomingCall(conversationId: string, expectExistingConversation?: boolean): Promise; setMute(isMuted: boolean): Promise; setHold(conversationId: string, isHeld: boolean): Promise; resetHeadsetStateForCall(conversationId: string): Promise; } export {};