Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gnome 45 port #137

Merged
merged 11 commits into from
Nov 12, 2023
50 changes: 50 additions & 0 deletions @imports/extensions/extension.d.ts
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';
35 changes: 35 additions & 0 deletions @imports/extensions/prefs.d.ts
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';
119 changes: 119 additions & 0 deletions @imports/extensions/sharedInternals.d.ts
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;
}
91 changes: 0 additions & 91 deletions @imports/misc/extensionUtils.d.ts

This file was deleted.

5 changes: 3 additions & 2 deletions @imports/ui/lookingGlass.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as St from '@gi/St'
import * as Clutter from '@gi/Clutter'
import * as St from 'gi://St'
import * as Clutter from 'gi://Clutter'
export class Inspector extends Clutter.Actor {
constructor(looking_glass: any)
connect(signal: 'closed', cb: any);
open();
connect(signal: 'target', cb: (me: Inspector, target: Clutter.Actor, stageX: number, stageY: number) => void);
2 changes: 1 addition & 1 deletion @imports/ui/main.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LookingGlass } from "./lookingGlass";
import * as GObject from '@gi/GObject'
import * as GObject from 'gi://GObject'

export const createLookingGlass: () => LookingGlass;

4 changes: 2 additions & 2 deletions @imports/ui/windowManager.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WindowActor } from '@gi/Meta';
import { WM } from '@gi/Shell'
import { WindowActor } from 'gi://Meta';
import { WM } from 'gi://Shell'

declare function getWindowDimmer(actor: any): any;

7 changes: 4 additions & 3 deletions @imports/ui/windowPreview.d.ts
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
}
4 changes: 2 additions & 2 deletions @imports/ui/workspace.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Window } from '@gi/Meta'
import { Window } from 'gi://Meta'
import { WindowPreview } from './windowPreview'
import { Actor } from '@gi/Clutter';
import { Actor } from 'gi://Clutter';

export class Workspace extends Actor {
_addWindowClone(metaWindow: Window): WindowPreview;
15 changes: 10 additions & 5 deletions @imports/ui/workspaceAnimation.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { Window, WindowActor } from '@gi/Meta'
import { Actor, Clone } from '@gi/Clutter'
import { Window, WindowActor } from 'gi://Meta'
import { Actor, Clone } from 'gi://Clutter'
import * as St from 'gi://St'

export class WorkspaceAnimationController {
_movingWindow: Window;
_switchData: {
monitors: any[];
gestureActivated: boolean;
inProgress: boolean;
monitors: MonitorGroup[];
};
_swipeTracker: any;
_prepareWorkspaceSwitch(workspaceIndices: Array<number>): void;
_finishWorkspaceSwitch(switchData: typeof this._switchData): void;

}

export class WorkspaceGroup extends Actor {
@@ -22,3 +23,7 @@ export class WorkspaceGroup extends Actor {
_syncStacking(): void;
_shouldShowWindow(win: Window): boolean;
}

export class MonitorGroup extends St.Widget {
_workspaceGroups: WorkspaceGroup []
}
Loading