From 6fbc0ea7a361a387db5d3c516a6adf8e643aa246 Mon Sep 17 00:00:00 2001 From: Pascal Garber Date: Wed, 3 Jan 2024 17:12:49 +0100 Subject: [PATCH] Fix global interfaces and example --- examples/hello-world/src/extension.ts | 2 +- .../gnome-shell/src/extensions/global.d.ts | 46 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/examples/hello-world/src/extension.ts b/examples/hello-world/src/extension.ts index 95851ec..388267c 100644 --- a/examples/hello-world/src/extension.ts +++ b/examples/hello-world/src/extension.ts @@ -2,7 +2,7 @@ import '@girs/gjs'; // For global types like `log()` import St from '@girs/st-13'; import GObject from '@girs/gobject-2.0'; -import "@girs/gnome-shell/global"; // For global shell types +import "@girs/gnome-shell/extensions/global"; // For global shell types import { Extension, gettext as _ } from '@girs/gnome-shell/extensions/extension'; import * as panelMenu from '@girs/gnome-shell/ui/panelMenu'; import { PopupMenuItem } from '@girs/gnome-shell/ui/popupMenu'; diff --git a/packages/gnome-shell/src/extensions/global.d.ts b/packages/gnome-shell/src/extensions/global.d.ts index 8227d34..da4136c 100644 --- a/packages/gnome-shell/src/extensions/global.d.ts +++ b/packages/gnome-shell/src/extensions/global.d.ts @@ -7,28 +7,28 @@ declare global { * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/8a8539ee6766058b39d0a5c0961a08f76799f4da/js/ui/environment.js#L253 */ const global: Shell.Global; -} -// Gnome shell monkey-patches format into `String` which is the recommended way to use formatting for translatable strings. -// See https://gjs.guide/extensions/development/translations.html#marking-strings-for-translation -interface String { - /** - * Format this string with the given `args`. - * - * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/8a8539ee6766058b39d0a5c0961a08f76799f4da/js/ui/environment.js#L355 - * @param args - */ - format(...args: any[]): string; -} + // Gnome shell monkey-patches format into `String` which is the recommended way to use formatting for translatable strings. + // See https://gjs.guide/extensions/development/translations.html#marking-strings-for-translation + interface String { + /** + * Format this string with the given `args`. + * + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/8a8539ee6766058b39d0a5c0961a08f76799f4da/js/ui/environment.js#L355 + * @param args + */ + format(...args: any[]): string; + } -interface Math { - /** - * Returns {@link x} clamped to the inclusive range of {@link min} and {@link max}. - * - * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/8a8539ee6766058b39d0a5c0961a08f76799f4da/js/ui/environment.js#L357 - * @param x The value to be clamped. - * @param min The lower bound of the result. - * @param max The upper bound of the result. - */ - clamp(x: number, min: number, max: number): number; -} + interface Math { + /** + * Returns {@link x} clamped to the inclusive range of {@link min} and {@link max}. + * + * @see https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/8a8539ee6766058b39d0a5c0961a08f76799f4da/js/ui/environment.js#L357 + * @param x The value to be clamped. + * @param min The lower bound of the result. + * @param max The upper bound of the result. + */ + clamp(x: number, min: number, max: number): number; + } +} \ No newline at end of file