summaryrefslogtreecommitdiff
path: root/gjs/src/widgets.ts
diff options
context:
space:
mode:
Diffstat (limited to 'gjs/src/widgets.ts')
-rw-r--r--gjs/src/widgets.ts36
1 files changed, 36 insertions, 0 deletions
diff --git a/gjs/src/widgets.ts b/gjs/src/widgets.ts
new file mode 100644
index 0000000..abfbba8
--- /dev/null
+++ b/gjs/src/widgets.ts
@@ -0,0 +1,36 @@
+/* eslint-disable max-len */
+import Gtk from "gi://Gtk"
+import Astal from "gi://Astal"
+import astalify, { type ConstructProps, type Widget } from "./astalify.js"
+
+export { astalify }
+
+// Label
+export const Label = astalify<typeof Gtk.Label, LabelProps, "Label">(Gtk.Label)
+export type LabelProps = ConstructProps<typeof Gtk.Label, Gtk.Label.ConstructorProperties>
+
+// Icon
+export const Icon = astalify<typeof Astal.Icon, IconProps, "Icon">(Astal.Icon)
+export type IconProps = ConstructProps<typeof Astal.Icon, Astal.Icon.ConstructorProperties>
+
+// 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
+}>
+
+// Window
+export const Window = astalify<typeof Astal.Window, WindowProps, "Window">(Astal.Window)
+export type WindowProps = ConstructProps<typeof Astal.Window, Astal.Window.ConstructorProperties>
+
+// Box
+export const Box = astalify<typeof Astal.Box, BoxProps, "Box">(Astal.Box)
+export type BoxProps = ConstructProps<typeof Astal.Box, Astal.Box.ConstructorProperties>
+
+// CenterBox
+export const CenterBox = astalify<typeof Astal.CenterBox, CenterBoxProps, "CenterBox">(Astal.CenterBox)
+export type CenterBoxProps = ConstructProps<typeof Astal.CenterBox, Astal.CenterBox.ConstructorProperties>
+
+// EventBox
+export const EventBox = astalify<typeof Astal.EventBox, EventBoxProps, "EventBox">(Astal.EventBox)
+export type EventBoxProps = ConstructProps<typeof Astal.EventBox, Astal.EventBox.ConstructorProperties>