-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extensionUtils.d.ts have been removed in gnome 45
- Loading branch information
Showing
12 changed files
with
234 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// auto generate by tsc: | ||
// tsc -d --allowJs /path/to/source/of/gnome-shell/js/extensions/* | ||
|
||
export class Extension extends ExtensionBase { | ||
static lookupByUUID(uuid: any): any; | ||
static defineTranslationFunctions(url: any): { | ||
gettext: any; | ||
ngettext: any; | ||
pgettext: any; | ||
}; | ||
enable(): void; | ||
disable(): void; | ||
/** | ||
* Open the extension's preferences window | ||
*/ | ||
openPreferences(): void; | ||
} | ||
export const gettext: any; | ||
export const ngettext: any; | ||
export const pgettext: any; | ||
export class InjectionManager { | ||
/** | ||
* @callback CreateOverrideFunc | ||
* @param {Function?} originalMethod - the original method if it exists | ||
* @returns {Function} - a function to be used as override | ||
*/ | ||
/** | ||
* Modify, replace or inject a method | ||
* | ||
* @param {object} prototype - the object (or prototype) that is modified | ||
* @param {string} methodName - the name of the overwritten method | ||
* @param {CreateOverrideFunc} createOverrideFunc - function to call to create the override | ||
*/ | ||
overrideMethod(prototype: object, methodName: string, createOverrideFunc: (originalMethod: Function | null) => Function): void; | ||
/** | ||
* Restore the original method | ||
* | ||
* @param {object} prototype - the object (or prototype) that is modified | ||
* @param {string} methodName - the name of the method to restore | ||
*/ | ||
restoreMethod(prototype: object, methodName: string): void; | ||
/** | ||
* Restore all original methods and clear overrides | ||
*/ | ||
clear(): void; | ||
_saveMethod(prototype: any, methodName: any): any; | ||
_installMethod(prototype: any, methodName: any, method: any): void; | ||
#private; | ||
} | ||
import { ExtensionBase } from './sharedInternals.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import * as Gtk from '@gi-types/gtk4' | ||
import * as Adw from '@gi-types/adw1' | ||
|
||
// auto generate by tsc: | ||
// tsc -d --allowJs /path/to/source/of/gnome-shell/js/extensions/* | ||
|
||
export class ExtensionPreferences extends ExtensionBase { | ||
static lookupByUUID(uuid: any): any; | ||
static defineTranslationFunctions(url: any): { | ||
gettext: any; | ||
ngettext: any; | ||
pgettext: any; | ||
}; | ||
/** | ||
* Get the single widget that implements | ||
* the extension's preferences. | ||
* | ||
* @returns {Gtk.Widget} | ||
*/ | ||
getPreferencesWidget(): Gtk.Widget; | ||
/** | ||
* Fill the preferences window with preferences. | ||
* | ||
* The default implementation adds the widget | ||
* returned by getPreferencesWidget(). | ||
* | ||
* @param {Adw.PreferencesWindow} window - the preferences window | ||
*/ | ||
fillPreferencesWindow(window: Adw.PreferencesWindow): void; | ||
_wrapWidget(widget: any): any; | ||
} | ||
export const gettext: any; | ||
export const ngettext: any; | ||
export const pgettext: any; | ||
import { ExtensionBase } from './sharedInternals.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
import * as Gio from '@gi-types/gio2' | ||
|
||
// auto generate by tsc: | ||
// tsc -d --allowJs /path/to/source/of/gnome-shell/js/extensions/* | ||
|
||
export class ExtensionBase { | ||
/** | ||
* Look up an extension by URL (usually 'import.meta.url') | ||
* | ||
* @param {string} url - a file:// URL | ||
*/ | ||
static lookupByURL(url: string): ExtensionBase; | ||
/** | ||
* Look up an extension by UUID | ||
* | ||
* @param {string} _uuid | ||
*/ | ||
static lookupByUUID(_uuid: string): void; | ||
/** | ||
* @param {object} metadata - metadata passed in when loading the extension | ||
*/ | ||
constructor(metadata: object); | ||
metadata: any; | ||
/** | ||
* @type {string} | ||
*/ | ||
get uuid(): string; | ||
/** | ||
* @type {Gio.File} | ||
*/ | ||
get dir(): Gio.File; | ||
/** | ||
* @type {string} | ||
*/ | ||
get path(): string; | ||
/** | ||
* Get a GSettings object for schema, using schema files in | ||
* extensionsdir/schemas. If schema is omitted, it is taken | ||
* from metadata['settings-schema']. | ||
* | ||
* @param {string=} schema - the GSettings schema id | ||
* | ||
* @returns {Gio.Settings} | ||
*/ | ||
getSettings(schema?: string | undefined): Gio.Settings; | ||
/** | ||
* Initialize Gettext to load translations from extensionsdir/locale. If | ||
* domain is not provided, it will be taken from metadata['gettext-domain'] | ||
* if provided, or use the UUID | ||
* | ||
* @param {string=} domain - the gettext domain to use | ||
*/ | ||
initTranslations(domain?: string | undefined): void; | ||
/** | ||
* Translate `str` using the extension's gettext domain | ||
* | ||
* @param {string} str - the string to translate | ||
* | ||
* @returns {string} the translated string | ||
*/ | ||
gettext(str: string): string; | ||
/** | ||
* Translate `str` and choose plural form using the extension's | ||
* gettext domain | ||
* | ||
* @param {string} str - the string to translate | ||
* @param {string} strPlural - the plural form of the string | ||
* @param {number} n - the quantity for which translation is needed | ||
* | ||
* @returns {string} the translated string | ||
*/ | ||
ngettext(str: string, strPlural: string, n: number): string; | ||
/** | ||
* Translate `str` in the context of `context` using the extension's | ||
* gettext domain | ||
* | ||
* @param {string} context - context to disambiguate `str` | ||
* @param {string} str - the string to translate | ||
* | ||
* @returns {string} the translated string | ||
*/ | ||
pgettext(context: string, str: string): string; | ||
#private; | ||
} | ||
export class GettextWrapper { | ||
constructor(extensionClass: any, url: any); | ||
defineTranslationFunctions(): { | ||
/** | ||
* Translate `str` using the extension's gettext domain | ||
* | ||
* @param {string} str - the string to translate | ||
* | ||
* @returns {string} the translated string | ||
*/ | ||
gettext: any; | ||
/** | ||
* Translate `str` and choose plural form using the extension's | ||
* gettext domain | ||
* | ||
* @param {string} str - the string to translate | ||
* @param {string} strPlural - the plural form of the string | ||
* @param {number} n - the quantity for which translation is needed | ||
* | ||
* @returns {string} the translated string | ||
*/ | ||
ngettext: any; | ||
/** | ||
* Translate `str` in the context of `context` using the extension's | ||
* gettext domain | ||
* | ||
* @param {string} context - context to disambiguate `str` | ||
* @param {string} str - the string to translate | ||
* | ||
* @returns {string} the translated string | ||
*/ | ||
pgettext: any; | ||
}; | ||
#private; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import * as Shell from '@gi/Shell' | ||
import * as Meta from '@gi/Meta' | ||
import * as Shell from 'gi://Shell' | ||
import * as Meta from 'gi://Meta' | ||
|
||
export class WindowPreview extends Shell.WindowPreview { | ||
export class WindowPreview extends Shell.WindowPreview { | ||
[x: string]: any | ||
_addWindow (_: Meta.Window): void; | ||
_windowActor: Meta.WindowActor | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.