export interface ChatThreadScope { type: string; id: string; label?: string; /** Composer context key used by ambient resource context adapters. */ contextKey?: string; } export interface ChatThreadSummary { id: string; title: string; preview: string; messageCount: number; createdAt: number; updatedAt: number; scope: ChatThreadScope | null; pinnedAt?: number | null; archivedAt?: number | null; } export interface ChatThreadData { id: string; ownerEmail: string; title: string; preview: string; threadData: string; messageCount: number; createdAt: number; updatedAt: number; scope: ChatThreadScope | null; pinnedAt?: number | null; archivedAt?: number | null; } export interface ChatThreadSnapshot { threadData: string; title: string; preview: string; messageCount: number; } export interface ChatThreadShareState { enabled: boolean; createdAt: number | null; updatedAt: number | null; revokedAt: number | null; } export interface ChatThreadShareLink extends ChatThreadShareState { token?: string; url: string; } type ThreadTitleSource = "generated" | "extracted"; export interface UseChatThreadsOptions { /** Create an optimistic empty thread on mount when no active thread exists. */ autoCreate?: boolean; /** Restore the active thread from localStorage. Defaults to true. */ restoreActiveThread?: boolean; /** * Route-owned active thread. `undefined` preserves the legacy localStorage * source of truth; a string opens that thread; `null` means the URL is in * create/new-chat mode. */ routeThreadId?: string | null; } export declare function useChatThreads(apiUrl?: string, storageKey?: string, scope?: ChatThreadScope | null, options?: UseChatThreadsOptions): { threads: ChatThreadSummary[]; activeThreadId: string | null; isLoading: boolean; createThread: (preferredId?: string) => Promise; switchThread: (id: string) => void; deleteThread: (id: string) => Promise; detachThread: (threadId: string) => Promise; pinThread: (threadId: string, pinned: boolean) => Promise; archiveThread: (threadId: string) => Promise; renameThread: (threadId: string, title: string) => Promise; forkThread: (sourceId: string, sourceSnapshot?: ChatThreadSnapshot | null) => Promise; saveThreadData: (id: string, data: { threadData: string; title: string; preview: string; messageCount?: number; titleSource?: ThreadTitleSource; }) => Promise; generateTitle: (threadId: string, message: string) => Promise; searchThreads: (query: string) => Promise; loadMoreThreads: () => Promise; getThreadShareState: (threadId: string) => Promise; createThreadShareLink: (threadId: string) => Promise; revokeThreadShareLink: (threadId: string) => Promise; refreshThreads: () => void; hasMoreThreads: boolean; isLoadingMoreThreads: boolean; threadsLoadError: string | null; isNewThread: (id: string) => boolean; }; export {}; //# sourceMappingURL=use-chat-threads.d.ts.map