import { ChatAdapter, ChatSDKMessage, GetAgentAvailabilityResponse, GetLiveChatTranscriptResponse, GetPersistentChatHistoryResponse, GetVoiceVideoCallingResponse, IFileInfo, IRawMessage, MaskingRules, OmnichannelChatSDK, VoiceVideoCallingOptionalParams } from "@microsoft/omnichannel-chat-sdk"; import { IFacadeChatSDKInput } from "./types/IFacadeChatSDKInput"; import ChatAdapterOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/messaging/ChatAdapterOptionalParams"; import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig"; import ChatReconnectContext from "@microsoft/omnichannel-chat-sdk/lib/core/ChatReconnectContext"; import ChatReconnectOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/ChatReconnectOptionalParams"; import ChatTranscriptBody from "@microsoft/omnichannel-chat-sdk/lib/core/ChatTranscriptBody"; import EmailLiveChatTranscriptOptionaParams from "@microsoft/omnichannel-chat-sdk/lib/core/EmailLiveChatTranscriptOptionalParams"; import EndChatOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/EndChatOptionalParams"; import FileMetadata from "@microsoft/omnichannel-amsclient/lib/FileMetadata"; import GetAgentAvailabilityOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetAgentAvailabilityOptionalParams"; import GetChatTokenOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetChatTokenOptionalParams"; import GetConversationDetailsOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetConversationDetailsOptionalParams"; import GetLiveChatConfigOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetLiveChatConfigOptionalParams"; import GetLiveChatTranscriptOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetLiveChatTranscriptOptionalParams"; import GetPersistentChatHistoryOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetPersistentChatHistoryOptionalParams"; import IChatToken from "@microsoft/omnichannel-chat-sdk/lib/external/IC3Adapter/IChatToken"; import IFileMetadata from "@microsoft/omnichannel-ic3core/lib/model/IFileMetadata"; import IMessage from "@microsoft/omnichannel-ic3core/lib/model/IMessage"; import IRawThread from "@microsoft/omnichannel-ic3core/lib/interfaces/IRawThread"; import InitializeOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/InitializeOptionalParams"; import LiveWorkItemDetails from "@microsoft/omnichannel-chat-sdk/lib/core/LiveWorkItemDetails"; import OmnichannelMessage from "@microsoft/omnichannel-chat-sdk/lib/core/messaging/OmnichannelMessage"; import OnNewMessageOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/messaging/OnNewMessageOptionalParams"; import { ParticipantsRemovedEvent } from "@azure/communication-signaling"; import PostChatContext from "@microsoft/omnichannel-chat-sdk/lib/core/PostChatContext"; import StartChatOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/StartChatOptionalParams"; export declare class FacadeChatSDK { private chatSDK; private chatConfig; private token; private expiration; private isAuthenticated; private getAuthToken?; private sdkMocked; private disableReauthentication; private pendingMidAuthUnauthenticatedState; isSDKMocked(): boolean; getChatSDK(): OmnichannelChatSDK; destroy(): void; isTokenSet(): boolean; constructor(input: IFacadeChatSDKInput, disableReauthentication: boolean); private convertExpiration; private isTokenExpired; private enforceBase64Encoding; private extractExpFromToken; private setToken; private corroborateTokenIsSet; private tokenRing; /** * Sets unauthenticated state for mid-auth flow. * Clears SDK internal state to prevent reconnection to previous authenticated session. */ private setMidAuthUnauthenticatedState; /** Clears authentication state in both FacadeChatSDK and underlying SDK */ private clearAuthState; /** * Migrates conversation from unauthenticated to authenticated via authenticateChat. * Called after startChat() when user has a valid token but the backend conversation * was started as unauthenticated. */ private migrateConversationToAuthenticated; /** * Configures SDK auth state before startChat. * CASE 1: Pending unauthenticated (no token) - sets deferInitialAuth=true * CASE 2: Authenticated with valid token - sets SDK token and deferInitialAuth based on scenario */ private configureMidAuthState; /** * CASE 1 handler: Returns true if reconnect params should be cleared (Auth -> Unauth transition) */ private handlePendingUnauthenticatedState; /** * CASE 2 handler: Sets deferInitialAuth only for reconnects to unauthenticated sessions (need migration). * For new chats or reconnects to authenticated sessions, SDK handles auth internally. */ private handleAuthenticatedState; private validateAndExecuteCall; initialize(optionalParams?: InitializeOptionalParams): Promise; getChatReconnectContext(optionalParams?: ChatReconnectOptionalParams): Promise; startChat(optionalParams?: StartChatOptionalParams): Promise; endChat(optionalParams?: EndChatOptionalParams): Promise; getCurrentLiveChatContext(): Promise; getConversationDetails(optionalParams?: GetConversationDetailsOptionalParams): Promise; getPreChatSurvey(parse?: boolean): Promise; getLiveChatConfig(optionalParams?: GetLiveChatConfigOptionalParams): Promise; getChatToken(cached?: boolean, optionalParams?: GetChatTokenOptionalParams): Promise; getCallingToken(): Promise; getMessages(): Promise; getDataMaskingRules(): Promise; sendMessage(message: ChatSDKMessage): Promise; onNewMessage(onNewMessageCallback: CallableFunction, optionalParams?: OnNewMessageOptionalParams): Promise; sendTypingEvent(): Promise; onTypingEvent(onTypingEventCallback: CallableFunction): Promise; onAgentEndSession(onAgentEndSessionCallback: (message: IRawThread | ParticipantsRemovedEvent) => void): Promise; uploadFileAttachment(fileInfo: IFileInfo | File): Promise; downloadFileAttachment(fileMetadata: FileMetadata | IFileMetadata): Promise; emailLiveChatTranscript(body: ChatTranscriptBody, optionalParams?: EmailLiveChatTranscriptOptionaParams): Promise; getLiveChatTranscript(optionalParams?: GetLiveChatTranscriptOptionalParams): Promise; createChatAdapter(optionalParams?: ChatAdapterOptionalParams): Promise; isVoiceVideoCallingEnabled(): Promise; getVoiceVideoCalling(params?: VoiceVideoCallingOptionalParams): Promise; getPostChatSurveyContext(): Promise; getAgentAvailability(optionalParams?: GetAgentAvailabilityOptionalParams): Promise; getReconnectableChats(reconnectableChatsParams?: any): Promise; fetchPersistentConversationHistory(getPersistentChatHistoryOptionalParams?: GetPersistentChatHistoryOptionalParams): Promise; }