/**
 * API Client for Widget Communication
 * Handles all HTTP requests to the widget API
 *
 * Note: No API key required - widget ID acts as the access token.
 * The widget ID should be kept confidential by the site owner.
 */
import { WidgetConfig, ConversationMessage } from '../types';
export interface ApiClientConfig {
    widgetId: string;
    apiUrl: string;
}
export declare class ApiError extends Error {
    status: number;
    details?: unknown;
    retryAfterMs?: number;
    constructor(message: string, status: number, options?: {
        details?: unknown;
        retryAfterMs?: number;
    });
}
export declare class WidgetApiClient {
    private config;
    private detectedTimeZone;
    constructor(config: ApiClientConfig);
    private static detectTimeZone;
    private getTimeZone;
    /**
     * Get widget configuration
     */
    getConfig(): Promise<WidgetConfig>;
    getOrCreateConversation(conversationId?: string): Promise<{
        id: string;
        messages: ConversationMessage[];
    }>;
    /**
     * Upload a file
     */
    uploadFile(conversationId: string, file: File): Promise<{
        id: string;
        filename: string;
        size: number;
    }>;
    /**
     * Send a chat message (standard RAG, no actions)
     * Returns ConversationMessage[] array
     */
    sendMessage(conversationId: string, message: string, fileIds?: string[]): Promise<ConversationMessage[]>;
    /**
     * Send a message to agent (with actions support)
     */
    sendAgentMessage(conversationId: string, message: string, fileIds?: string[]): Promise<any>;
    /**
     * Stream chat message responses
     */
    sendMessageStream(conversationId: string, message: string, fileIds?: string[]): AsyncGenerator<ConversationMessage>;
    /**
     * Stream agent message responses with tool execution
     * Handles streaming events from backend and yields ConversationMessage updates
     */
    sendAgentMessageStream(conversationId: string, message: string, fileIds?: string[]): AsyncGenerator<ConversationMessage>;
    /**
     * Submit feedback for a message
     */
    submitFeedback(sessionId: string, messageId: string, feedback: 'positive' | 'negative'): Promise<void>;
    /**
     * Validate widget access
     */
    validateAccess(): Promise<boolean>;
}
//# sourceMappingURL=client.d.ts.map