import { ILiveAgentProvider, IStartChatOptions, ISendMessageOptions } from "../liveagent-types";
/**
 * Refactor the salesforce implementation with the Messaging for In-App and Web REST API instead of chatter
 */
export declare class SalesforceLiveAgentProvider implements ILiveAgentProvider {
    private configSettings;
    private sessionContext;
    private endpointSSE;
    private availabilityAbort?;
    constructor();
    /**
     * Authenticates with Salesforce MIAW and retrieves an access token.
     * This method should be called before starting a chat session.
     * @throws {Error} If authentication fails.
     * @returns {Promise<void>}
     * @memberof SalesforceLiveAgentProvider
     * @description This method sends a POST request to the Salesforce MIAW authorization endpoint to obtain an access token.
     * The access token is stored in the session context for subsequent API calls.
     */
    private authenticate;
    /**
     * Starts a new chat session with Salesforce Live Agent.
     * This method should be called after authentication to initiate a chat session.
     * @throws {Error} If starting the chat session fails.
     * @returns {Promise<void>}
     * @memberof SalesforceLiveAgentProvider
     * @description This method creates a new conversation in Salesforce and sets up the session context.
     * It emits a "liveAgentReady" event when the session is successfully started.
     */
    private startSession;
    checkAgentAvailability: (conversationId: string) => Promise<boolean>;
    /**
     * Initializes the Salesforce Live Agent provider and starts listening for messages.
     * This should be called after the user has authenticated and is ready to start a chat session.
     */
    initialize(startChatOptions: IStartChatOptions): Promise<void>;
    private parseMessageEntries;
    private handleParticipantChange;
    private mapEntriesToMessages;
    private handleParticipantMessage;
    private mapSenderRole;
    private handleSessionStatusChange;
    private listenToMessages;
    /** Interface Implementation */
    /**
     * @param startChatOptions
     * @description This method initializes the Salesforce Live Agent provider and starts a chat session.
     * It authenticates with Salesforce, starts a new conversation, and sets up the session context.
     * It emits a "liveAgentReady" event when the session is successfully started.
     * @throws {Error} If initialization fails.
     * @returns {Promise<void>}
     * @memberof SalesforceLiveAgentProvider
     *
     *
     */
    startChat(startChatOptions: IStartChatOptions): Promise<void>;
    /**
     * Resumes an existing live agent session using a stored access token and conversation ID.
     * Skips authentication and conversation creation — only reconnects the SSE listener.
     */
    resumeChat(startChatOptions: IStartChatOptions): Promise<void>;
    /**
     *
     * @param sendMessageOptions
     * @description This method sends a message to the Salesforce Live Agent.
     * It constructs a POST request to the Salesforce MIAW API to send the message.
     * @throws {Error} If sending the message fails.
     * @returns {Promise<void>}
     * @memberof SalesforceLiveAgentProvider
     *
     */
    sendMessage(sendMessageOptions: ISendMessageOptions): Promise<void>;
    /**
     *
     * @param _sessionId
     * @returns
     * @description This method polls for new messages in the Salesforce Live Agent conversation.
     * It sends a GET request to the Salesforce MIAW API to retrieve conversation entries.
     * It processes the entries and emits a "messageReceived" event with the new messages.
     * @throws {Error} If polling fails.
     * @returns {Promise<string[] | any>}
     * @memberof SalesforceLiveAgentProvider
     */
    pollMessages(_sessionId: string): Promise<string[] | any>;
    /**
     *
     * @param sessionId
     * @returns
     * @description This method checks if the chat session is active.
     * It checks the session context to determine if the session is active.
     */
    isChatActive(sessionId: string): Promise<boolean>;
    /**
     *
     * @param sessionId
     * @description This method ends the chat session with Salesforce Live Agent.
     * It sends a POST request to the Salesforce MIAW API to close the conversation.
     */
    endChat(_sessionId: string): Promise<void>;
    /**
     *
     * @param sessionId
     * @returns
     * @description This method retrieves the chat transcript for the given session ID.
     * It returns an array of messages from the session context.
     */
    getTranscript(sessionId: string): Promise<string[]>;
}
