Skip to content

Commit

Permalink
add some gio overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
jonath92 committed Jan 12, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 03b23cc commit cfdf3ff
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions extensions/Gio-2.0.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// See: https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/core/overrides/Gio.js
declare namespace imports.gi.Gio {
interface IDBusProxy {
disconnectSignal(id: number): void;
}

type ChangedVariable = `changed::${string}`;
interface ISettings {
/**
* The "changed" signal is emitted when a key has potentially changed.
interface IDBusProxy {
disconnectSignal(id: number): void;
}

type ChangedVariable = `changed::${string}`;
interface ISettings {
/**
* The "changed" signal is emitted when a key has potentially changed.
* You should call one of the g_settings_get() calls to check the new
* value.
*
@@ -17,6 +18,29 @@ declare namespace imports.gi.Gio {
* Note that #settings only emits this signal if you have read #key at
* least once while a signal handler was already connected for #key.
*/
connect(event: ChangedVariable, callback: (...args: any[]) => void): number;
}
connect(event: ChangedVariable, callback: (...args: any[]) => void): number;
}

interface IDBus {
readonly session: ReturnType<typeof bus_get_sync>
readonly system: ReturnType<typeof bus_get_sync>

get: typeof bus_get
get_finish: typeof bus_get_finish
get_sync: typeof bus_get_sync

own_name: typeof bus_own_name
own_name_on_connection: typeof bus_own_name_on_connection
unown_name: typeof bus_unown_name

watch_name: typeof bus_unwatch_name
watch_name_on_connection: typeof bus_watch_name_on_connection
unwatch_name: typeof bus_unwatch_name
}

const DBus: IDBus

function makeProxyWrapper<T>(interfaceXml: string):
(bus: DBusConnection, name: string, object_path: string, callback?: imports.gi.Gio.AsyncReadyCallback | null | undefined, flags?: DBusProxyFlags) => DBusProxy & T

}

0 comments on commit cfdf3ff

Please sign in to comment.