import { DefaultError, QueryKey, OmitKeyof, QueryObserverOptions as QueryObserverOptions$1, InfiniteQueryObserverOptions as InfiniteQueryObserverOptions$1, DefaultOptions as DefaultOptions$1, QueryClient as QueryClient$1, QueryClientConfig as QueryClientConfig$1, Override, MutationObserverResult, MutateFunction, QueryObserverResult, InfiniteQueryObserverResult, MutationObserverOptions, DefinedQueryObserverResult, DefinedInfiniteQueryObserverResult, DataTag, InfiniteData, NonUndefinedGuard, QueryFunction, ThrowOnError, QueriesPlaceholderDataFunction, QueryFilters, WithRequired, MutationFilters, MutationState, Mutation } from '@tanstack/query-core'; export * from '@tanstack/query-core'; import * as solid_js from 'solid-js'; import { Accessor, JSX } from 'solid-js'; interface QueryObserverOptions extends OmitKeyof, 'structuralSharing'> { /** * Set this to a reconciliation key to enable reconciliation between query results. * Set this to `false` to disable reconciliation between query results. * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom reconciliation logic. * Defaults reconciliation to false. */ reconcile?: string | false | ((oldData: TData | undefined, newData: TData) => TData); } interface InfiniteQueryObserverOptions extends OmitKeyof, 'structuralSharing'> { /** * Set this to a reconciliation key to enable reconciliation between query results. * Set this to `false` to disable reconciliation between query results. * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom reconciliation logic. * Defaults reconciliation to false. */ reconcile?: string | false | ((oldData: TData | undefined, newData: TData) => TData); } interface DefaultOptions extends DefaultOptions$1 { queries?: OmitKeyof, 'queryKey'>; } interface QueryClientConfig extends QueryClientConfig$1 { defaultOptions?: DefaultOptions; } declare class QueryClient extends QueryClient$1 { constructor(config?: QueryClientConfig); } interface UseBaseQueryOptions extends OmitKeyof, 'suspense'> { /** * Only applicable while rendering queries on the server with streaming. * Set `deferStream` to `true` to wait for the query to resolve on the server before flushing the stream. * This can be useful to avoid sending a loading state to the client before the query has resolved. * Defaults to `false`. */ deferStream?: boolean; /** * @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version. * The `data` property on useQuery is a SolidJS resource and will automatically suspend when the data is loading. * Setting `suspense` to `false` will be a no-op. */ suspense?: boolean; } interface QueryOptions extends UseBaseQueryOptions { } type UseQueryOptions = Accessor>; type UseBaseQueryResult = QueryObserverResult; type UseQueryResult = UseBaseQueryResult; type DefinedUseBaseQueryResult = DefinedQueryObserverResult; type DefinedUseQueryResult = DefinedUseBaseQueryResult; interface InfiniteQueryOptions extends OmitKeyof, 'queryKey' | 'suspense'> { queryKey: TQueryKey; /** * Only applicable while rendering queries on the server with streaming. * Set `deferStream` to `true` to wait for the query to resolve on the server before flushing the stream. * This can be useful to avoid sending a loading state to the client before the query has resolved. * Defaults to `false`. */ deferStream?: boolean; /** * @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version. * The `data` property on useInfiniteQuery is a SolidJS resource and will automatically suspend when the data is loading. * Setting `suspense` to `false` will be a no-op. */ suspense?: boolean; } type UseInfiniteQueryOptions = Accessor>; type UseInfiniteQueryResult = InfiniteQueryObserverResult; type DefinedUseInfiniteQueryResult = DefinedInfiniteQueryObserverResult; interface MutationOptions extends OmitKeyof, '_defaulted'> { } type UseMutationOptions = Accessor>; type UseMutateFunction = (...args: Parameters>) => void; type UseMutateAsyncFunction = MutateFunction; type UseBaseMutationResult = Override, { mutate: UseMutateFunction; }> & { mutateAsync: UseMutateAsyncFunction; }; type UseMutationResult = UseBaseMutationResult; type UndefinedInitialDataOptions = Accessor & { initialData?: undefined; }>; type DefinedInitialDataOptions = Accessor & { initialData: TQueryFnData | (() => TQueryFnData); }>; declare function queryOptions(options: ReturnType>): ReturnType> & { queryKey: DataTag; }; declare function queryOptions(options: ReturnType>): ReturnType> & { queryKey: DataTag; }; declare function useQuery(options: UndefinedInitialDataOptions, queryClient?: () => QueryClient): UseQueryResult; declare function useQuery(options: DefinedInitialDataOptions, queryClient?: () => QueryClient): DefinedUseQueryResult; type UndefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor & { initialData?: undefined; }>; type DefinedInitialDataInfiniteOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown> = Accessor & { initialData: NonUndefinedGuard> | (() => NonUndefinedGuard>); }>; declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: ReturnType>): ReturnType> & { queryKey: DataTag>; }; declare function infiniteQueryOptions, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: ReturnType>): ReturnType> & { queryKey: DataTag>; }; declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: DefinedInitialDataInfiniteOptions, queryClient?: Accessor): DefinedUseInfiniteQueryResult; declare function useInfiniteQuery, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions, queryClient?: Accessor): UseInfiniteQueryResult; declare function useMutation(options: UseMutationOptions, queryClient?: Accessor): UseMutationResult; type UseQueryOptionsForUseQueries = OmitKeyof, 'placeholderData' | 'suspense'> & { placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction; /** * @deprecated The `suspense` option has been deprecated in v5 and will be removed in the next major version. * The `data` property on useQueries is a plain object and not a SolidJS Resource. * It will not suspend when the data is loading. * Setting `suspense` to `true` will be a no-op. */ suspense?: boolean; }; type MAXIMUM_DEPTH = 20; type SkipTokenForUseQueries = symbol; type GetOptions = T extends { queryFnData: infer TQueryFnData; error?: infer TError; data: infer TData; } ? UseQueryOptionsForUseQueries : T extends { queryFnData: infer TQueryFnData; error?: infer TError; } ? UseQueryOptionsForUseQueries : T extends { data: infer TData; error?: infer TError; } ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError, infer TData] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData, infer TError] ? UseQueryOptionsForUseQueries : T extends [infer TQueryFnData] ? UseQueryOptionsForUseQueries : T extends { queryFn?: QueryFunction | SkipTokenForUseQueries; select?: (data: any) => infer TData; throwOnError?: ThrowOnError; } ? UseQueryOptionsForUseQueries : UseQueryOptionsForUseQueries; type GetResults = T extends { queryFnData: any; error?: infer TError; data: infer TData; } ? UseQueryResult : T extends { queryFnData: infer TQueryFnData; error?: infer TError; } ? UseQueryResult : T extends { data: infer TData; error?: infer TError; } ? UseQueryResult : T extends [any, infer TError, infer TData] ? UseQueryResult : T extends [infer TQueryFnData, infer TError] ? UseQueryResult : T extends [infer TQueryFnData] ? UseQueryResult : T extends { queryFn?: QueryFunction | SkipTokenForUseQueries; select?: (data: any) => infer TData; throwOnError?: ThrowOnError; } ? UseQueryResult : UseQueryResult; /** * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param */ type QueriesOptions, TResult extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResult, GetOptions] : T extends [infer Head, ...infer Tail] ? QueriesOptions<[ ...Tail ], [ ...TResult, GetOptions ], [ ...TDepth, 1 ]> : ReadonlyArray extends T ? T : T extends Array> ? Array> : Array; /** * QueriesResults reducer recursively maps type param to results */ type QueriesResults, TResult extends Array = [], TDepth extends ReadonlyArray = []> = TDepth['length'] extends MAXIMUM_DEPTH ? Array : T extends [] ? [] : T extends [infer Head] ? [...TResult, GetResults] : T extends [infer Head, ...infer Tail] ? QueriesResults<[ ...Tail ], [ ...TResult, GetResults ], [ ...TDepth, 1 ]> : { [K in keyof T]: GetResults; }; declare function useQueries, TCombinedResult extends QueriesResults = QueriesResults>(queriesOptions: Accessor<{ queries: readonly [...QueriesOptions] | readonly [...{ [K in keyof T]: GetOptions; }]; combine?: (result: QueriesResults) => TCombinedResult; }>, queryClient?: Accessor): TCombinedResult; declare const QueryClientContext: solid_js.Context<(() => QueryClient) | undefined>; declare const useQueryClient: (queryClient?: QueryClient) => QueryClient; type QueryClientProviderProps = { client: QueryClient; children?: JSX.Element; }; declare const QueryClientProvider: (props: QueryClientProviderProps) => JSX.Element; declare function useIsFetching(filters?: Accessor, queryClient?: Accessor): Accessor; declare function mutationOptions(options: WithRequired, 'mutationKey'>): WithRequired, 'mutationKey'>; declare function mutationOptions(options: Omit, 'mutationKey'>): Omit, 'mutationKey'>; declare function useIsMutating(filters?: Accessor, queryClient?: Accessor): Accessor; type MutationStateOptions = { filters?: MutationFilters; select?: (mutation: Mutation) => TResult; }; declare function useMutationState(options?: Accessor>, queryClient?: Accessor): Accessor>; declare const useIsRestoring: () => Accessor; declare const IsRestoringProvider: solid_js.ContextProviderComponent>; declare const createQuery: typeof useQuery; declare const createInfiniteQuery: typeof useInfiniteQuery; declare const createMutation: typeof useMutation; declare const createQueries: typeof useQueries; export { type UseBaseMutationResult as CreateBaseMutationResult, type UseBaseQueryOptions as CreateBaseQueryOptions, type UseBaseQueryResult as CreateBaseQueryResult, type UseInfiniteQueryOptions as CreateInfiniteQueryOptions, type UseInfiniteQueryResult as CreateInfiniteQueryResult, type UseMutateAsyncFunction as CreateMutateAsyncFunction, type UseMutateFunction as CreateMutateFunction, type UseMutationOptions as CreateMutationOptions, type UseMutationResult as CreateMutationResult, type UseQueryOptions as CreateQueryOptions, type UseQueryResult as CreateQueryResult, type DefaultOptions, type DefinedUseBaseQueryResult as DefinedCreateBaseQueryResult, type DefinedUseInfiniteQueryResult as DefinedCreateInfiniteQueryResult, type DefinedUseQueryResult as DefinedCreateQueryResult, type DefinedInitialDataInfiniteOptions, type DefinedInitialDataOptions, type DefinedUseBaseQueryResult, type DefinedUseInfiniteQueryResult, type DefinedUseQueryResult, type InfiniteQueryObserverOptions, type InfiniteQueryOptions, IsRestoringProvider, type MutationOptions, QueryClient, type QueryClientConfig, QueryClientContext, QueryClientProvider, type QueryClientProviderProps, type QueryObserverOptions, type QueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialDataOptions, type UseBaseMutationResult, type UseBaseQueryOptions, type UseBaseQueryResult, type UseInfiniteQueryOptions, type UseInfiniteQueryResult, type UseMutateAsyncFunction, type UseMutateFunction, type UseMutationOptions, type UseMutationResult, type UseQueryOptions, type UseQueryResult, createInfiniteQuery, useIsFetching as createIsFetching, useIsMutating as createIsMutating, createMutation, useMutationState as createMutationState, createQueries, createQuery, infiniteQueryOptions, mutationOptions, queryOptions, useInfiniteQuery, useIsFetching, useIsMutating, useIsRestoring, useMutation, useMutationState, useQueries, useQuery, useQueryClient };