import React from "react";
import type { AdvancedTab } from "../../utils/data/advanced-tab";
import { ChatStatus } from "@web-utils/features";
import { FileReference } from "../../types/file-upload";
import { Error402MessageData } from "@web-utils/types";
type MessageActionTypes = "redirectToAuthSpaJoinTenant";
export interface MessageAction {
    text: string;
    type: "primary" | "danger";
    actionType: MessageActionTypes;
}
export interface FileAttachment {
    fileName: string;
    fileType: string;
    fileSize: number;
    uploadUrl?: string;
    fileId?: string;
}
export interface ArtifactData {
    id: number;
    title: string;
    content: string;
    file_extension: string;
    llm_name?: string;
    llm_provider?: string;
    date_created: string;
    date_updated: string;
    metadata?: Record<string, unknown>;
    username?: string;
    session_id?: string;
    current_version_number?: number;
    version_count?: number;
}
export interface ArtifactVersion {
    id: number;
    artifact: ArtifactData;
    title: string;
    content: string;
    session_id?: string;
    content_length?: number;
    is_current: boolean;
    is_partial?: boolean;
    chat_message?: number;
    version_number: number;
    date_created: string;
    created_by?: string;
    change_summary?: string;
}
export interface Message {
    id: string;
    role: "user" | "assistant" | "system";
    content: string;
    timestamp: string;
    url?: string;
    fileType?: string;
    contentType?: string;
    visible: boolean;
    actions?: MessageAction[];
    fileAttachments?: FileAttachment[];
    artifactVersions?: ArtifactVersion[];
}
export type ArtifactPayload = {
    title: string;
    file_extension: string;
    id: string;
    is_partial?: boolean;
    snippet_start?: number;
    snippet_end?: number;
};
export type SendMessageOptions = {
    visible?: boolean;
    fileReferences?: FileReference[];
    artifact?: ArtifactPayload;
} | undefined;
export interface OAuthRequiredData {
    serverName: string;
    serverId: number;
    authUrl: string;
    message: string;
}
export interface OAuthResolvedData {
    serverName: string;
    serverId: number;
    message: string;
}
export interface UseChatProps {
    wsUrl: string;
    wsToken: string;
    flowConfig: {
        name: string;
        tenant: string;
        username: string;
        pathway: string;
    };
    sessionId: string;
    stopGenerationWsUrl: string;
    activeTab: AdvancedTab;
    enableHaptics?: boolean;
    hapticFeedback?: {
        impactAsync: (style: any) => Promise<void>;
    };
    redirectToAuthSpa: (redirectTo?: string, platformKey?: string, logout?: boolean) => void;
    store?: {
        sendMessage?: (text: string) => Promise<void>;
    };
    WebSocketImpl?: typeof WebSocket;
    errorHandler?: (message: string, error?: any) => void;
    onStatusChange: (status: ChatStatus) => void;
    onStreamingChange: (streaming: boolean) => void;
    onStreamingMessageUpdate: (message: {
        id: string | null;
        content: string;
    }) => void;
    onAddUserMessage?: (activeTab: AdvancedTab, message: Message) => void;
    sendMessageToParentWebsite?: (payload: unknown) => void;
    on402Error?: (message: Error402MessageData) => void;
    onOAuthRequired?: (data: OAuthRequiredData) => void;
    onOAuthResolved?: (data: OAuthResolvedData) => void;
    onOfflineWithoutLocalLLM?: () => void;
    isOffline?: boolean;
}
export interface UseChatReturn {
    sendMessage: (tab: AdvancedTab, text: string, options?: SendMessageOptions) => Promise<void>;
    ws: React.MutableRefObject<WebSocket | null>;
    isConnected: React.MutableRefObject<boolean>;
    messageQueue: React.MutableRefObject<any[]>;
    stopGenerating: () => void;
    resetConnection: () => void;
}
export declare const useChat: ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, enableHaptics, hapticFeedback, store, errorHandler, onStatusChange, onStreamingChange, onStreamingMessageUpdate, WebSocketImpl, redirectToAuthSpa, sendMessageToParentWebsite, on402Error, onOAuthRequired, onOAuthResolved, onOfflineWithoutLocalLLM, isOffline, }: UseChatProps) => UseChatReturn;
export {};
