import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs'; import { DefaultError, QueryClient, QueryFunction, ThrowOnError } from '@tanstack/query-core'; type MAXIMUM_DEPTH = 20; type SkipTokenForUseQueries = symbol; type GetUseSuspenseQueryOptions = T extends { queryFnData: infer TQueryFnData; error?: infer TError; data: infer TData; } ? UseSuspenseQueryOptions : T extends { queryFnData: infer TQueryFnData; error?: infer TError; } ? UseSuspenseQueryOptions : T extends { data: infer TData; error?: infer TError; } ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError, infer TData] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryOptions : T extends [infer TQueryFnData] ? UseSuspenseQueryOptions : T extends { queryFn?: QueryFunction | SkipTokenForUseQueries; select?: (data: any) => infer TData; throwOnError?: ThrowOnError; } ? UseSuspenseQueryOptions : T extends { queryFn?: QueryFunction | SkipTokenForUseQueries; throwOnError?: ThrowOnError; } ? UseSuspenseQueryOptions : UseSuspenseQueryOptions; type GetUseSuspenseQueryResult = T extends { queryFnData: any; error?: infer TError; data: infer TData; } ? UseSuspenseQueryResult : T extends { queryFnData: infer TQueryFnData; error?: infer TError; } ? UseSuspenseQueryResult : T extends { data: infer TData; error?: infer TError; } ? UseSuspenseQueryResult : T extends [any, infer TError, infer TData] ? UseSuspenseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseSuspenseQueryResult : T extends [infer TQueryFnData] ? UseSuspenseQueryResult : T extends { queryFn?: QueryFunction | SkipTokenForUseQueries; select?: (data: any) => infer TData; throwOnError?: ThrowOnError; } ? UseSuspenseQueryResult : T extends { queryFn?: QueryFunction | SkipTokenForUseQueries; throwOnError?: ThrowOnError; } ? UseSuspenseQueryResult : UseSuspenseQueryResult; /** * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param */ type SuspenseQueriesOptions, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryOptions] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesOptions<[ ...Tails ], [ ...TResults, GetUseSuspenseQueryOptions ], [ ...TDepth, 1 ]> : Array extends T ? T : T extends Array> ? Array> : Array; /** * SuspenseQueriesResults reducer recursively maps type param to results */ type SuspenseQueriesResults, TResults extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResults, GetUseSuspenseQueryResult] : T extends [infer Head, ...infer Tails] ? SuspenseQueriesResults<[ ...Tails ], [ ...TResults, GetUseSuspenseQueryResult ], [ ...TDepth, 1 ]> : T extends Array> ? Array> : Array; declare function useSuspenseQueries, TCombinedResult = SuspenseQueriesResults>(options: { queries: readonly [...SuspenseQueriesOptions]; combine?: (result: SuspenseQueriesResults) => TCombinedResult; }, queryClient?: QueryClient): TCombinedResult; export { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries };