diff options
author | Aylur <[email protected]> | 2024-10-16 12:47:38 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-10-16 12:47:38 +0200 |
commit | c012b5699afd401942e1044c204fb6a666d0a094 (patch) | |
tree | 5cd27e5162a84f2ee5310fc698d7b50ee08eddf0 /docs/guide | |
parent | 2ad95e05d83a455bb30503ca4ca0aa8356ea5ff7 (diff) | |
parent | 8368b20eda96674e0f5a502b92d3afb936b71b0b (diff) |
Merge branch 'main' into fix/fuzzy-search
Diffstat (limited to 'docs/guide')
-rw-r--r-- | docs/guide/typescript/widget.md | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/guide/typescript/widget.md b/docs/guide/typescript/widget.md index d16d194..3bdf394 100644 --- a/docs/guide/typescript/widget.md +++ b/docs/guide/typescript/widget.md @@ -104,13 +104,14 @@ The `astalify` mixin will apply the following: - sets up signal handlers that are passed as props prefixed with `on` ```tsx -import { Widget, Gtk, GObject, Gdk } from "astal/gtk3" +import GObject from "gi://GObject" +import { Gtk, Gdk, Widget, astalify, type ConstructProps } from "astal/gtk3" // subclass, register, define constructor props -class ColorButton extends Widget.astalify(Gtk.ColorButton) { +class ColorButton extends astalify(Gtk.ColorButton) { static { GObject.registerClass(this) } - constructor(props: Widget.ConstructProps< + constructor(props: ConstructProps< ColorButton, Gtk.ColorButton.ConstructorProps, { onColorSet: [] } // signals of Gtk.ColorButton have to be manually typed @@ -152,7 +153,8 @@ Type of widgets are available through `Widget`. Here is an example Widget that takes in and handles a possibly `Binding` prop. ```tsx -import { Binding, Variable, Widget } from "astal" +import { Binding, Variable } from "astal" +import { Widget } from "astal/gtk3" export interface ToggleButtonProps extends Widget.ButtonProps { onToggled?: (self: Widget.Button, on: boolean) => void |