From 50a6ab67843122452cdc3348031d44116992d492 Mon Sep 17 00:00:00 2001 From: Aylur Date: Thu, 11 Jul 2024 16:12:06 +0200 Subject: few touchups --- gjs/src/application.ts | 2 +- gjs/src/astalify.ts | 2 +- gjs/src/file.ts | 2 +- gjs/src/widgets.ts | 17 ++++++++++++++++- 4 files changed, 19 insertions(+), 4 deletions(-) (limited to 'gjs/src') 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 export const Box = astalify(Astal.Box) export type BoxProps = ConstructProps // Button +export type Button = Widget export const Button = astalify(Astal.Button) export type ButtonProps = ConstructProps // CenterBox +export type CenterBox = Widget export const CenterBox = astalify(Astal.CenterBox) export type CenterBoxProps = ConstructProps // TODO: CircularProgress // DrawingArea +export type DrawingArea = Widget export const DrawingArea = astalify(Gtk.DrawingArea) export type DrawingAreaProps = ConstructProps // Entry +export type Entry = Widget export const Entry = astalify(Gtk.Entry) export type EntryProps = ConstructProps // EventBox +export type EventBox = Widget export const EventBox = astalify(Astal.EventBox) export type EventBoxProps = ConstructProps export const Icon = astalify(Astal.Icon) export type IconProps = ConstructProps // Label +export type Label = Widget export const Label = astalify(Gtk.Label) export type LabelProps = ConstructProps // LevelBar +export type LevelBar = Widget export const LevelBar = astalify(Astal.LevelBar) export type LevelBarProps = ConstructProps // TODO: ListBox // Overlay +export type Overlay = Widget export const Overlay = astalify(Astal.Overlay) export type OverlayProps = ConstructProps // Revealer +export type Revealer = Widget export const Revealer = astalify(Gtk.Revealer) export type RevealerProps = ConstructProps // Scrollable +export type Scrollable = Widget export const Scrollable = astalify(Astal.Scrollable) export type ScrollableProps = ConstructProps // Slider +export type Slider = Widget export const Slider = astalify(Astal.Slider) export type SliderProps = ConstructProps // TODO: Stack // Switch +export type Switch = Widget export const Switch = astalify(Gtk.Switch) export type SwitchProps = ConstructProps // Window +export type Window = Widget export const Window = astalify(Astal.Window) export type WindowProps = ConstructProps -- cgit v1.2.3