From 3435ea6cfef6ea9de5933d7a774a9a051c7a36b3 Mon Sep 17 00:00:00 2001 From: Jan Andrle Date: Mon, 3 Mar 2025 15:10:20 +0100 Subject: [PATCH] :bug: Better types for on* --- index.d.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index 63effa8..c256a54 100644 --- a/index.d.ts +++ b/index.d.ts @@ -52,9 +52,12 @@ type IsReadonly = * @private */ type ElementAttributes= Partial<{ - [K in keyof _fromElsInterfaces]: IsReadonly<_fromElsInterfaces, K> extends false - ? _fromElsInterfaces[K] | ddeSignal<_fromElsInterfaces[K]> - : ddeStringable + [K in keyof _fromElsInterfaces]: + _fromElsInterfaces[K] extends ((...p: any[])=> any) + ? _fromElsInterfaces[K] | ((...p: Parameters<_fromElsInterfaces[K]>)=> ddeSignal[K]>>) + : (IsReadonly<_fromElsInterfaces, K> extends false + ? _fromElsInterfaces[K] | ddeSignal<_fromElsInterfaces[K]> + : ddeStringable) } & AttrsModified> & Record; export function classListDeclarative( element: El,