diff options
Diffstat (limited to 'gjs')
-rw-r--r-- | gjs/src/astalify.ts | 6 | ||||
-rw-r--r-- | gjs/src/widgets.ts | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/gjs/src/astalify.ts b/gjs/src/astalify.ts index 3cf662d..3a613a5 100644 --- a/gjs/src/astalify.ts +++ b/gjs/src/astalify.ts @@ -175,10 +175,12 @@ type BindableProps<T> = { export type ConstructProps< Self extends { new(...args: any[]): any }, Props = unknown, - Signals = unknown + Signals extends Record<string, Array<unknown>> = Record<string, []> > = { [Key in `on${string}`]: (self: Widget<Self>) => unknown -} & Partial<Signals> & BindableProps<Props & { +} & Partial<{ + [sig in keyof Signals]: (self: Widget<Self>, ...args: Signals[sig]) => unknown +}> & BindableProps<Props & { className?: string css?: string cursor?: string diff --git a/gjs/src/widgets.ts b/gjs/src/widgets.ts index ca71df1..e8adf65 100644 --- a/gjs/src/widgets.ts +++ b/gjs/src/widgets.ts @@ -1,8 +1,8 @@ /* eslint-disable max-len */ import { Astal, Gtk } from "./imports.js" -import astalify, { type ConstructProps, type Widget } from "./astalify.js" +import astalify, { type ConstructProps } from "./astalify.js" -export { astalify } +export { astalify, ConstructProps } // Label export const Label = astalify<typeof Gtk.Label, LabelProps, "Label">(Gtk.Label) @@ -15,7 +15,7 @@ export type IconProps = ConstructProps<typeof Astal.Icon, Astal.Icon.Constructor // Button export const Button = astalify<typeof Astal.Button, ButtonProps, "Button">(Astal.Button) export type ButtonProps = ConstructProps<typeof Astal.Button, Astal.Button.ConstructorProperties, { - onClicked: (self: Widget<typeof Astal.Button>) => void + onClicked: [] }> // Window |