From 1030e6403b0edab23e826d0360b11edb34f05215 Mon Sep 17 00:00:00 2001 From: Nick Lucas Date: Fri, 6 Dec 2024 13:31:47 +0000 Subject: [PATCH] Try Array --- .../src/infinite-query-options.ts | 4 +-- .../src/inject-queries.ts | 2 +- .../src/query-options.ts | 4 +-- .../angular-query-experimental/src/types.ts | 6 ++-- packages/query-core/src/query.ts | 6 ++-- packages/query-core/src/types.ts | 34 +++++++++---------- packages/query-core/src/utils.ts | 2 +- .../react-query/src/infiniteQueryOptions.ts | 6 ++-- packages/react-query/src/queryOptions.ts | 6 ++-- packages/react-query/src/types.ts | 10 +++--- packages/react-query/src/useQueries.ts | 2 +- packages/solid-query/src/QueryClient.ts | 4 +-- packages/solid-query/src/createQueries.ts | 2 +- .../solid-query/src/infiniteQueryOptions.ts | 4 +-- packages/solid-query/src/queryOptions.ts | 4 +-- packages/solid-query/src/types.ts | 10 +++--- packages/svelte-query/src/createQueries.ts | 2 +- packages/svelte-query/src/queryOptions.ts | 4 +-- packages/svelte-query/src/types.ts | 6 ++-- .../vue-query/src/infiniteQueryOptions.ts | 4 +-- packages/vue-query/src/useBaseQuery.ts | 2 +- packages/vue-query/src/useInfiniteQuery.ts | 2 +- packages/vue-query/src/useQuery.ts | 6 ++-- 23 files changed, 66 insertions(+), 66 deletions(-) diff --git a/packages/angular-query-experimental/src/infinite-query-options.ts b/packages/angular-query-experimental/src/infinite-query-options.ts index 257b40a7b3..3e467ac205 100644 --- a/packages/angular-query-experimental/src/infinite-query-options.ts +++ b/packages/angular-query-experimental/src/infinite-query-options.ts @@ -13,7 +13,7 @@ export type UndefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = CreateInfiniteQueryOptions< TQueryFnData, @@ -33,7 +33,7 @@ export type DefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = CreateInfiniteQueryOptions< TQueryFnData, diff --git a/packages/angular-query-experimental/src/inject-queries.ts b/packages/angular-query-experimental/src/inject-queries.ts index da955c1dbc..2e0c587bba 100644 --- a/packages/angular-query-experimental/src/inject-queries.ts +++ b/packages/angular-query-experimental/src/inject-queries.ts @@ -31,7 +31,7 @@ type QueryObserverOptionsForCreateQueries< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = OmitKeyof< QueryObserverOptions, 'placeholderData' diff --git a/packages/angular-query-experimental/src/query-options.ts b/packages/angular-query-experimental/src/query-options.ts index 7daf85d636..1e87d0249a 100644 --- a/packages/angular-query-experimental/src/query-options.ts +++ b/packages/angular-query-experimental/src/query-options.ts @@ -13,7 +13,7 @@ export type UndefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = CreateQueryOptions & { initialData?: undefined | InitialDataFunction> } @@ -25,7 +25,7 @@ export type DefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = CreateQueryOptions & { initialData: | NonUndefinedGuard diff --git a/packages/angular-query-experimental/src/types.ts b/packages/angular-query-experimental/src/types.ts index 96e5b70aaf..1def9730f2 100644 --- a/packages/angular-query-experimental/src/types.ts +++ b/packages/angular-query-experimental/src/types.ts @@ -25,7 +25,7 @@ export interface CreateBaseQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > extends QueryObserverOptions< TQueryFnData, TError, @@ -41,7 +41,7 @@ export interface CreateQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > extends OmitKeyof< CreateBaseQueryOptions< TQueryFnData, @@ -97,7 +97,7 @@ export interface CreateInfiniteQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > extends OmitKeyof< InfiniteQueryObserverOptions< diff --git a/packages/query-core/src/query.ts b/packages/query-core/src/query.ts index 3e2500c4c6..1c8390f550 100644 --- a/packages/query-core/src/query.ts +++ b/packages/query-core/src/query.ts @@ -33,7 +33,7 @@ interface QueryConfig< TQueryFnData, TError, TData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > { cache: QueryCache queryKey: TQueryKey @@ -62,7 +62,7 @@ export interface FetchContext< TQueryFnData, TError, TData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > { fetchFn: () => unknown | Promise fetchOptions?: FetchOptions @@ -76,7 +76,7 @@ export interface QueryBehavior< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > { onFetch: ( context: FetchContext, diff --git a/packages/query-core/src/types.ts b/packages/query-core/src/types.ts index 360e610bbd..0c11ffccd1 100644 --- a/packages/query-core/src/types.ts +++ b/packages/query-core/src/types.ts @@ -63,7 +63,7 @@ export type DataTag< export type QueryFunction< T = unknown, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = never, > = (context: QueryFunctionContext) => T | Promise @@ -71,21 +71,21 @@ export type StaleTime< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = number | ((query: Query) => number) export type Enabled< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = | boolean | ((query: Query) => boolean) export type QueryPersister< T = unknown, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = never, > = [TPageParam] extends [never] ? ( @@ -100,7 +100,7 @@ export type QueryPersister< ) => T | Promise export type QueryFunctionContext< - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = never, > = [TPageParam] extends [never] ? { @@ -134,7 +134,7 @@ export type PlaceholderDataFunction< TQueryFnData = unknown, TError = DefaultError, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = ( previousData: TQueryData | undefined, previousQuery: Query | undefined, @@ -188,7 +188,7 @@ export interface QueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = never, > { /** @@ -276,7 +276,7 @@ export interface QueryObserverOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = never, > extends WithRequired< QueryOptions, @@ -415,7 +415,7 @@ export type DefaultedQueryObserverOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = WithRequired< QueryObserverOptions, 'throwOnError' | 'refetchOnReconnect' | 'queryHash' @@ -426,7 +426,7 @@ export interface InfiniteQueryObserverOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > extends QueryObserverOptions< TQueryFnData, @@ -443,7 +443,7 @@ export type DefaultedInfiniteQueryObserverOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = WithRequired< InfiniteQueryObserverOptions< @@ -461,7 +461,7 @@ export interface FetchQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = never, > extends WithRequired< QueryOptions, @@ -479,7 +479,7 @@ export interface EnsureQueryDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = never, > extends FetchQueryOptions< TQueryFnData, @@ -495,7 +495,7 @@ export type EnsureInfiniteQueryDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = FetchInfiniteQueryOptions< TQueryFnData, @@ -518,7 +518,7 @@ export type FetchInfiniteQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = Omit< FetchQueryOptions< @@ -552,7 +552,7 @@ export interface InvalidateQueryFilters< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > extends QueryFilters { refetchType?: QueryTypeFilter | 'none' } @@ -561,7 +561,7 @@ export interface RefetchQueryFilters< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > extends QueryFilters {} export interface InvalidateOptions extends RefetchOptions {} diff --git a/packages/query-core/src/utils.ts b/packages/query-core/src/utils.ts index e4d32d575b..da25b4d803 100644 --- a/packages/query-core/src/utils.ts +++ b/packages/query-core/src/utils.ts @@ -18,7 +18,7 @@ export interface QueryFilters< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > { /** * Filter to active queries, inactive queries or all queries diff --git a/packages/react-query/src/infiniteQueryOptions.ts b/packages/react-query/src/infiniteQueryOptions.ts index a82d981ddb..e6be223702 100644 --- a/packages/react-query/src/infiniteQueryOptions.ts +++ b/packages/react-query/src/infiniteQueryOptions.ts @@ -13,7 +13,7 @@ export type UndefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = UseInfiniteQueryOptions< TQueryFnData, @@ -35,7 +35,7 @@ export type UnusedSkipTokenInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = OmitKeyof< UseInfiniteQueryOptions< @@ -67,7 +67,7 @@ export type DefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = UseInfiniteQueryOptions< TQueryFnData, diff --git a/packages/react-query/src/queryOptions.ts b/packages/react-query/src/queryOptions.ts index dfe5f63b24..014caa8796 100644 --- a/packages/react-query/src/queryOptions.ts +++ b/packages/react-query/src/queryOptions.ts @@ -12,7 +12,7 @@ export type UndefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = UseQueryOptions & { initialData?: | undefined @@ -24,7 +24,7 @@ export type UnusedSkipTokenOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = OmitKeyof< UseQueryOptions, 'queryFn' @@ -41,7 +41,7 @@ export type DefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = UseQueryOptions & { initialData: | NonUndefinedGuard diff --git a/packages/react-query/src/types.ts b/packages/react-query/src/types.ts index 74b26de3ab..7eb3f51bd8 100644 --- a/packages/react-query/src/types.ts +++ b/packages/react-query/src/types.ts @@ -22,7 +22,7 @@ export interface UseBaseQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > extends QueryObserverOptions< TQueryFnData, TError, @@ -35,7 +35,7 @@ export interface UseQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > extends OmitKeyof< UseBaseQueryOptions, 'suspense' @@ -45,7 +45,7 @@ export interface UseSuspenseQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > extends OmitKeyof< UseQueryOptions, 'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData' @@ -61,7 +61,7 @@ export interface UseInfiniteQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > extends OmitKeyof< InfiniteQueryObserverOptions< @@ -80,7 +80,7 @@ export interface UseSuspenseInfiniteQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > extends OmitKeyof< UseInfiniteQueryOptions< diff --git a/packages/react-query/src/useQueries.ts b/packages/react-query/src/useQueries.ts index b44915e42c..853c3a578a 100644 --- a/packages/react-query/src/useQueries.ts +++ b/packages/react-query/src/useQueries.ts @@ -44,7 +44,7 @@ type UseQueryOptionsForUseQueries< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = OmitKeyof< UseQueryOptions, 'placeholderData' diff --git a/packages/solid-query/src/QueryClient.ts b/packages/solid-query/src/QueryClient.ts index e226615b30..84cd6b034b 100644 --- a/packages/solid-query/src/QueryClient.ts +++ b/packages/solid-query/src/QueryClient.ts @@ -14,7 +14,7 @@ export interface QueryObserverOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = never, > extends OmitKeyof< QueryCoreObserverOptions< @@ -44,7 +44,7 @@ export interface InfiniteQueryObserverOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > extends OmitKeyof< QueryCoreInfiniteQueryObserverOptions< diff --git a/packages/solid-query/src/createQueries.ts b/packages/solid-query/src/createQueries.ts index 7515e7dd87..437d351ea9 100644 --- a/packages/solid-query/src/createQueries.ts +++ b/packages/solid-query/src/createQueries.ts @@ -35,7 +35,7 @@ type CreateQueryOptionsForCreateQueries< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = OmitKeyof< SolidQueryOptions, 'placeholderData' | 'suspense' diff --git a/packages/solid-query/src/infiniteQueryOptions.ts b/packages/solid-query/src/infiniteQueryOptions.ts index bc09ae1193..fe3fa88eda 100644 --- a/packages/solid-query/src/infiniteQueryOptions.ts +++ b/packages/solid-query/src/infiniteQueryOptions.ts @@ -10,7 +10,7 @@ export type UndefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = FunctionedParams< SolidInfiniteQueryOptions< @@ -32,7 +32,7 @@ export type DefinedInitialDataInfiniteOptions< TError = DefaultError, // should we handle page param correctly TData = InfiniteData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = FunctionedParams< SolidInfiniteQueryOptions< diff --git a/packages/solid-query/src/queryOptions.ts b/packages/solid-query/src/queryOptions.ts index c5f8951e60..10fd9e0129 100644 --- a/packages/solid-query/src/queryOptions.ts +++ b/packages/solid-query/src/queryOptions.ts @@ -5,7 +5,7 @@ export type UndefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = FunctionedParams< SolidQueryOptions & { initialData?: undefined @@ -16,7 +16,7 @@ export type DefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = FunctionedParams< SolidQueryOptions & { initialData: TQueryFnData | (() => TQueryFnData) diff --git a/packages/solid-query/src/types.ts b/packages/solid-query/src/types.ts index 17e6fd241b..52fdca9cc7 100644 --- a/packages/solid-query/src/types.ts +++ b/packages/solid-query/src/types.ts @@ -25,7 +25,7 @@ export interface CreateBaseQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > extends OmitKeyof< QueryObserverOptions, 'suspense' @@ -49,7 +49,7 @@ export interface SolidQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > extends CreateBaseQueryOptions< TQueryFnData, TError, @@ -62,7 +62,7 @@ export type CreateQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = FunctionedParams> /* --- Create Query and Create Base Query Types --- */ @@ -93,7 +93,7 @@ export interface SolidInfiniteQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > extends OmitKeyof< InfiniteQueryObserverOptions< @@ -126,7 +126,7 @@ export type CreateInfiniteQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = FunctionedParams< SolidInfiniteQueryOptions< diff --git a/packages/svelte-query/src/createQueries.ts b/packages/svelte-query/src/createQueries.ts index ba4ea01121..d9198305d1 100644 --- a/packages/svelte-query/src/createQueries.ts +++ b/packages/svelte-query/src/createQueries.ts @@ -25,7 +25,7 @@ type QueryObserverOptionsForCreateQueries< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = OmitKeyof< QueryObserverOptions, 'placeholderData' diff --git a/packages/svelte-query/src/queryOptions.ts b/packages/svelte-query/src/queryOptions.ts index 9baddb4655..b7eec4f2fe 100644 --- a/packages/svelte-query/src/queryOptions.ts +++ b/packages/svelte-query/src/queryOptions.ts @@ -10,7 +10,7 @@ export type UndefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = CreateQueryOptions & { initialData?: undefined | InitialDataFunction> } @@ -21,7 +21,7 @@ export type DefinedInitialDataOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = CreateQueryOptions & { initialData: | NonUndefinedGuard diff --git a/packages/svelte-query/src/types.ts b/packages/svelte-query/src/types.ts index 47531b4e30..ed2eaf40e3 100644 --- a/packages/svelte-query/src/types.ts +++ b/packages/svelte-query/src/types.ts @@ -26,7 +26,7 @@ export type CreateBaseQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = QueryObserverOptions /** Result from createBaseQuery */ @@ -40,7 +40,7 @@ export type CreateQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = CreateBaseQueryOptions /** Result from createQuery */ @@ -55,7 +55,7 @@ export type CreateInfiniteQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = InfiniteQueryObserverOptions< TQueryFnData, diff --git a/packages/vue-query/src/infiniteQueryOptions.ts b/packages/vue-query/src/infiniteQueryOptions.ts index f13d93d94f..4f94f55c26 100644 --- a/packages/vue-query/src/infiniteQueryOptions.ts +++ b/packages/vue-query/src/infiniteQueryOptions.ts @@ -10,7 +10,7 @@ export type UndefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = UseInfiniteQueryOptions< TQueryFnData, @@ -29,7 +29,7 @@ export type DefinedInitialDataInfiniteOptions< TQueryFnData, TError = DefaultError, TData = InfiniteData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = UseInfiniteQueryOptions< TQueryFnData, diff --git a/packages/vue-query/src/useBaseQuery.ts b/packages/vue-query/src/useBaseQuery.ts index 320f464244..4a7c869068 100644 --- a/packages/vue-query/src/useBaseQuery.ts +++ b/packages/vue-query/src/useBaseQuery.ts @@ -41,7 +41,7 @@ type UseQueryOptionsGeneric< TError, TData, TQueryData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = | UseQueryOptions diff --git a/packages/vue-query/src/useInfiniteQuery.ts b/packages/vue-query/src/useInfiniteQuery.ts index 555a5127a8..a79b8f99d3 100644 --- a/packages/vue-query/src/useInfiniteQuery.ts +++ b/packages/vue-query/src/useInfiniteQuery.ts @@ -19,7 +19,7 @@ export type UseInfiniteQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, TPageParam = unknown, > = { [Property in keyof InfiniteQueryObserverOptions< diff --git a/packages/vue-query/src/useQuery.ts b/packages/vue-query/src/useQuery.ts index a079be2e62..7a3138b4ce 100644 --- a/packages/vue-query/src/useQuery.ts +++ b/packages/vue-query/src/useQuery.ts @@ -22,7 +22,7 @@ export type UseQueryOptions< TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = MaybeRef< { [Property in keyof QueryObserverOptions< @@ -59,7 +59,7 @@ export type UndefinedInitialQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = UseQueryOptions & { initialData?: undefined } @@ -68,7 +68,7 @@ export type DefinedInitialQueryOptions< TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, - TQueryKey extends QueryKey = any, + TQueryKey extends QueryKey = Array, > = UseQueryOptions & { initialData: | NonUndefinedGuard