From 07df3f97bbcfe2f6f77e3fbf1511a0e6d2a17390 Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Thu, 13 Jul 2023 13:00:48 +0200 Subject: [PATCH] Reduce amount of any keyword needed --- src/AsyncButton.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.51.2