From e68ca7db0e96d3eb2af1f7bb6646ab6aa275e4c5 Mon Sep 17 00:00:00 2001 From: Luke Morales Date: Fri, 9 Feb 2024 11:54:32 -0300 Subject: [PATCH] chore: format files --- src/create-mutation-keys.types.ts | 133 ++++++++++++-------------- src/create-query-key-store.ts | 6 +- src/create-query-keys.types.ts | 151 +++++++++++++----------------- src/merge-query-keys.ts | 13 ++- src/utility-types.ts | 61 ++++++------ 5 files changed, 166 insertions(+), 198 deletions(-) diff --git a/src/create-mutation-keys.types.ts b/src/create-mutation-keys.types.ts index 2e12531..ed3a4b9 100644 --- a/src/create-mutation-keys.types.ts +++ b/src/create-mutation-keys.types.ts @@ -56,23 +56,20 @@ export type MutationFactorySchema = Record = Omit; -export type ValidateFactory = Schema extends { - [P in ExtractInternalKeys]: Schema[P]; -} - ? InvalidSchema +export type ValidateFactory = + Schema extends { + [P in ExtractInternalKeys]: Schema[P]; + } ? + InvalidSchema : Schema; -type ExtractNullableKey = Key extends - | [...infer Value] - | readonly [...infer Value] - ? Value - : Key extends null | undefined | unknown - ? null +type ExtractNullableKey = + Key extends [...infer Value] | readonly [...infer Value] ? Value + : Key extends null | undefined | unknown ? null : never; -type ComposeQueryKey = Key extends KeyTuple - ? readonly [...BaseKey, ...Key] - : readonly [...BaseKey]; +type ComposeQueryKey = + Key extends KeyTuple ? readonly [...BaseKey, ...Key] : readonly [...BaseKey]; export type MutationOptionsStruct< Keys extends AnyMutableOrReadonlyArray, @@ -90,24 +87,25 @@ type MutationFactoryWithContextualQueriesOutput< SchemaMutationKey extends Schema['mutationKey'] = Schema['mutationKey'], ContextMutations extends Schema['contextMutations'] = Schema['contextMutations'], ComposedKey extends AnyMutableOrReadonlyArray = ComposeQueryKey>, -> = SchemaMutationKey extends null - ? Omit, 'mutationFn'> & { +> = + SchemaMutationKey extends null ? + Omit, 'mutationFn'> & { _ctx: { - [P in keyof ContextMutations]: ContextMutations[P] extends MutationDynamicKey - ? DynamicMutationFactoryOutput<[...ComposedKey, P], ContextMutations[P]> - : ContextMutations[P] extends MutationFactoryProperty - ? StaticMutationFactoryOutput<[...ComposedKey, P], ContextMutations[P]> - : never; + [P in keyof ContextMutations]: ContextMutations[P] extends MutationDynamicKey ? + DynamicMutationFactoryOutput<[...ComposedKey, P], ContextMutations[P]> + : ContextMutations[P] extends MutationFactoryProperty ? + StaticMutationFactoryOutput<[...ComposedKey, P], ContextMutations[P]> + : never; }; } : Omit, 'mutationFn'> & DefinitionKey & { _ctx: { - [P in keyof ContextMutations]: ContextMutations[P] extends MutationDynamicKey - ? DynamicMutationFactoryOutput<[...ComposedKey, P], ContextMutations[P]> - : ContextMutations[P] extends MutationFactoryProperty - ? StaticMutationFactoryOutput<[...ComposedKey, P], ContextMutations[P]> - : never; + [P in keyof ContextMutations]: ContextMutations[P] extends MutationDynamicKey ? + DynamicMutationFactoryOutput<[...ComposedKey, P], ContextMutations[P]> + : ContextMutations[P] extends MutationFactoryProperty ? + StaticMutationFactoryOutput<[...ComposedKey, P], ContextMutations[P]> + : never; }; }; @@ -116,8 +114,8 @@ type FactoryMutationKeyRecordOutput< Schema extends NullableMutationKeyRecord | MutationKeyRecord, SchemaMutationKey extends Schema['mutationKey'] = Schema['mutationKey'], ComposedKey extends AnyMutableOrReadonlyArray = ComposeQueryKey>, -> = SchemaMutationKey extends null - ? Omit, 'mutationFn'> +> = + SchemaMutationKey extends null ? Omit, 'mutationFn'> : Omit, 'mutationFn'> & DefinitionKey; type FactoryMutationOptionsOutput< @@ -126,8 +124,8 @@ type FactoryMutationOptionsOutput< SchemaQueryKey extends Schema['mutationKey'] = Schema['mutationKey'], MutationFn extends Schema['mutationFn'] = Schema['mutationFn'], ComposedKey extends AnyMutableOrReadonlyArray = ComposeQueryKey>, -> = SchemaQueryKey extends null - ? MutationOptionsStruct +> = + SchemaQueryKey extends null ? MutationOptionsStruct : MutationOptionsStruct & DefinitionKey; type FactoryMutationOptionsWithContextualQueriesOutput< @@ -137,24 +135,25 @@ type FactoryMutationOptionsWithContextualQueriesOutput< MutationFn extends Schema['mutationFn'] = Schema['mutationFn'], ContextMutations extends Schema['contextMutations'] = Schema['contextMutations'], Key extends AnyMutableOrReadonlyArray = ComposeQueryKey>, -> = SchemaQueryKey extends null - ? MutationOptionsStruct & { +> = + SchemaQueryKey extends null ? + MutationOptionsStruct & { _ctx: { - [P in keyof ContextMutations]: ContextMutations[P] extends MutationDynamicKey - ? DynamicMutationFactoryOutput<[...Key, P], ContextMutations[P]> - : ContextMutations[P] extends MutationFactoryProperty - ? StaticMutationFactoryOutput<[...Key, P], ContextMutations[P]> - : never; + [P in keyof ContextMutations]: ContextMutations[P] extends MutationDynamicKey ? + DynamicMutationFactoryOutput<[...Key, P], ContextMutations[P]> + : ContextMutations[P] extends MutationFactoryProperty ? + StaticMutationFactoryOutput<[...Key, P], ContextMutations[P]> + : never; }; } : DefinitionKey & MutationOptionsStruct & { _ctx: { - [P in keyof ContextMutations]: ContextMutations[P] extends MutationDynamicKey - ? DynamicMutationFactoryOutput<[...Key, P], ContextMutations[P]> - : ContextMutations[P] extends MutationFactoryProperty - ? StaticMutationFactoryOutput<[...Key, P], ContextMutations[P]> - : never; + [P in keyof ContextMutations]: ContextMutations[P] extends MutationDynamicKey ? + DynamicMutationFactoryOutput<[...Key, P], ContextMutations[P]> + : ContextMutations[P] extends MutationFactoryProperty ? + StaticMutationFactoryOutput<[...Key, P], ContextMutations[P]> + : never; }; }; @@ -162,19 +161,15 @@ type DynamicMutationFactoryOutput< Keys extends AnyMutableOrReadonlyArray, Generator extends MutationDynamicKey, Output extends ReturnType = ReturnType, -> = (( - ...args: Parameters -) => Output extends [...infer TupleResult] | readonly [...infer TupleResult] - ? Omit, 'mutationFn'> - : Output extends DynamicMutationFactoryWithContextualMutationsSchema - ? Omit, '_def'> - : Output extends DynamicMutationFactorySchema - ? Omit, '_def'> - : Output extends DynamicMutationKeySchemaWithContextualMutations - ? Omit, '_def'> - : Output extends MutationKeyRecord - ? Omit, '_def'> - : never) & +> = ((...args: Parameters) => Output extends [...infer TupleResult] | readonly [...infer TupleResult] ? + Omit, 'mutationFn'> +: Output extends DynamicMutationFactoryWithContextualMutationsSchema ? + Omit, '_def'> +: Output extends DynamicMutationFactorySchema ? Omit, '_def'> +: Output extends DynamicMutationKeySchemaWithContextualMutations ? + Omit, '_def'> +: Output extends MutationKeyRecord ? Omit, '_def'> +: never) & DefinitionKey; export type AnyMutationFactoryOutputCallback = DynamicMutationFactoryOutput<[string, ...any[]], MutationDynamicKey>; @@ -182,26 +177,22 @@ export type AnyMutationFactoryOutputCallback = DynamicMutationFactoryOutput<[str export type StaticMutationFactoryOutput< Keys extends AnyMutableOrReadonlyArray, Property extends MutationFactoryProperty, -> = Property extends null - ? Omit, 'mutationFn'> - : Property extends [...infer Result] | readonly [...infer Result] - ? DefinitionKey & Omit, 'mutationFn'> - : Property extends MutationFactoryWithContextualMutationsSchema - ? FactoryMutationOptionsWithContextualQueriesOutput - : Property extends $MutationFactorySchema - ? FactoryMutationOptionsOutput - : Property extends MutationKeySchemaWithContextualMutations - ? MutationFactoryWithContextualQueriesOutput - : Property extends NullableMutationKeyRecord - ? FactoryMutationKeyRecordOutput +> = + Property extends null ? Omit, 'mutationFn'> + : Property extends [...infer Result] | readonly [...infer Result] ? + DefinitionKey & Omit, 'mutationFn'> + : Property extends MutationFactoryWithContextualMutationsSchema ? + FactoryMutationOptionsWithContextualQueriesOutput + : Property extends $MutationFactorySchema ? FactoryMutationOptionsOutput + : Property extends MutationKeySchemaWithContextualMutations ? + MutationFactoryWithContextualQueriesOutput + : Property extends NullableMutationKeyRecord ? FactoryMutationKeyRecordOutput : never; type MutationFactoryOutput = DefinitionKey<[Key]> & { - [P in keyof Schema]: Schema[P] extends MutationDynamicKey - ? DynamicMutationFactoryOutput<[Key, P], Schema[P]> - : Schema[P] extends MutationFactoryProperty - ? StaticMutationFactoryOutput<[Key, P], Schema[P]> - : never; + [P in keyof Schema]: Schema[P] extends MutationDynamicKey ? DynamicMutationFactoryOutput<[Key, P], Schema[P]> + : Schema[P] extends MutationFactoryProperty ? StaticMutationFactoryOutput<[Key, P], Schema[P]> + : never; }; export type MutationKeyFactoryResult = MutationFactoryOutput< diff --git a/src/create-query-key-store.ts b/src/create-query-key-store.ts index 50ef497..aa7aff3 100644 --- a/src/create-query-key-store.ts +++ b/src/create-query-key-store.ts @@ -6,9 +6,9 @@ import { omitPrototype } from './internals'; type QueryKeyStoreSchema = Record; export type QueryKeyStore = { - [P in keyof StoreSchema & string]: StoreSchema[P] extends QueryFactorySchema - ? QueryKeyFactoryResult - : DefinitionKey<[P]>; + [P in keyof StoreSchema & string]: StoreSchema[P] extends QueryFactorySchema ? + QueryKeyFactoryResult + : DefinitionKey<[P]>; }; export function createQueryKeyStore( diff --git a/src/create-query-keys.types.ts b/src/create-query-keys.types.ts index 9d18e66..c21f38d 100644 --- a/src/create-query-keys.types.ts +++ b/src/create-query-keys.types.ts @@ -7,11 +7,10 @@ export type AnyQueryKey = readonly [string, ...any[]]; type ValidFactoryKey = 'queryKey' | 'queryFn' | 'contextQueries'; -export type StrictOptions = T extends any[] - ? T - : keyof T extends ValidFactoryKey - ? T - : { [K in keyof T]: K extends ValidFactoryKey ? T[K] : never }; +export type StrictOptions = + T extends any[] ? T + : keyof T extends ValidFactoryKey ? T + : { [K in keyof T]: K extends ValidFactoryKey ? T[K] : never }; type NullableQueryKeyRecord = Record<'queryKey', KeyTuple | null>; @@ -65,25 +64,20 @@ export type QueryFactorySchema = Record; type InvalidSchema = Omit; export type ValidateFactory = - ExtractInternalKeys extends never - ? { - [P in keyof Schema]: Schema[P] extends (...args: infer Args) => infer R - ? (...args: Args) => StrictOptions - : Schema[P]; - } - : InvalidSchema; - -type ExtractNullableKey = Key extends - | [...infer Value] - | readonly [...infer Value] - ? Value - : Key extends null | undefined | unknown - ? null - : never; - -type ComposeQueryKey = Key extends KeyTuple - ? readonly [...BaseKey, ...Key] - : readonly [...BaseKey]; + ExtractInternalKeys extends never ? + { + [P in keyof Schema]: Schema[P] extends (...args: infer Args) => infer R ? (...args: Args) => StrictOptions + : Schema[P]; + } + : InvalidSchema; + +type ExtractNullableKey = + Key extends [...infer Value] | readonly [...infer Value] ? Value + : Key extends null | undefined | unknown ? null + : never; + +type ComposeQueryKey = + Key extends KeyTuple ? readonly [...BaseKey, ...Key] : readonly [...BaseKey]; export type QueryOptionsStruct< Keys extends AnyMutableOrReadonlyArray, @@ -100,24 +94,23 @@ type FactoryWithContextualQueriesOutput< SchemaQueryKey extends Schema['queryKey'] = Schema['queryKey'], ContextQueries extends Schema['contextQueries'] = Schema['contextQueries'], ComposedKey extends AnyMutableOrReadonlyArray = ComposeQueryKey>, -> = SchemaQueryKey extends null - ? Omit, 'queryFn'> & { +> = + SchemaQueryKey extends null ? + Omit, 'queryFn'> & { _ctx: { - [P in keyof ContextQueries]: ContextQueries[P] extends DynamicKey - ? DynamicFactoryOutput<[...ComposedKey, P], ContextQueries[P]> - : ContextQueries[P] extends FactoryProperty - ? StaticFactoryOutput<[...ComposedKey, P], ContextQueries[P]> - : never; + [P in keyof ContextQueries]: ContextQueries[P] extends DynamicKey ? + DynamicFactoryOutput<[...ComposedKey, P], ContextQueries[P]> + : ContextQueries[P] extends FactoryProperty ? StaticFactoryOutput<[...ComposedKey, P], ContextQueries[P]> + : never; }; } : Omit, 'queryFn'> & DefinitionKey & { _ctx: { - [P in keyof ContextQueries]: ContextQueries[P] extends DynamicKey - ? DynamicFactoryOutput<[...ComposedKey, P], ContextQueries[P]> - : ContextQueries[P] extends FactoryProperty - ? StaticFactoryOutput<[...ComposedKey, P], ContextQueries[P]> - : never; + [P in keyof ContextQueries]: ContextQueries[P] extends DynamicKey ? + DynamicFactoryOutput<[...ComposedKey, P], ContextQueries[P]> + : ContextQueries[P] extends FactoryProperty ? StaticFactoryOutput<[...ComposedKey, P], ContextQueries[P]> + : never; }; }; @@ -126,8 +119,8 @@ type FactoryQueryKeyRecordOutput< Schema extends NullableQueryKeyRecord | QueryKeyRecord, SchemaQueryKey extends Schema['queryKey'] = Schema['queryKey'], ComposedKey extends AnyMutableOrReadonlyArray = ComposeQueryKey>, -> = SchemaQueryKey extends null - ? Omit, 'queryFn'> +> = + SchemaQueryKey extends null ? Omit, 'queryFn'> : Omit, 'queryFn'> & DefinitionKey; type FactoryQueryOptionsOutput< @@ -136,8 +129,8 @@ type FactoryQueryOptionsOutput< SchemaQueryKey extends Schema['queryKey'] = Schema['queryKey'], QueryFn extends Schema['queryFn'] = Schema['queryFn'], ComposedKey extends AnyMutableOrReadonlyArray = ComposeQueryKey>, -> = SchemaQueryKey extends null - ? QueryOptionsStruct +> = + SchemaQueryKey extends null ? QueryOptionsStruct : QueryOptionsStruct & DefinitionKey; type FactoryQueryOptionsWithContextualQueriesOutput< @@ -147,24 +140,23 @@ type FactoryQueryOptionsWithContextualQueriesOutput< QueryFn extends Schema['queryFn'] = Schema['queryFn'], ContextQueries extends Schema['contextQueries'] = Schema['contextQueries'], Key extends AnyMutableOrReadonlyArray = ComposeQueryKey>, -> = SchemaQueryKey extends null - ? QueryOptionsStruct & { +> = + SchemaQueryKey extends null ? + QueryOptionsStruct & { _ctx: { - [P in keyof ContextQueries]: ContextQueries[P] extends DynamicKey - ? DynamicFactoryOutput<[...Key, P], ContextQueries[P]> - : ContextQueries[P] extends FactoryProperty - ? StaticFactoryOutput<[...Key, P], ContextQueries[P]> - : never; + [P in keyof ContextQueries]: ContextQueries[P] extends DynamicKey ? + DynamicFactoryOutput<[...Key, P], ContextQueries[P]> + : ContextQueries[P] extends FactoryProperty ? StaticFactoryOutput<[...Key, P], ContextQueries[P]> + : never; }; } : DefinitionKey & QueryOptionsStruct & { _ctx: { - [P in keyof ContextQueries]: ContextQueries[P] extends DynamicKey - ? DynamicFactoryOutput<[...Key, P], ContextQueries[P]> - : ContextQueries[P] extends FactoryProperty - ? StaticFactoryOutput<[...Key, P], ContextQueries[P]> - : never; + [P in keyof ContextQueries]: ContextQueries[P] extends DynamicKey ? + DynamicFactoryOutput<[...Key, P], ContextQueries[P]> + : ContextQueries[P] extends FactoryProperty ? StaticFactoryOutput<[...Key, P], ContextQueries[P]> + : never; }; }; @@ -172,46 +164,33 @@ type DynamicFactoryOutput< Keys extends AnyMutableOrReadonlyArray, Generator extends DynamicKey, Output extends ReturnType = ReturnType, -> = (( - ...args: Parameters -) => Output extends [...infer TupleResult] | readonly [...infer TupleResult] - ? Omit, 'queryFn'> - : Output extends DynamicQueryFactoryWithContextualQueriesSchema - ? Omit, '_def'> - : Output extends DynamicQueryFactorySchema - ? Omit, '_def'> - : Output extends DynamicKeySchemaWithContextualQueries - ? Omit, '_def'> - : Output extends QueryKeyRecord - ? Omit, '_def'> - : never) & +> = ((...args: Parameters) => Output extends [...infer TupleResult] | readonly [...infer TupleResult] ? + Omit, 'queryFn'> +: Output extends DynamicQueryFactoryWithContextualQueriesSchema ? + Omit, '_def'> +: Output extends DynamicQueryFactorySchema ? Omit, '_def'> +: Output extends DynamicKeySchemaWithContextualQueries ? Omit, '_def'> +: Output extends QueryKeyRecord ? Omit, '_def'> +: never) & DefinitionKey; export type AnyQueryFactoryOutputCallback = DynamicFactoryOutput<[string, ...any[]], DynamicKey>; -export type StaticFactoryOutput< - Keys extends AnyMutableOrReadonlyArray, - Property extends FactoryProperty, -> = Property extends null - ? Omit, 'queryFn'> - : Property extends [...infer Result] | readonly [...infer Result] - ? DefinitionKey & Omit, 'queryFn'> - : Property extends QueryFactoryWithContextualQueriesSchema - ? FactoryQueryOptionsWithContextualQueriesOutput - : Property extends $QueryFactorySchema - ? FactoryQueryOptionsOutput - : Property extends KeySchemaWithContextualQueries - ? FactoryWithContextualQueriesOutput - : Property extends NullableQueryKeyRecord - ? FactoryQueryKeyRecordOutput - : never; +export type StaticFactoryOutput = + Property extends null ? Omit, 'queryFn'> + : Property extends [...infer Result] | readonly [...infer Result] ? + DefinitionKey & Omit, 'queryFn'> + : Property extends QueryFactoryWithContextualQueriesSchema ? + FactoryQueryOptionsWithContextualQueriesOutput + : Property extends $QueryFactorySchema ? FactoryQueryOptionsOutput + : Property extends KeySchemaWithContextualQueries ? FactoryWithContextualQueriesOutput + : Property extends NullableQueryKeyRecord ? FactoryQueryKeyRecordOutput + : never; type FactoryOutput = DefinitionKey<[Key]> & { - [P in keyof Schema]: Schema[P] extends DynamicKey - ? DynamicFactoryOutput<[Key, P], Schema[P]> - : Schema[P] extends FactoryProperty - ? StaticFactoryOutput<[Key, P], Schema[P]> - : never; + [P in keyof Schema]: Schema[P] extends DynamicKey ? DynamicFactoryOutput<[Key, P], Schema[P]> + : Schema[P] extends FactoryProperty ? StaticFactoryOutput<[Key, P], Schema[P]> + : never; }; export type QueryKeyFactoryResult = FactoryOutput; diff --git a/src/merge-query-keys.ts b/src/merge-query-keys.ts index 361f098..7e7bea4 100644 --- a/src/merge-query-keys.ts +++ b/src/merge-query-keys.ts @@ -5,11 +5,14 @@ import type { Prettify } from './types'; type StoreFromMergedQueryKeys< QueryOrMutationKeyFactoryResults extends Array, -> = QueryOrMutationKeyFactoryResults extends [ - infer First extends AnyQueryKeyFactoryResult | AnyMutationKeyFactoryResult, - ...infer Rest extends AnyQueryKeyFactoryResult[] | AnyMutationKeyFactoryResult[], -] - ? { [P in First['_def'][0]]: First } & StoreFromMergedQueryKeys +> = + QueryOrMutationKeyFactoryResults extends ( + [ + infer First extends AnyQueryKeyFactoryResult | AnyMutationKeyFactoryResult, + ...infer Rest extends AnyQueryKeyFactoryResult[] | AnyMutationKeyFactoryResult[], + ] + ) ? + { [P in First['_def'][0]]: First } & StoreFromMergedQueryKeys : {}; export function mergeQueryKeys< diff --git a/src/utility-types.ts b/src/utility-types.ts index 87cbe28..74b604b 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -16,35 +16,31 @@ import type { AnyMutableOrReadonlyArray } from './types'; type MergeInsertions = T extends object ? { [K in keyof T]: MergeInsertions } : T; type inferRecordMutationKeys = { - [P in Exclude]: Target[P] extends AnyMutableOrReadonlyArray - ? Target[P] - : Target[P] extends object - ? { - [K in keyof Target[P]]: inferSchemaProperty; - } - : never; + [P in Exclude]: Target[P] extends AnyMutableOrReadonlyArray ? Target[P] + : Target[P] extends object ? + { + [K in keyof Target[P]]: inferSchemaProperty; + } + : never; }; type inferRecordQueryKeys = { - [P in Exclude]: Target[P] extends AnyMutableOrReadonlyArray - ? Target[P] - : Target[P] extends object - ? { - [K in keyof Target[P]]: inferSchemaProperty; - } - : never; + [P in Exclude]: Target[P] extends AnyMutableOrReadonlyArray ? Target[P] + : Target[P] extends object ? + { + [K in keyof Target[P]]: inferSchemaProperty; + } + : never; }; -type inferSchemaProperty = Value extends AnyMutableOrReadonlyArray - ? Value - : Value extends StaticFactoryOutput - ? inferRecordQueryKeys - : Value extends StaticMutationFactoryOutput - ? inferRecordMutationKeys - : Value extends AnyQueryFactoryOutputCallback - ? Record<'_def', Value['_def']> & inferRecordQueryKeys> - : Value extends AnyMutationFactoryOutputCallback - ? Record<'_def', Value['_def']> & inferRecordMutationKeys> +type inferSchemaProperty = + Value extends AnyMutableOrReadonlyArray ? Value + : Value extends StaticFactoryOutput ? inferRecordQueryKeys + : Value extends StaticMutationFactoryOutput ? inferRecordMutationKeys + : Value extends AnyQueryFactoryOutputCallback ? + Record<'_def', Value['_def']> & inferRecordQueryKeys> + : Value extends AnyMutationFactoryOutputCallback ? + Record<'_def', Value['_def']> & inferRecordMutationKeys> : never; export type inferQueryKeys = { @@ -61,13 +57,12 @@ type LooseQueryOptionsStructGenerator = (...args: any[]) => LooseQueryOptionsStr export type TypedUseQueryOptions< Options extends LooseQueryOptionsStruct | LooseQueryOptionsStructGenerator, - Data = Options extends LooseQueryOptionsStructGenerator - ? Awaited['queryFn']>> - : Options extends LooseQueryOptionsStruct - ? Awaited> - : never, -> = Options extends LooseQueryOptionsStructGenerator - ? UseQueryOptions['queryFn']>>, unknown, Data, ReturnType['queryKey']> - : Options extends LooseQueryOptionsStruct - ? UseQueryOptions>, unknown, Data, Options['queryKey']> + Data = Options extends LooseQueryOptionsStructGenerator ? Awaited['queryFn']>> + : Options extends LooseQueryOptionsStruct ? Awaited> + : never, +> = + Options extends LooseQueryOptionsStructGenerator ? + UseQueryOptions['queryFn']>>, unknown, Data, ReturnType['queryKey']> + : Options extends LooseQueryOptionsStruct ? + UseQueryOptions>, unknown, Data, Options['queryKey']> : never;