diff --git a/src/AsyncButton.tsx b/src/AsyncButton.tsx index 7d857bc..44180d1 100644 --- a/src/AsyncButton.tsx +++ b/src/AsyncButton.tsx @@ -7,7 +7,10 @@ type Config = Omit< 'as' | 'onClick' >; -type AsyncMaybe any) | unknown> = T extends (...args: any[]) => any +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type AnyFunction = (...args: any[]) => void; + +type AsyncMaybe = T extends AnyFunction ? (...args: Parameters) => ReturnType | Promise> : never;