diff options
Diffstat (limited to 'gjs/src')
-rw-r--r-- | gjs/src/application.ts | 2 | ||||
-rw-r--r-- | gjs/src/astalify.ts | 2 | ||||
-rw-r--r-- | gjs/src/file.ts | 2 | ||||
-rw-r--r-- | gjs/src/widgets.ts | 17 |
4 files changed, 19 insertions, 4 deletions
diff --git a/gjs/src/application.ts b/gjs/src/application.ts index 7147856..4a184e1 100644 --- a/gjs/src/application.ts +++ b/gjs/src/application.ts @@ -82,4 +82,4 @@ class AstalJS extends Astal.Application { } } -export const App = new AstalJS +export default new AstalJS diff --git a/gjs/src/astalify.ts b/gjs/src/astalify.ts index f198f68..6df57b4 100644 --- a/gjs/src/astalify.ts +++ b/gjs/src/astalify.ts @@ -105,7 +105,7 @@ function hook( return self } -function ctor(self: any, config: any = {}, children: any[] = []) { +function ctor(self: any, config: any = {}, children: any = []) { const { setup, ...props } = config props.visible ??= true diff --git a/gjs/src/file.ts b/gjs/src/file.ts index 0825e31..d15474b 100644 --- a/gjs/src/file.ts +++ b/gjs/src/file.ts @@ -36,5 +36,5 @@ export function monitorFile( path: string, callback: (file: string, event: Gio.FileMonitorEvent) => void, ): Gio.FileMonitor { - return Astal.monitor_file(path, callback) + return Astal.monitor_file(path, callback)! } diff --git a/gjs/src/widgets.ts b/gjs/src/widgets.ts index e363da0..29c0044 100644 --- a/gjs/src/widgets.ts +++ b/gjs/src/widgets.ts @@ -1,14 +1,16 @@ /* eslint-disable max-len */ import { Astal, Gtk } from "./imports.js" -import astalify, { type ConstructProps } from "./astalify.js" +import astalify, { type ConstructProps, type Widget } from "./astalify.js" export { astalify, ConstructProps } // Box +export type Box = Widget<typeof Astal.Box> export const Box = astalify<typeof Astal.Box, BoxProps, "Box">(Astal.Box) export type BoxProps = ConstructProps<typeof Astal.Box, Astal.Box.ConstructorProperties> // Button +export type Button = Widget<typeof Astal.Button> export const Button = astalify<typeof Astal.Button, ButtonProps, "Button">(Astal.Button) export type ButtonProps = ConstructProps<typeof Astal.Button, Astal.Button.ConstructorProperties, { onClicked: [] @@ -20,18 +22,21 @@ export type ButtonProps = ConstructProps<typeof Astal.Button, Astal.Button.Const }> // CenterBox +export type CenterBox = Widget<typeof Astal.CenterBox> export const CenterBox = astalify<typeof Astal.CenterBox, CenterBoxProps, "CenterBox">(Astal.CenterBox) export type CenterBoxProps = ConstructProps<typeof Astal.CenterBox, Astal.CenterBox.ConstructorProperties> // TODO: CircularProgress // DrawingArea +export type DrawingArea = Widget<typeof Gtk.DrawingArea> export const DrawingArea = astalify<typeof Gtk.DrawingArea, DrawingAreaProps, "DrawingArea">(Gtk.DrawingArea) export type DrawingAreaProps = ConstructProps<typeof Gtk.DrawingArea, Gtk.DrawingArea.ConstructorProperties, { onDraw: [cr: any] // TODO: cairo types }> // Entry +export type Entry = Widget<typeof Gtk.Entry> export const Entry = astalify<typeof Gtk.Entry, EntryProps, "Entry">(Gtk.Entry) export type EntryProps = ConstructProps<typeof Gtk.Entry, Gtk.Entry.ConstructorProperties, { onChanged: [] @@ -39,6 +44,7 @@ export type EntryProps = ConstructProps<typeof Gtk.Entry, Gtk.Entry.ConstructorP }> // EventBox +export type EventBox = Widget<typeof Astal.EventBox> export const EventBox = astalify<typeof Astal.EventBox, EventBoxProps, "EventBox">(Astal.EventBox) export type EventBoxProps = ConstructProps<typeof Astal.EventBox, Astal.EventBox.ConstructorProperties, { onClick: [event: Astal.ClickEvent] @@ -52,41 +58,50 @@ export type EventBoxProps = ConstructProps<typeof Astal.EventBox, Astal.EventBox // TODO: FlowBox // Icon +export type Icon = Widget<typeof Astal.Icon> export const Icon = astalify<typeof Astal.Icon, IconProps, "Icon">(Astal.Icon) export type IconProps = ConstructProps<typeof Astal.Icon, Astal.Icon.ConstructorProperties> // Label +export type Label = Widget<typeof Gtk.Label> export const Label = astalify<typeof Gtk.Label, LabelProps, "Label">(Gtk.Label) export type LabelProps = ConstructProps<typeof Gtk.Label, Gtk.Label.ConstructorProperties> // LevelBar +export type LevelBar = Widget<typeof Astal.LevelBar> export const LevelBar = astalify<typeof Astal.LevelBar, LevelBarProps, "LevelBar">(Astal.LevelBar) export type LevelBarProps = ConstructProps<typeof Astal.LevelBar, Astal.LevelBar.ConstructorProperties> // TODO: ListBox // Overlay +export type Overlay = Widget<typeof Astal.Overlay> export const Overlay = astalify<typeof Astal.Overlay, OverlayProps, "Overlay">(Astal.Overlay) export type OverlayProps = ConstructProps<typeof Astal.Overlay, Astal.Overlay.ConstructorProperties> // Revealer +export type Revealer = Widget<typeof Gtk.Revealer> export const Revealer = astalify<typeof Gtk.Revealer, RevealerProps, "Revealer">(Gtk.Revealer) export type RevealerProps = ConstructProps<typeof Gtk.Revealer, Gtk.Revealer.ConstructorProperties> // Scrollable +export type Scrollable = Widget<typeof Astal.Scrollable> export const Scrollable = astalify<typeof Astal.Scrollable, ScrollableProps, "Scrollable">(Astal.Scrollable) export type ScrollableProps = ConstructProps<typeof Astal.Scrollable, Astal.Scrollable.ConstructorProperties> // Slider +export type Slider = Widget<typeof Astal.Slider> export const Slider = astalify<typeof Astal.Slider, SliderProps, "Slider">(Astal.Slider) export type SliderProps = ConstructProps<typeof Astal.Slider, Astal.Slider.ConstructorProperties> // TODO: Stack // Switch +export type Switch = Widget<typeof Gtk.Switch> export const Switch = astalify<typeof Gtk.Switch, SwitchProps, "Switch">(Gtk.Switch) export type SwitchProps = ConstructProps<typeof Gtk.Switch, Gtk.Switch.ConstructorProperties> // Window +export type Window = Widget<typeof Astal.Window> export const Window = astalify<typeof Astal.Window, WindowProps, "Window">(Astal.Window) export type WindowProps = ConstructProps<typeof Astal.Window, Astal.Window.ConstructorProperties> |