import { WidgetConfig, ConversationMessage, StreamEvent, JsonValue, FollowUpSuggestion } from '../types';
export interface ApiClientConfig {
    widgetId: string;
    apiUrl: string;
    currentRoute?: 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;
    }>;
    sendAgentMessageStream(conversationId: string, message: string, fileIds?: string[], signal?: AbortSignal): AsyncGenerator<StreamEvent>;
    dismissAgentMessageStream(conversationId: string, toolCallId: string, signal?: AbortSignal): AsyncGenerator<StreamEvent>;
    /**
     * Continue agent after halting action completes
     * Call this when frontend completes an action and wants to pass result back to agent
     */
    continueAgentAction(conversationId: string, toolCallId: string, body: Record<string, JsonValue>, signal?: AbortSignal): AsyncGenerator<StreamEvent>;
    /**
     * NEW: Call action endpoint (frontend-owned flow)
     * Used for multi-step actions like booking appointments
     */
    callActionEndpoint<T = unknown>(actionId: string, endpoint: string, input: Record<string, unknown>, token?: string): Promise<T>;
    /**
     * Submit feedback for a message
     */
    submitFeedback(sessionId: string, messageId: string, feedback: 'positive' | 'negative', meta?: {
        role?: string;
        content?: string;
        timestamp?: string;
    }): Promise<void>;
    /**
     * Generate follow-up suggestions based on conversation context and available actions.
     * @deprecated Follow-ups are now generated server-side in parallel and included in the done event.
     * This method is kept for backwards compatibility but is no longer called by the widget.
     */
    generateFollowUps(messages: ConversationMessage[], actionIds: string[]): Promise<FollowUpSuggestion[]>;
    /**
     * Create a demo conversation with preset messages
     * Used when demo animation completes to persist the demo conversation to the database
     */
    createDemoConversation(userMessage: string, assistantMessage: string): Promise<{
        id: string;
        success: boolean;
    }>;
    /**
     * Validate widget access
     */
    validateAccess(): Promise<boolean>;
}
//# sourceMappingURL=client.d.ts.map