import { Thread } from '@langchain/langgraph-sdk';
import { Dispatch, ReactNode, SetStateAction } from 'react';
/**
 * Thread context manages the current conversation thread ID and configuration.
 * A thread represents a single conversation session with the AI.
 */
export type ThreadMode = "single" | "multi";
/**
 * Typed configuration object passed to the LangGraph API on each stream call.
 * Use `Record<string, unknown>` instead of `any` so consumers are forced to
 * narrow values before using them, preventing silent runtime errors.
 */
export type ThreadConfiguration = Record<string, unknown>;
export interface ThreadContextType {
    /** Current thread ID, null if no thread exists yet */
    threadId: string | null;
    /** Set or update the current thread ID */
    setThreadId: (id: string | null) => void;
    /** List of existing threads */
    threads: Thread[];
    /** Function to fetch existing threads from the API */
    getThreads: () => Promise<Thread[]>;
    /** Function to update the list of threads */
    setThreads: Dispatch<SetStateAction<Thread[]>>;
    /** Thread-specific configuration passed to the LangGraph API */
    configuration: ThreadConfiguration | undefined;
    /** Update thread configuration */
    setConfiguration: (config: ThreadConfiguration) => void;
    /** Whether threads are currently being loaded */
    threadsLoading: boolean;
    /** Set the loading state for threads */
    setThreadsLoading: Dispatch<SetStateAction<boolean>>;
    mode: ThreadMode;
    setMode: Dispatch<SetStateAction<ThreadMode>>;
    /** Delete a thread by ID */
    deleteThread: (threadId: string) => Promise<void>;
    /** Update thread metadata */
    updateThread: (threadId: string, metadata: Record<string, unknown>) => Promise<void>;
}
/**
 * Provides thread management for chat conversations.
 * Stores the current thread ID and configuration.
 *
 * @example
 * ```tsx
 * <ThreadProvider>
 *   <YourChatComponent />
 * </ThreadProvider>
 * ```
 */
export declare function ThreadProvider({ children, initialMode }: {
    children: ReactNode;
    initialMode?: ThreadMode;
}): import("react/jsx-runtime").JSX.Element;
/**
 * Hook to access the current thread context.
 * Use this to get or set the thread ID and configuration.
 *
 * @throws {Error} If used outside of ThreadProvider
 *
 * @example
 * ```tsx
 * const { threadId, setThreadId, configuration, setConfiguration } = useThread();
 * ```
 */
export declare function useThread(): ThreadContextType;
//# sourceMappingURL=Thread.d.ts.map