diff --git a/packages/angular-query-experimental/src/types.ts b/packages/angular-query-experimental/src/types.ts index 8118fa4feb..2211d3b6f7 100644 --- a/packages/angular-query-experimental/src/types.ts +++ b/packages/angular-query-experimental/src/types.ts @@ -10,6 +10,7 @@ import type { MutationObserverOptions, MutationObserverResult, OmitKeyof, + Override, QueryKey, QueryObserverOptions, QueryObserverResult, @@ -321,12 +322,6 @@ export type CreateMutationResult< > = BaseMutationNarrowing & MapToSignals> -type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB - ? TTargetB[AKey] - : TTargetA[AKey] -} - /** * @public */ diff --git a/packages/query-core/src/types.ts b/packages/query-core/src/types.ts index 140cb1f867..9b92678196 100644 --- a/packages/query-core/src/types.ts +++ b/packages/query-core/src/types.ts @@ -20,6 +20,12 @@ export type OmitKeyof< TStrictly extends 'strictly' | 'safely' = 'strictly', > = Omit +export type Override = { + [AKey in keyof TTargetA]: AKey extends keyof TTargetB + ? TTargetB[AKey] + : TTargetA[AKey] +} + export type NoInfer = [T][T extends any ? 0 : never] export interface Register { diff --git a/packages/react-query/src/types.ts b/packages/react-query/src/types.ts index c4e4804e6b..0979fc5311 100644 --- a/packages/react-query/src/types.ts +++ b/packages/react-query/src/types.ts @@ -10,6 +10,7 @@ import type { MutationObserverOptions, MutationObserverResult, OmitKeyof, + Override, QueryKey, QueryObserverOptions, QueryObserverResult, @@ -167,9 +168,3 @@ export type UseMutationResult< TVariables = unknown, TContext = unknown, > = UseBaseMutationResult - -type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB - ? TTargetB[AKey] - : TTargetA[AKey] -} diff --git a/packages/solid-query/src/types.ts b/packages/solid-query/src/types.ts index 952185fc9c..22d70e8def 100644 --- a/packages/solid-query/src/types.ts +++ b/packages/solid-query/src/types.ts @@ -9,6 +9,7 @@ import type { MutationObserverOptions, MutationObserverResult, OmitKeyof, + Override, QueryKey, QueryObserverResult, } from '@tanstack/query-core' @@ -200,9 +201,3 @@ export type CreateMutationResult< TVariables = unknown, TContext = unknown, > = CreateBaseMutationResult - -type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB - ? TTargetB[AKey] - : TTargetA[AKey] -} diff --git a/packages/svelte-query/src/types.ts b/packages/svelte-query/src/types.ts index 4fd8bdb271..fb835c5e7b 100644 --- a/packages/svelte-query/src/types.ts +++ b/packages/svelte-query/src/types.ts @@ -10,6 +10,7 @@ import type { MutationObserverResult, MutationState, OmitKeyof, + Override, QueryKey, QueryObserverOptions, QueryObserverResult, @@ -130,12 +131,6 @@ export type CreateMutationResult< TContext = unknown, > = Readable> -type Override = { - [AKey in keyof TTargetA]: AKey extends keyof TTargetB - ? TTargetB[AKey] - : TTargetA[AKey] -} - /** Options for useMutationState */ export type MutationStateOptions = { filters?: MutationFilters