From a9dfa0d5a7e299ed5f074f911d3727c399aaf782 Mon Sep 17 00:00:00 2001 From: boerdereinar Date: Sat, 18 Oct 2025 03:11:45 +0200 Subject: [PATCH 1/3] Add ease_property types --- .../gnome-shell/src/extensions/global.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/gnome-shell/src/extensions/global.d.ts b/packages/gnome-shell/src/extensions/global.d.ts index af01f17..f2a82d1 100644 --- a/packages/gnome-shell/src/extensions/global.d.ts +++ b/packages/gnome-shell/src/extensions/global.d.ts @@ -114,6 +114,25 @@ declare module '@girs/clutter-17/clutter-17' { * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/54bc3aa4f54cb5452c29f81fada808224a18afa1/js/ui/environment.js#L286 */ ease(props: EasingParamsWithProperties): void; + + /** + * A convenience wrapper for {@link Clutter.PropertyTransition} + * + * @param propName The name of the property or any of the following: + * - @layout.property + * - @actions.name.property + * - @constraints.name.property + * - @content.property + * - @effects.name.property + * @param target The target value + * @param props Easing properties + * + * @version 49 + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/96e27f0e7d4e0c71976305d0d2c36a6c39d9853c/docs/js-coding-style.md#animations + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/54bc3aa4f54cb5452c29f81fada808224a18afa1/js/ui/environment.js#L289 + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/54bc3aa4f54cb5452c29f81fada808224a18afa1/js/ui/environment.js#L71 + */ + ease_property(propName: string, target: T, props: EasingParams): void; } } } From 351a3c5708a6d17137e37a32fc9bab40d5ef690c Mon Sep 17 00:00:00 2001 From: boerdereinar Date: Sat, 18 Oct 2025 03:36:10 +0200 Subject: [PATCH 2/3] Add connect and disconnect object types --- .../gnome-shell/src/extensions/global.d.ts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/packages/gnome-shell/src/extensions/global.d.ts b/packages/gnome-shell/src/extensions/global.d.ts index f2a82d1..41a304e 100644 --- a/packages/gnome-shell/src/extensions/global.d.ts +++ b/packages/gnome-shell/src/extensions/global.d.ts @@ -36,6 +36,36 @@ declare global { } } +declare module '@girs/gobject-2.0/gobject-2.0' { + export namespace GObject { + interface Object { + /** + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/54bc3aa4f54cb5452c29f81fada808224a18afa1/js/ui/environment.js#L245 + * @version 49 + */ + connectObject(...args: any[]): void; + + /** + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/54bc3aa4f54cb5452c29f81fada808224a18afa1/js/ui/environment.js#L248 + * @version 49 + */ + connect_object(...args: any[]): void; + + /** + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/54bc3aa4f54cb5452c29f81fada808224a18afa1/js/ui/environment.js#L251 + * @version 49 + */ + disconnectObject(...args: any[]): void; + + /** + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/54bc3aa4f54cb5452c29f81fada808224a18afa1/js/ui/environment.js#L254 + * @version 49 + */ + disconnect_object(...args: any[]): void; + } + } +} + /** * @version 46 */ From 73f251fe593d81c258bdf884d7b5d81b1501a536 Mon Sep 17 00:00:00 2001 From: boerdereinar Date: Sat, 18 Oct 2025 15:51:58 +0200 Subject: [PATCH 3/3] Update documentation --- .../gnome-shell/src/extensions/global.d.ts | 34 +++++++++++++- packages/gnome-shell/src/misc/signals.d.ts | 46 +++++++++++++++++-- 2 files changed, 74 insertions(+), 6 deletions(-) diff --git a/packages/gnome-shell/src/extensions/global.d.ts b/packages/gnome-shell/src/extensions/global.d.ts index 41a304e..19a5d5a 100644 --- a/packages/gnome-shell/src/extensions/global.d.ts +++ b/packages/gnome-shell/src/extensions/global.d.ts @@ -40,28 +40,58 @@ declare module '@girs/gobject-2.0/gobject-2.0' { export namespace GObject { interface Object { /** + * Connect one or more signals, and associate the handlers + * with a tracked object. + * + * All handlers for a particular object can be disconnected + * by calling disconnectObject(). If object is a {Clutter.widget}, + * this is done automatically when the widget is destroyed. + * + * @param args - a sequence of signal-name/handler pairs + * with an optional flags value, followed by an object to track + * * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/54bc3aa4f54cb5452c29f81fada808224a18afa1/js/ui/environment.js#L245 * @version 49 */ connectObject(...args: any[]): void; /** + * Connect one or more signals, and associate the handlers + * with a tracked object. + * + * All handlers for a particular object can be disconnected + * by calling disconnectObject(). If object is a {Clutter.widget}, + * this is done automatically when the widget is destroyed. + * + * @param args - a sequence of signal-name/handler pairs + * with an optional flags value, followed by an object to track + * * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/54bc3aa4f54cb5452c29f81fada808224a18afa1/js/ui/environment.js#L248 * @version 49 */ connect_object(...args: any[]): void; /** + * Disconnect all signals that were connected for + * the specified tracked object + * + * @param obj - the tracked object + * * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/54bc3aa4f54cb5452c29f81fada808224a18afa1/js/ui/environment.js#L251 * @version 49 */ - disconnectObject(...args: any[]): void; + disconnectObject(obj: object): void; /** + * Disconnect all signals that were connected for + * the specified tracked object + * + * @param obj - the tracked object + * * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/54bc3aa4f54cb5452c29f81fada808224a18afa1/js/ui/environment.js#L254 * @version 49 */ - disconnect_object(...args: any[]): void; + disconnect_object(obj: object): void; } } } diff --git a/packages/gnome-shell/src/misc/signals.d.ts b/packages/gnome-shell/src/misc/signals.d.ts index bc52ffb..09e6183 100644 --- a/packages/gnome-shell/src/misc/signals.d.ts +++ b/packages/gnome-shell/src/misc/signals.d.ts @@ -75,11 +75,49 @@ export interface EventEmitter = any> extends SignalMethod * @version 47 */ export class EventEmitter = any> { - connectObject(...args: any[]): number; // TODO: return type is return type of imports.misc.signalTracker.connectObject + /** + * Connect one or more signals, and associate the handlers + * with a tracked object. + * + * All handlers for a particular object can be disconnected + * by calling disconnectObject(). If object is a {Clutter.widget}, + * this is done automatically when the widget is destroyed. + * + * @param args - a sequence of signal-name/handler pairs + * with an optional flags value, followed by an object to track + * @returns + */ + connectObject(...args: any[]): void; - disconnectObject(...args: any[]): number; // TODO: return type is return type of imports.misc.signalTracker.disconnectObject + /** + * Disconnect all signals that were connected for + * the specified tracked object + * + * @param obj - the tracked object + * @returns + */ + disconnectObject(obj: object): void; - connect_object(...args: any[]): ReturnType; + /** + * Connect one or more signals, and associate the handlers + * with a tracked object. + * + * All handlers for a particular object can be disconnected + * by calling disconnectObject(). If object is a {Clutter.widget}, + * this is done automatically when the widget is destroyed. + * + * @param args - a sequence of signal-name/handler pairs + * with an optional flags value, followed by an object to track + * @returns + */ + connect_object(...args: any[]): void; - disconnect_object(...args: any[]): ReturnType; + /** + * Disconnect all signals that were connected for + * the specified tracked object + * + * @param obj - the tracked object + * @returns + */ + disconnect_object(obj: object): void; }