interface WidgetConfig {
    /**
     * The API key for this widget instance.
     * This is the Assistant ID that identifies which AI assistant to use.
     * Get this from your Workflowy dashboard after creating an assistant.
     */
    apiKey: string;
    /**
     * The Assistant ID that identifies which AI assistant to use.
     * @deprecated Use apiKey instead - they serve the same purpose.
     */
    assistantId?: string;
    /**
     * The base URL for the API.
     * Defaults to 'http://localhost:3000' in development.
     * Set to your production URL when deploying.
     */
    baseUrl?: string;
    /**
     * Optional user ID to identify the user across sessions.
     * If not provided, a random UUID will be generated.
     */
    userId?: string;
    /**
     * Enable debug logging in the console.
     */
    debug?: boolean;
    /**
     * User context from the integration platform (e.g., Thinkific).
     * Used to store user information in the database.
     */
    userContext?: {
        firstName?: string;
        lastName?: string;
        email?: string;
    };
    /**
     * Lesson context from the integration platform.
     * Used to display context pills for the current lesson.
     */
    lessonContext?: {
        lessonId: string;
        lessonTitle: string;
        chapterTitle?: string;
    };
}
interface Message {
    id: string;
    role: 'user' | 'assistant' | 'system';
    content: string;
    timestamp: number;
    metadata?: Record<string, unknown>;
}
interface ChatSession {
    id: string;
    /** The API key (Assistant ID) this session belongs to */
    apiKey: string;
    messages: Message[];
    createdAt: number;
}
interface Artifact {
    id: string;
    title: string;
    category: ArtifactCategory;
    content: string;
    createdAt: number;
    updatedAt: number;
}
type ArtifactCategory = 'audio' | 'audio-overview' | 'flashcards' | 'infographic' | 'mind-map' | 'quiz' | 'reports' | 'slide-deck' | 'video-overview';
type WidgetState = {
    status: 'idle';
} | {
    status: 'initializing';
} | {
    status: 'ready';
    session: ChatSession;
} | {
    status: 'loading';
} | {
    status: 'error';
    error: WidgetError;
};
interface WidgetError {
    code: string;
    message: string;
    details?: unknown;
}
type WidgetEvents = {
    'state:change': {
        previous: WidgetState;
        current: WidgetState;
    };
    'message:sent': {
        message: Message;
    };
    'message:received': {
        message: Message;
    };
    error: {
        error: WidgetError;
    };
    'session:created': {
        session: ChatSession;
    };
    'artifact:created': {
        artifact: Artifact;
    };
};

declare class WidgetAPI {
    private config;
    constructor(config: WidgetConfig);
    createSession(): Promise<ChatSession>;
    sendMessage(sessionId: string, content: string): Promise<Message>;
    getHistory(sessionId: string): Promise<Message[]>;
    getSessions(): Promise<ChatSession[]>;
    getArtifacts(): Promise<Artifact[]>;
    getArtifact(id: string): Promise<Artifact>;
    createArtifact(artifact: Omit<Artifact, 'id' | 'createdAt' | 'updatedAt'>): Promise<Artifact>;
    private request;
    private log;
}

declare class WidgetClient {
    private config;
    private state;
    private events;
    private api;
    constructor(config: WidgetConfig);
    /**
     * Initialize the widget and create a chat session
     */
    initialize(): Promise<void>;
    /**
     * Send a message to the AI assistant
     */
    sendMessage(content: string): Promise<Message>;
    /**
     * Get current state
     */
    getState(): WidgetState;
    /**
     * Get the API instance for direct calls
     */
    getAPI(): WidgetAPI;
    /**
     * Get the widget configuration
     */
    getConfig(): WidgetConfig;
    /**
     * Subscribe to events
     */
    on<K extends keyof WidgetEvents>(event: K, handler: (payload: WidgetEvents[K]) => void): () => void;
    /**
     * Unsubscribe from events
     */
    off<K extends keyof WidgetEvents>(event: K, handler: (payload: WidgetEvents[K]) => void): void;
    /**
     * Clean up resources
     */
    destroy(): void;
    private setState;
}

export { type Artifact as A, type ChatSession as C, type Message as M, WidgetClient as W, WidgetAPI as a, type WidgetConfig as b, type WidgetState as c, type WidgetEvents as d, type WidgetError as e, type ArtifactCategory as f };
