diff --git a/src/_internal/types.ts b/src/_internal/types.ts index 528dae932..e88039f5f 100644 --- a/src/_internal/types.ts +++ b/src/_internal/types.ts @@ -440,9 +440,12 @@ export interface ScopedMutator { * @typeParam MutationData - The type of the data returned by the mutator */ export type KeyedMutator = ( - data?: Data | Promise | MutatorCallback, + data?: + | MutationData + | Promise + | MutatorCallback, opts?: boolean | MutatorOptions -) => Promise +) => Promise export type SWRConfiguration< Data = any, diff --git a/src/infinite/index.ts b/src/infinite/index.ts index f410b5bef..6e51f8574 100644 --- a/src/infinite/index.ts +++ b/src/infinite/index.ts @@ -240,13 +240,12 @@ export const infinite = ((useSWRNext: SWRHook) => const mutate = useCallback( // eslint-disable-next-line func-names - function ( + function ( data?: - | undefined - | Data[] - | Promise - | MutatorCallback, - opts?: undefined | boolean | SWRInfiniteMutatorOptions + | MutationData + | Promise + | MutatorCallback, + opts?: boolean | SWRInfiniteMutatorOptions ) { // When passing as a boolean, it's explicitly used to disable/enable // revalidation.