From 09568ac7382da54f721c8c80496ee27b63b9d15e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dias?= Date: Thu, 28 Aug 2025 06:25:33 -0300 Subject: [PATCH] :boom: fix(modules/backlight): use paramspec instead of read-only $gtype --- src/modules/backlight.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/modules/backlight.ts b/src/modules/backlight.ts index fa81f9b..fac9e18 100644 --- a/src/modules/backlight.ts +++ b/src/modules/backlight.ts @@ -7,11 +7,17 @@ import Gio from "gi://Gio?version=2.0"; export namespace Backlights { + const BacklightsParamSpec = (name: string, flags: GObject.ParamFlags) => + GObject.ParamSpec.object(name, null, null, flags) as ParamSpec; + + const BacklightParamSpec = (name: string, flags: GObject.ParamFlags) => + GObject.ParamSpec.object(name, null, null, flags) as ParamSpec; + let instance: Backlights; export function getDefault(): Backlights { if(!instance) - instance = new Backlights; + instance = new Backlights(); return instance; } @@ -22,7 +28,6 @@ export namespace Backlights { GTypeName: "Backlights" }, this); } - public static $gtype: GObject.GType; #backlights: Array = []; @@ -33,8 +38,8 @@ export namespace Backlights { @getter(Array as unknown as ParamSpec>) get backlights() { return this.#backlights; } - @getter(GObject.Object as unknown as ParamSpec) - get default() { return this.#default; } + @getter(BacklightParamSpec) + get default() { return this.#default!; } /** true if there are any backlights available */ @getter(Boolean) @@ -102,7 +107,8 @@ export namespace Backlights { GTypeName: "Backlight" }, this); } - public static $gtype: GObject.GType; + + declare $signals: GObject.Object.SignalSignatures & { "brightness-changed": (value: number) => void };