From 776fc8093272ad29c20dfbcf8b7dfedfbc9bb2aa Mon Sep 17 00:00:00 2001 From: Aylur Date: Wed, 29 May 2024 21:36:40 +0200 Subject: improve ts types --- node/src/astalify.ts | 6 ++++-- node/src/widgets.ts | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'node/src') diff --git a/node/src/astalify.ts b/node/src/astalify.ts index 3bd00eb..bae6cc7 100644 --- a/node/src/astalify.ts +++ b/node/src/astalify.ts @@ -170,10 +170,12 @@ type BindableProps = { export type ConstructProps< Self extends { new(...args: any[]): any }, Props = unknown, - Signals = unknown + Signals extends Record> = Record > = { [Key in `on${string}`]: (self: Widget) => unknown -} & Partial & BindableProps, ...args: Signals[sig]) => unknown +}> & BindableProps(Gtk.Label) @@ -17,7 +17,7 @@ export type IconProps = ConstructProps(Astal.Button) export type ButtonProps = ConstructProps) => void + onClicked: [] }> // Window -- cgit v1.2.3