Skip to content

Commit

Permalink
Try Array<any>
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Lucas committed Dec 6, 2024
1 parent e8873fc commit 1030e64
Show file tree
Hide file tree
Showing 23 changed files with 66 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type UndefinedInitialDataInfiniteOptions<
TQueryFnData,
TError = DefaultError,
TData = InfiniteData<TQueryFnData>,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = unknown,
> = CreateInfiniteQueryOptions<
TQueryFnData,
Expand All @@ -33,7 +33,7 @@ export type DefinedInitialDataInfiniteOptions<
TQueryFnData,
TError = DefaultError,
TData = InfiniteData<TQueryFnData>,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = unknown,
> = CreateInfiniteQueryOptions<
TQueryFnData,
Expand Down
2 changes: 1 addition & 1 deletion packages/angular-query-experimental/src/inject-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type QueryObserverOptionsForCreateQueries<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> = OmitKeyof<
QueryObserverOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>,
'placeholderData'
Expand Down
4 changes: 2 additions & 2 deletions packages/angular-query-experimental/src/query-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type UndefinedInitialDataOptions<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> = CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
initialData?: undefined | InitialDataFunction<NonUndefinedGuard<TQueryFnData>>
}
Expand All @@ -25,7 +25,7 @@ export type DefinedInitialDataOptions<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> = CreateQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
initialData:
| NonUndefinedGuard<TQueryFnData>
Expand Down
6 changes: 3 additions & 3 deletions packages/angular-query-experimental/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface CreateBaseQueryOptions<
TError = DefaultError,
TData = TQueryFnData,
TQueryData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> extends QueryObserverOptions<
TQueryFnData,
TError,
Expand All @@ -41,7 +41,7 @@ export interface CreateQueryOptions<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> extends OmitKeyof<
CreateBaseQueryOptions<
TQueryFnData,
Expand Down Expand Up @@ -97,7 +97,7 @@ export interface CreateInfiniteQueryOptions<
TError = DefaultError,
TData = TQueryFnData,
TQueryData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = unknown,
> extends OmitKeyof<
InfiniteQueryObserverOptions<
Expand Down
6 changes: 3 additions & 3 deletions packages/query-core/src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface QueryConfig<
TQueryFnData,
TError,
TData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> {
cache: QueryCache
queryKey: TQueryKey
Expand Down Expand Up @@ -62,7 +62,7 @@ export interface FetchContext<
TQueryFnData,
TError,
TData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> {
fetchFn: () => unknown | Promise<unknown>
fetchOptions?: FetchOptions
Expand All @@ -76,7 +76,7 @@ export interface QueryBehavior<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> {
onFetch: (
context: FetchContext<TQueryFnData, TError, TData, TQueryKey>,
Expand Down
34 changes: 17 additions & 17 deletions packages/query-core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,29 @@ export type DataTag<

export type QueryFunction<
T = unknown,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = never,
> = (context: QueryFunctionContext<TQueryKey, TPageParam>) => T | Promise<T>

export type StaleTime<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> = number | ((query: Query<TQueryFnData, TError, TData, TQueryKey>) => number)

export type Enabled<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> =
| boolean
| ((query: Query<TQueryFnData, TError, TData, TQueryKey>) => boolean)

export type QueryPersister<
T = unknown,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = never,
> = [TPageParam] extends [never]
? (
Expand All @@ -100,7 +100,7 @@ export type QueryPersister<
) => T | Promise<T>

export type QueryFunctionContext<
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = never,
> = [TPageParam] extends [never]
? {
Expand Down Expand Up @@ -134,7 +134,7 @@ export type PlaceholderDataFunction<
TQueryFnData = unknown,
TError = DefaultError,
TQueryData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> = (
previousData: TQueryData | undefined,
previousQuery: Query<TQueryFnData, TError, TQueryData, TQueryKey> | undefined,
Expand Down Expand Up @@ -188,7 +188,7 @@ export interface QueryOptions<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = never,
> {
/**
Expand Down Expand Up @@ -276,7 +276,7 @@ export interface QueryObserverOptions<
TError = DefaultError,
TData = TQueryFnData,
TQueryData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = never,
> extends WithRequired<
QueryOptions<TQueryFnData, TError, TQueryData, TQueryKey, TPageParam>,
Expand Down Expand Up @@ -415,7 +415,7 @@ export type DefaultedQueryObserverOptions<
TError = DefaultError,
TData = TQueryFnData,
TQueryData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> = WithRequired<
QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>,
'throwOnError' | 'refetchOnReconnect' | 'queryHash'
Expand All @@ -426,7 +426,7 @@ export interface InfiniteQueryObserverOptions<
TError = DefaultError,
TData = TQueryFnData,
TQueryData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = unknown,
> extends QueryObserverOptions<
TQueryFnData,
Expand All @@ -443,7 +443,7 @@ export type DefaultedInfiniteQueryObserverOptions<
TError = DefaultError,
TData = TQueryFnData,
TQueryData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = unknown,
> = WithRequired<
InfiniteQueryObserverOptions<
Expand All @@ -461,7 +461,7 @@ export interface FetchQueryOptions<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = never,
> extends WithRequired<
QueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>,
Expand All @@ -479,7 +479,7 @@ export interface EnsureQueryDataOptions<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = never,
> extends FetchQueryOptions<
TQueryFnData,
Expand All @@ -495,7 +495,7 @@ export type EnsureInfiniteQueryDataOptions<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = unknown,
> = FetchInfiniteQueryOptions<
TQueryFnData,
Expand All @@ -518,7 +518,7 @@ export type FetchInfiniteQueryOptions<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = unknown,
> = Omit<
FetchQueryOptions<
Expand Down Expand Up @@ -552,7 +552,7 @@ export interface InvalidateQueryFilters<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> extends QueryFilters<TQueryFnData, TError, TData, TQueryKey> {
refetchType?: QueryTypeFilter | 'none'
}
Expand All @@ -561,7 +561,7 @@ export interface RefetchQueryFilters<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> extends QueryFilters<TQueryFnData, TError, TData, TQueryKey> {}

export interface InvalidateOptions extends RefetchOptions {}
Expand Down
2 changes: 1 addition & 1 deletion packages/query-core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface QueryFilters<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> {
/**
* Filter to active queries, inactive queries or all queries
Expand Down
6 changes: 3 additions & 3 deletions packages/react-query/src/infiniteQueryOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type UndefinedInitialDataInfiniteOptions<
TQueryFnData,
TError = DefaultError,
TData = InfiniteData<TQueryFnData>,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = unknown,
> = UseInfiniteQueryOptions<
TQueryFnData,
Expand All @@ -35,7 +35,7 @@ export type UnusedSkipTokenInfiniteOptions<
TQueryFnData,
TError = DefaultError,
TData = InfiniteData<TQueryFnData>,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = unknown,
> = OmitKeyof<
UseInfiniteQueryOptions<
Expand Down Expand Up @@ -67,7 +67,7 @@ export type DefinedInitialDataInfiniteOptions<
TQueryFnData,
TError = DefaultError,
TData = InfiniteData<TQueryFnData>,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = unknown,
> = UseInfiniteQueryOptions<
TQueryFnData,
Expand Down
6 changes: 3 additions & 3 deletions packages/react-query/src/queryOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type UndefinedInitialDataOptions<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> = UseQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
initialData?:
| undefined
Expand All @@ -24,7 +24,7 @@ export type UnusedSkipTokenOptions<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> = OmitKeyof<
UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
'queryFn'
Expand All @@ -41,7 +41,7 @@ export type DefinedInitialDataOptions<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> = UseQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
initialData:
| NonUndefinedGuard<TQueryFnData>
Expand Down
10 changes: 5 additions & 5 deletions packages/react-query/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface UseBaseQueryOptions<
TError = DefaultError,
TData = TQueryFnData,
TQueryData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> extends QueryObserverOptions<
TQueryFnData,
TError,
Expand All @@ -35,7 +35,7 @@ export interface UseQueryOptions<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> extends OmitKeyof<
UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>,
'suspense'
Expand All @@ -45,7 +45,7 @@ export interface UseSuspenseQueryOptions<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> extends OmitKeyof<
UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
'queryFn' | 'enabled' | 'throwOnError' | 'placeholderData'
Expand All @@ -61,7 +61,7 @@ export interface UseInfiniteQueryOptions<
TError = DefaultError,
TData = TQueryFnData,
TQueryData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = unknown,
> extends OmitKeyof<
InfiniteQueryObserverOptions<
Expand All @@ -80,7 +80,7 @@ export interface UseSuspenseInfiniteQueryOptions<
TError = DefaultError,
TData = TQueryFnData,
TQueryData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = unknown,
> extends OmitKeyof<
UseInfiniteQueryOptions<
Expand Down
2 changes: 1 addition & 1 deletion packages/react-query/src/useQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type UseQueryOptionsForUseQueries<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> = OmitKeyof<
UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
'placeholderData'
Expand Down
4 changes: 2 additions & 2 deletions packages/solid-query/src/QueryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface QueryObserverOptions<
TError = DefaultError,
TData = TQueryFnData,
TQueryData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = never,
> extends OmitKeyof<
QueryCoreObserverOptions<
Expand Down Expand Up @@ -44,7 +44,7 @@ export interface InfiniteQueryObserverOptions<
TError = DefaultError,
TData = TQueryFnData,
TQueryData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
TPageParam = unknown,
> extends OmitKeyof<
QueryCoreInfiniteQueryObserverOptions<
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-query/src/createQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type CreateQueryOptionsForCreateQueries<
TQueryFnData = unknown,
TError = DefaultError,
TData = TQueryFnData,
TQueryKey extends QueryKey = any,
TQueryKey extends QueryKey = Array<any>,
> = OmitKeyof<
SolidQueryOptions<TQueryFnData, TError, TData, TQueryKey>,
'placeholderData' | 'suspense'
Expand Down
Loading

0 comments on commit 1030e64

Please sign in to comment.