/**
* Thread List Query Hook
*
* React Query hook for fetching a list of threads.
*/
import type { UseQueryOptions } from "@tanstack/react-query";
import type { ThreadListParams, ThreadListResponse } from "@tambo-ai/typescript-sdk/resources/threads/threads";
/**
* Options for fetching thread list.
* Re-exported from SDK for convenience.
* Note: userKey can also be provided via TamboProvider context.
*/
export type { ThreadListParams as ThreadListOptions };
/**
* Hook to fetch a list of threads.
*
* Uses React Query for caching and automatic refetching.
* Threads are considered stale after 5 seconds.
*
* Returns the thread list directly from the SDK with no transformation.
* Each thread includes runStatus, metadata, and all SDK fields.
* @param listOptions - Filtering and pagination options
* @param queryOptions - Additional React Query options
* @returns React Query query object with thread list
* @example
* ```tsx
* function ThreadList({ userKey }: { userKey?: string }) {
* const { data, isLoading, isError } = useTamboThreadList({
* userKey,
* limit: 20,
* });
*
* if (isLoading) return