Skip to content

Commit

Permalink
Merge pull request #51 from gjsify/update-types-v47
Browse files Browse the repository at this point in the history
Adapt typings for Gnome 47 release
  • Loading branch information
swsnr authored Sep 22, 2024
2 parents 3551f96 + 0ea740a commit f79c918
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
11 changes: 11 additions & 0 deletions packages/gnome-shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,17 @@
}
},
"./misc/systemActions/ambient": "./dist/misc/systemActions-ambient.d.ts",
"./misc/util": {
"import": {
"types": "./dist/misc/util.d.ts",
"default": "./dist/misc/util.js"
},
"require": {
"types": "./dist/misc/util.d.ts",
"default": "./dist/misc/util.cjs"
}
},
"./misc/util/ambient": "./dist/misc/util-ambient.d.ts",
"./ui/accessDialog": {
"import": {
"types": "./dist/ui/accessDialog.d.ts",
Expand Down
10 changes: 6 additions & 4 deletions packages/gnome-shell/src/extensions/prefs.d.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import type Adw from '@girs/adw-1';
import type Gtk from '@girs/gtk-4.0';

import type { Extension } from './extension.js';
import type { ExtensionBase, TranslationFunctions } from './sharedInternals.js';

/**
* @version 47
*/
export class ExtensionPreferences extends ExtensionBase {
static defineTranslationFunctions(url: string): TranslationFunctions;

/**
* Get the single widget that implements
* the extension's preferences.
*
* @returns {Gtk.Widget}
* @returns {Gtk.Widget|Promise<Gtk.Widget>}
* @throws {GObject.NotImplementedError}
*/
getPreferencesWidget(): Gtk.Widget;
getPreferencesWidget(): Gtk.Widget | Promise<Gtk.Widget>;

/**
* Fill the preferences window with preferences.
Expand All @@ -24,7 +26,7 @@ export class ExtensionPreferences extends ExtensionBase {
*
* @param {Adw.PreferencesWindow} window - the preferences window
*/
fillPreferencesWindow(window: Adw.PreferencesWindow): void;
fillPreferencesWindow(window: Adw.PreferencesWindow): Promise<void>;
}

export declare const gettext: TranslationFunctions['gettext'];
Expand Down
12 changes: 12 additions & 0 deletions packages/gnome-shell/src/misc/util.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Fix up embedded markup so that it can be displayed correctly in
* UI elements such as the message list. In some cases, we might want to
* keep some of the embedded markup, so specify allowMarkup for that case
*
* @version 47
*
* @param {string} text containing markup to escape and parse
* @param {boolean} allowMarkup to allow embedded markup or just escape it all
* @returns the escaped string
*/
export function fixMarkup(text: string, allowMarkup?: boolean): string;
5 changes: 0 additions & 5 deletions packages/gnome-shell/src/ui/messageList.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type GLib from '@girs/glib-2.0';
import type St from '@girs/st-15';
import type Clutter from '@girs/clutter-15';

/**
* @version 46
*/
export function _fixMarkup(text: string, allowMarkup?: boolean): string;

/**
* @version 46
*/
Expand Down

0 comments on commit f79c918

Please sign in to comment.