import ' rollup-plugin-inject-process-env';
import { UserInfo, WidgetConfigurableMessagesConfig, WidgetHooks, WidgetEnv } from "@xapp/stentor-chat-widget";
import { ActionType } from "../store/ChatAction";
import { ChatMessageRequest, ChatServerMessage } from "./ChatServerMessage";
export interface ChatServer {
    init(dispatch: (action: ActionType) => void): void;
    sendOfflineMsg(message: OfflineMessage, cb: (error?: Error) => void): void;
    sendChatMsg(message: ChatServerMessage, cb: (err?: Error) => void): void;
    sendChatMsgRequest(message: ChatMessageRequest, cb: (err?: Error) => void): void;
    /**
     * Sets if the bot is typing or not.  A typing indicator will appear in the UI.
     * @param isTyping True if typing, false if not.
     */
    sendTyping(isTyping: boolean): void;
    /**
     * Sets who the visitor is (userId, accessToken, attributes)
     *
     * This data is then used on the requests to the server.
     *
     * Developer Note: This same information can be found on the redux state, it is only pulled from there once in the beginning.
     *
     * @param visitorInfo
     * @param cb
     */
    setVisitorInfo(visitorInfo: VisitorInfoMessage, sessionId: string, cb: (error?: Error) => void): void;
    sendChatRating(rating?: "bad" | "good"): void;
    sendFile(file: File, cb: (err?: Error) => void): void;
    markAsRead(): void;
    flush(): void;
    dispose(): void;
    sleep(): void;
    wakeup(): void;
    bargeOut(arg0: (err?: Error) => void): unknown;
    bargeIn(agentName: string, arg1: (err?: Error) => void): unknown;
    sendButtonPressed?(buttonId: string): Promise<void>;
    /**
     * Notifies the server that the user is disconnecting (e.g., closing tab, navigating away).
     * This is a best-effort notification - it may not arrive before the page unloads.
     * Should be called from a beforeunload event handler or when the user closes the widget.
     * @param reason - "close_tab" for beforeunload, "widget_close" for explicit widget close
     */
    notifyDisconnecting?(reason?: "close_tab" | "widget_close"): void;
}
export interface ChatServerOptions {
    readonly token?: string;
    readonly bot?: UserInfo;
    readonly hooks?: WidgetHooks;
    readonly configurableMessages?: WidgetConfigurableMessagesConfig;
    readonly env?: WidgetEnv;
}
export interface OfflineMessage {
    readonly name: string;
    readonly email: string;
    readonly message: string;
}
/**
 * The visitor is on person on the browser, talking to either the bot or the live agent.
 */
export interface VisitorInfoMessage {
    /**
     * Admin i.e. human agent watching type
     */
    readonly isAdmin?: boolean;
    /**
     * Visitors name
     */
    readonly name?: string;
    /**
     * Visitor's display name
     */
    readonly displayName?: string;
    /**
     * The email of the visitor
     */
    email?: string;
    /**
     * Visitors access token
     */
    readonly accessToken?: string;
    /**
     * User ID of the visitor
     */
    readonly userId?: string;
    /**
     * Visitor's ID, can also be userId
     *
     * @deprecated - Use userId
     */
    readonly visitorId?: string;
    /**
     * Optional request attributes.
     */
    readonly attributes?: Record<string, any>;
}
