[AGS] Cleanup

This commit is contained in:
Janis Hutz 2025-04-25 16:58:19 +02:00
parent 9f754b454b
commit 19d59347b6
201 changed files with 47 additions and 1916124 deletions

View File

@ -1,7 +0,0 @@
#!/bin/sh
# Read file in ~/.config and check if on laptop or desktop
# hyprpm update
# hyprpm add https://github.com/micha4w/Hypr-DarkWindow
# hyprpm enable Hypr-DarkWindow
# hyprpm reload

File diff suppressed because it is too large Load Diff

View File

@ -1,944 +0,0 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AccountsService?version=1.0' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AccountsService {
/**
* AccountsService-1.0
*/
/**
* Type of user account
*/
/**
* Type of user account
*/
export namespace UserAccountType {
export const $gtype: GObject.GType<UserAccountType>;
}
enum UserAccountType {
/**
* Normal non-administrative user
*/
STANDARD,
/**
* Administrative user
*/
ADMINISTRATOR,
}
/**
* Various error codes returned by the accounts service.
*/
class UserManagerError extends GLib.Error {
static $gtype: GObject.GType<UserManagerError>;
// Static fields
/**
* Generic failure
*/
static FAILED: number;
/**
* The user already exists
*/
static USER_EXISTS: number;
/**
* The user does not exist
*/
static USER_DOES_NOT_EXIST: number;
/**
* Permission denied
*/
static PERMISSION_DENIED: number;
/**
* Operation not supported
*/
static NOT_SUPPORTED: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
static quark(): GLib.Quark;
}
/**
* Mode for setting the user's password.
*/
/**
* Mode for setting the user's password.
*/
export namespace UserPasswordMode {
export const $gtype: GObject.GType<UserPasswordMode>;
}
enum UserPasswordMode {
/**
* Password set normally
*/
REGULAR,
/**
* Password will be chosen at next login
*/
SET_AT_LOGIN,
/**
* No password set
*/
NONE,
}
function user_manager_error_quark(): GLib.Quark;
namespace User {
// Signal callback interfaces
interface Changed {
(): void;
}
interface SessionsChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
account_type: number;
accountType: number;
automatic_login: boolean;
automaticLogin: boolean;
email: string;
home_directory: string;
homeDirectory: string;
icon_file: string;
iconFile: string;
is_loaded: boolean;
isLoaded: boolean;
language: string;
local_account: boolean;
localAccount: boolean;
location: string;
locked: boolean;
login_frequency: number;
loginFrequency: number;
login_history: GLib.Variant;
loginHistory: GLib.Variant;
login_time: number;
loginTime: number;
nonexistent: boolean;
password_hint: string;
passwordHint: string;
password_mode: number;
passwordMode: number;
real_name: string;
realName: string;
shell: string;
system_account: boolean;
systemAccount: boolean;
uid: number;
user_name: string;
userName: string;
x_session: string;
xSession: string;
}
}
/**
* Represents a user account on the system.
*/
class User extends GObject.Object {
static $gtype: GObject.GType<User>;
// Properties
get account_type(): number;
get accountType(): number;
get automatic_login(): boolean;
get automaticLogin(): boolean;
get email(): string;
get home_directory(): string;
get homeDirectory(): string;
get icon_file(): string;
get iconFile(): string;
get is_loaded(): boolean;
get isLoaded(): boolean;
/**
* The users locale, in the format
* `language[_territory][.codeset][`modifier]``, where `language` is an
* ISO 639 language code, `territory` is an ISO 3166 country code, and
* `codeset` is a character set or encoding identifier like `ISO-8859-1`
* or `UTF-8`; as specified by [`setlocale(3)`](man:setlocale(3)).
*
* The locale may be the empty string, which means the user is using the
* system default locale.
*
* The property may be %NULL if it wasnt possible to load it from the
* daemon.
*/
get language(): string;
get local_account(): boolean;
get localAccount(): boolean;
get location(): string;
get locked(): boolean;
get login_frequency(): number;
get loginFrequency(): number;
get login_history(): GLib.Variant;
get loginHistory(): GLib.Variant;
get login_time(): number;
get loginTime(): number;
get nonexistent(): boolean;
get password_hint(): string;
get passwordHint(): string;
get password_mode(): number;
get passwordMode(): number;
get real_name(): string;
get realName(): string;
get shell(): string;
get system_account(): boolean;
get systemAccount(): boolean;
get uid(): number;
get user_name(): string;
get userName(): string;
get x_session(): string;
get xSession(): string;
// Constructors
constructor(properties?: Partial<User.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
connect(signal: 'sessions-changed', callback: (_source: this) => void): number;
connect_after(signal: 'sessions-changed', callback: (_source: this) => void): number;
emit(signal: 'sessions-changed'): void;
// Methods
/**
* Organize the user by login frequency and names.
* @param user2 a user
* @returns negative if @user1 is before @user2, zero if equal or positive if @user1 is after @user2
*/
collate(user2: User): number;
/**
* Retrieves the account type of `user`.
* @returns a #ActUserAccountType
*/
get_account_type(): UserAccountType;
/**
* Returns whether or not #ActUser is automatically logged in at boot time.
* @returns %TRUE or %FALSE
*/
get_automatic_login(): boolean;
/**
* Retrieves the email address set by `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_email(): string;
/**
* Retrieves the home directory for `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_home_dir(): string;
/**
* Returns the path to the account icon belonging to `user`.
* @returns a path to an icon
*/
get_icon_file(): string;
/**
* Returns the value of #ActUser:language.
* @returns the users language, or the empty string if they are using the system default language, or %NULL if there is no connection to the daemon
*/
get_language(): string | null;
/**
* Returns the value of #ActUser:languages.
* @returns the users preferred languages, or the empty string if they are using the system default language, or %NULL if there is no connection to the daemon
*/
get_languages(): string[] | null;
/**
* Retrieves the location set by `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_location(): string;
/**
* Returns whether or not the #ActUser account is locked.
* @returns %TRUE or %FALSE
*/
get_locked(): boolean;
/**
* Returns the number of times `user` has logged in.
* @returns the login frequency
*/
get_login_frequency(): number;
/**
* Returns the login history for `user`.
* @returns a pointer to GVariant of type "a(xxa{sv})" which must not be modified or freed, or %NULL.
*/
get_login_history(): GLib.Variant;
/**
* Returns the last login time for `user`.
* @returns the login time
*/
get_login_time(): number;
/**
* Get the number of sessions for a user that are graphical and on the
* same seat as the session of the calling process.
* @returns the number of sessions
*/
get_num_sessions(): number;
/**
* Get the number of sessions for a user on any seat of any type.
* See also act_user_get_num_sessions().
*
* (Currently, this function is only implemented for systemd-logind.
* For ConsoleKit, it is equivalent to act_user_get_num_sessions.)
* @returns the number of sessions
*/
get_num_sessions_anywhere(): number;
/**
* Returns the user accounts service object path of `user,`
* or %NULL if `user` doesn't have an object path associated
* with it.
* @returns the object path of the user
*/
get_object_path(): string;
/**
* Get the password expiration policy for a user.
*
* Note this function is synchronous and ignores errors.
*/
get_password_expiration_policy(): [number, number, number, number, number, number];
/**
* Retrieves the password hint set by `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_password_hint(): string;
/**
* Retrieves the password mode of `user`.
* @returns a #ActUserPasswordMode
*/
get_password_mode(): UserPasswordMode;
/**
* Returns the id of the primary session of `user,` or %NULL if `user`
* has no primary session. The primary session will always be
* graphical and will be chosen from the sessions on the same seat as
* the seat of the session of the calling process.
* @returns the id of the primary session of the user
*/
get_primary_session_id(): string;
/**
* Retrieves the display name of `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_real_name(): string;
/**
* Returns whether or not the #ActUser account has retained state in accountsservice.
* @returns %TRUE or %FALSE
*/
get_saved(): boolean;
/**
* Returns the path to the configured session for `user`.
* @returns a path to an icon
*/
get_session(): string;
/**
* Returns the type of the configured session for `user`.
* @returns a path to an icon
*/
get_session_type(): string;
/**
* Retrieves the shell assigned to `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_shell(): string;
/**
* Retrieves the ID of `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_uid(): number;
/**
* Retrieves the login name of `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_user_name(): string;
/**
* Returns the path to the configured X session for `user`.
* @returns a path to an icon
*/
get_x_session(): string;
/**
* Retrieves whether the user is a local account or not.
* @returns %TRUE if the user is local
*/
is_local_account(): boolean;
/**
* Returns whether or not #ActUser is currently graphically logged in
* on the same seat as the seat of the session of the calling process.
* @returns %TRUE or %FALSE
*/
is_logged_in(): boolean;
/**
* Returns whether or not #ActUser is currently logged in in any way
* whatsoever. See also act_user_is_logged_in().
*
* (Currently, this function is only implemented for systemd-logind.
* For ConsoleKit, it is equivalent to act_user_is_logged_in.)
* @returns %TRUE or %FALSE
*/
is_logged_in_anywhere(): boolean;
/**
* Retrieves whether the user is nonexistent or not.
* @returns %TRUE if the user is nonexistent
*/
is_nonexistent(): boolean;
/**
* Returns whether or not #ActUser represents a 'system account' like
* 'root' or 'nobody'.
* @returns %TRUE or %FALSE
*/
is_system_account(): boolean;
/**
* Changes the account type of `user`.
*
* Note this function is synchronous and ignores errors.
* @param account_type a #ActUserAccountType
*/
set_account_type(account_type: UserAccountType | null): void;
/**
* If enabled is set to %TRUE then this user will automatically be logged in
* at boot up time. Only one user can be configured to auto login at any given
* time, so subsequent calls to act_user_set_automatic_login() override previous
* calls.
*
* Note this function is synchronous and ignores errors.
* @param enabled whether or not to autologin for user.
*/
set_automatic_login(enabled: boolean): void;
/**
* Assigns a new email to `user`.
*
* Note this function is synchronous and ignores errors.
* @param email an email address
*/
set_email(email: string): void;
/**
* Assigns a new icon for `user`.
*
* Note this function is synchronous and ignores errors.
* @param icon_file path to an icon
*/
set_icon_file(icon_file: string): void;
/**
* Assigns a new locale for `user,` setting #ActUser:language.
*
* Note this function is synchronous and ignores errors.
* @param language a locale (for example, `en_US.utf8`), or the empty string to use the system default locale
*/
set_language(language: string): void;
/**
* Assigns preferred languages for `user,` setting #ActUser:languages, and
* overriding #ActUser:language with the first item in the list if there is one.
*
* Note this function is synchronous and ignores errors.
* @param languages an array of locale (for example, `en_US.utf8`), or the empty string to use the system default locale
*/
set_languages(languages: string[]): void;
/**
* Assigns a new location for `user`.
*
* Note this function is synchronous and ignores errors.
* @param location a location
*/
set_location(location: string): void;
/**
* Note this function is synchronous and ignores errors.
* @param locked whether or not the account is locked
*/
set_locked(locked: boolean): void;
/**
* Changes the password of `user` to `password`.
* `hint` is displayed to the user if they forget the password.
*
* Note this function is synchronous and ignores errors.
* @param password a password
* @param hint a hint to help user recall password
*/
set_password(password: string, hint: string): void;
/**
* Set the password expiration policy for a user.
*
* Note this function is synchronous and ignores errors.
* @param min_days_between_changes location to write minimum number of days needed between password changes.
* @param max_days_between_changes location to write maximum number of days password can stay unchanged.
* @param days_to_warn location to write number of days to warn user password is about to expire.
* @param days_after_expiration_until_lock location to write number of days account will be locked after password expires.
*/
set_password_expiration_policy(
min_days_between_changes: number,
max_days_between_changes: number,
days_to_warn: number,
days_after_expiration_until_lock: number,
): void;
set_password_hint(hint: string): void;
/**
* Changes the password of `user`. If `password_mode` is
* ACT_USER_PASSWORD_MODE_SET_AT_LOGIN then the user will
* be asked for a new password at the next login. If `password_mode`
* is ACT_USER_PASSWORD_MODE_NONE then the user will not require
* a password to log in.
*
* Note this function is synchronous and ignores errors.
* @param password_mode a #ActUserPasswordMode
*/
set_password_mode(password_mode: UserPasswordMode | null): void;
/**
* Assigns a new name for `user`.
*
* Note this function is synchronous and ignores errors.
* @param real_name a new name
*/
set_real_name(real_name: string): void;
/**
* Assigns a new session for `user`.
*
* Note this function is synchronous and ignores errors.
* @param session a session (e.g. gnome)
*/
set_session(session: string): void;
/**
* Assigns a type to the session for `user`.
*
* Note this function is synchronous and ignores errors.
* @param session_type a type of session (e.g. "wayland" or "x11")
*/
set_session_type(session_type: string): void;
/**
* Set the user expiration policy for a user.
*
* Note this function is synchronous and ignores errors.
* @param expiration_time location to write users expires timestamp
*/
set_user_expiration_policy(expiration_time: number): void;
/**
* Assigns a new username for `user`.
*
* Note this function is synchronous and ignores errors.
* @param user_name a new user name
*/
set_user_name(user_name: string): void;
/**
* Assigns a new x session for `user`.
*
* Note this function is synchronous and ignores errors.
* @param x_session an x session (e.g. gnome)
*/
set_x_session(x_session: string): void;
}
namespace UserManager {
// Signal callback interfaces
interface UserAdded {
(user: User): void;
}
interface UserChanged {
(user: User): void;
}
interface UserIsLoggedInChanged {
(user: User): void;
}
interface UserRemoved {
(user: User): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
exclude_usernames_list: any;
excludeUsernamesList: any;
has_multiple_users: boolean;
hasMultipleUsers: boolean;
include_usernames_list: any;
includeUsernamesList: any;
is_loaded: boolean;
isLoaded: boolean;
}
}
/**
* A user manager object.
*/
class UserManager extends GObject.Object {
static $gtype: GObject.GType<UserManager>;
// Properties
get exclude_usernames_list(): any;
set exclude_usernames_list(val: any);
get excludeUsernamesList(): any;
set excludeUsernamesList(val: any);
get has_multiple_users(): boolean;
set has_multiple_users(val: boolean);
get hasMultipleUsers(): boolean;
set hasMultipleUsers(val: boolean);
get include_usernames_list(): any;
set include_usernames_list(val: any);
get includeUsernamesList(): any;
set includeUsernamesList(val: any);
get is_loaded(): boolean;
get isLoaded(): boolean;
// Constructors
constructor(properties?: Partial<UserManager.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'user-added', callback: (_source: this, user: User) => void): number;
connect_after(signal: 'user-added', callback: (_source: this, user: User) => void): number;
emit(signal: 'user-added', user: User): void;
connect(signal: 'user-changed', callback: (_source: this, user: User) => void): number;
connect_after(signal: 'user-changed', callback: (_source: this, user: User) => void): number;
emit(signal: 'user-changed', user: User): void;
connect(signal: 'user-is-logged-in-changed', callback: (_source: this, user: User) => void): number;
connect_after(signal: 'user-is-logged-in-changed', callback: (_source: this, user: User) => void): number;
emit(signal: 'user-is-logged-in-changed', user: User): void;
connect(signal: 'user-removed', callback: (_source: this, user: User) => void): number;
connect_after(signal: 'user-removed', callback: (_source: this, user: User) => void): number;
emit(signal: 'user-removed', user: User): void;
// Static methods
/**
* Returns the user manager singleton instance. Calling this function will
* automatically being loading the user list if it isn't loaded already.
* The #ActUserManager:is-loaded property will be set to %TRUE when the users
* are finished loading and then act_user_manager_list_users() can be called.
*/
static get_default(): UserManager;
// Virtual methods
vfunc_user_added(user: User): void;
vfunc_user_changed(user: User): void;
vfunc_user_is_logged_in_changed(user: User): void;
vfunc_user_removed(user: User): void;
// Methods
/**
* Activate the session for a given user.
* @param user the user to activate
* @returns whether successfully activated
*/
activate_user_session(user: User): boolean;
/**
* Caches a user account so it shows up via act_user_manager_list_users().
* @param username a user name
* @returns user object
*/
cache_user(username: string): User;
/**
* Asynchronously caches a user account so it shows up via
* act_user_manager_list_users().
*
* For more details, see act_user_manager_cache_user(), which
* is the synchronous version of this call.
* @param username a unix user name
* @param cancellable optional #GCancellable object, %NULL to ignore
*/
cache_user_async(username: string, cancellable?: Gio.Cancellable | null): Promise<User>;
/**
* Asynchronously caches a user account so it shows up via
* act_user_manager_list_users().
*
* For more details, see act_user_manager_cache_user(), which
* is the synchronous version of this call.
* @param username a unix user name
* @param cancellable optional #GCancellable object, %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
cache_user_async(
username: string,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback<this> | null,
): void;
/**
* Asynchronously caches a user account so it shows up via
* act_user_manager_list_users().
*
* For more details, see act_user_manager_cache_user(), which
* is the synchronous version of this call.
* @param username a unix user name
* @param cancellable optional #GCancellable object, %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
cache_user_async(
username: string,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback<this> | null,
): Promise<User> | void;
/**
* Finishes an asynchronous user caching.
*
* See act_user_manager_cache_user_async().
* @param result a #GAsyncResult
* @returns user object
*/
cache_user_finish(result: Gio.AsyncResult): User;
/**
* Check whether the user can switch to another session.
* @returns whether we can switch to another session
*/
can_switch(): boolean;
/**
* Creates a user account on the system.
* @param username a unix user name
* @param fullname a unix GECOS value
* @param accounttype a #ActUserAccountType
* @returns user object
*/
create_user(username: string, fullname: string, accounttype: UserAccountType | null): User;
/**
* Asynchronously creates a user account on the system.
*
* For more details, see act_user_manager_create_user(), which
* is the synchronous version of this call.
* @param username a unix user name
* @param fullname a unix GECOS value
* @param accounttype a #ActUserAccountType
* @param cancellable optional #GCancellable object, %NULL to ignore
*/
create_user_async(
username: string,
fullname: string,
accounttype: UserAccountType | null,
cancellable?: Gio.Cancellable | null,
): Promise<User>;
/**
* Asynchronously creates a user account on the system.
*
* For more details, see act_user_manager_create_user(), which
* is the synchronous version of this call.
* @param username a unix user name
* @param fullname a unix GECOS value
* @param accounttype a #ActUserAccountType
* @param cancellable optional #GCancellable object, %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
create_user_async(
username: string,
fullname: string,
accounttype: UserAccountType | null,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback<this> | null,
): void;
/**
* Asynchronously creates a user account on the system.
*
* For more details, see act_user_manager_create_user(), which
* is the synchronous version of this call.
* @param username a unix user name
* @param fullname a unix GECOS value
* @param accounttype a #ActUserAccountType
* @param cancellable optional #GCancellable object, %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
create_user_async(
username: string,
fullname: string,
accounttype: UserAccountType | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback<this> | null,
): Promise<User> | void;
/**
* Finishes an asynchronous user creation.
*
* See act_user_manager_create_user_async().
* @param result a #GAsyncResult
* @returns user object
*/
create_user_finish(result: Gio.AsyncResult): User;
/**
* Deletes a user account on the system.
* @param user an #ActUser object
* @param remove_files %TRUE to delete the users home directory
* @returns %TRUE if the user account was successfully deleted
*/
delete_user(user: User, remove_files: boolean): boolean;
/**
* Asynchronously deletes a user account from the system.
*
* For more details, see act_user_manager_delete_user(), which
* is the synchronous version of this call.
* @param user a #ActUser object
* @param remove_files %TRUE to delete the users home directory
* @param cancellable optional #GCancellable object, %NULL to ignore
*/
delete_user_async(
user: User,
remove_files: boolean,
cancellable?: Gio.Cancellable | null,
): Promise<boolean>;
/**
* Asynchronously deletes a user account from the system.
*
* For more details, see act_user_manager_delete_user(), which
* is the synchronous version of this call.
* @param user a #ActUser object
* @param remove_files %TRUE to delete the users home directory
* @param cancellable optional #GCancellable object, %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
delete_user_async(
user: User,
remove_files: boolean,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback<this> | null,
): void;
/**
* Asynchronously deletes a user account from the system.
*
* For more details, see act_user_manager_delete_user(), which
* is the synchronous version of this call.
* @param user a #ActUser object
* @param remove_files %TRUE to delete the users home directory
* @param cancellable optional #GCancellable object, %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
delete_user_async(
user: User,
remove_files: boolean,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback<this> | null,
): Promise<boolean> | void;
/**
* Finishes an asynchronous user account deletion.
*
* See act_user_manager_delete_user_async().
* @param result a #GAsyncResult
* @returns %TRUE if the user account was successfully deleted
*/
delete_user_finish(result: Gio.AsyncResult): boolean;
/**
* Retrieves a pointer to the #ActUser object for the login `username`
* from `manager`. Trying to use this object before its
* #ActUser:is-loaded property is %TRUE will result in undefined
* behavior.
* @param username the login name of the user to get.
* @returns #ActUser object
*/
get_user(username: string): User;
/**
* Retrieves a pointer to the #ActUser object for the user with the
* given uid from `manager`. Trying to use this object before its
* #ActUser:is-loaded property is %TRUE will result in undefined
* behavior.
* @param id the uid of the user to get.
* @returns #ActUser object
*/
get_user_by_id(id: number): User;
/**
* Switch the display to the login manager.
* @returns whether successful or not
*/
goto_login_session(): boolean;
/**
* Get a list of system user accounts
* @returns List of #ActUser objects
*/
list_users(): User[];
/**
* Check whether or not the accounts service is running.
* @returns whether or not accounts service is running
*/
no_service(): boolean;
/**
* Releases all metadata about a user account, including icon,
* language and session. If the user account is from a remote
* server and the user has never logged in before, then that
* account will no longer show up in ListCachedUsers() output.
* @param username a user name
* @returns %TRUE if successful, otherwise %FALSE
*/
uncache_user(username: string): boolean;
uncache_user_async(username: string, cancellable?: Gio.Cancellable | null): Promise<boolean>;
uncache_user_async(
username: string,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback<this> | null,
): void;
uncache_user_async(
username: string,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback<this> | null,
): Promise<boolean> | void;
/**
* Finishes an asynchronous user uncaching.
*
* See act_user_manager_uncache_user_async().
* @param result a #GAsyncResult
* @returns %TRUE if the user account was successfully uncached
*/
uncache_user_finish(result: Gio.AsyncResult): boolean;
}
type UserClass = typeof User;
type UserManagerClass = typeof UserManager;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AccountsService;
}
declare module 'gi://AccountsService' {
import AccountsService10 from 'gi://AccountsService?version=1.0';
export default AccountsService10;
}
// END

File diff suppressed because it is too large Load Diff

View File

@ -1,649 +0,0 @@
/// <reference path="./gtk-3.0.d.ts" />
/// <reference path="./xlib-2.0.d.ts" />
/// <reference path="./gdk-3.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./cairo.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./gdkpixbuf-2.0.d.ts" />
/// <reference path="./atk-1.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AppIndicator3?version=0.1' {
// Module dependencies
import type Gtk from 'gi://Gtk?version=3.0';
import type xlib from 'gi://xlib?version=2.0';
import type Gdk from 'gi://Gdk?version=3.0';
import type cairo from 'cairo';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type Atk from 'gi://Atk?version=1.0';
export namespace AppIndicator3 {
/**
* AppIndicator3-0.1
*/
/**
* The category provides grouping for the indicators so that
* users can find indicators that are similar together.
*/
/**
* The category provides grouping for the indicators so that
* users can find indicators that are similar together.
*/
export namespace IndicatorCategory {
export const $gtype: GObject.GType<IndicatorCategory>;
}
enum IndicatorCategory {
/**
* The indicator is used to display the status of the application.
*/
APPLICATION_STATUS,
/**
* The application is used for communication with other people.
*/
COMMUNICATIONS,
/**
* A system indicator relating to something in the user's system.
*/
SYSTEM_SERVICES,
/**
* An indicator relating to the user's hardware.
*/
HARDWARE,
/**
* Something not defined in this enum, please don't use unless you really need it.
*/
OTHER,
}
/**
* These are the states that the indicator can be on in
* the user's panel. The indicator by default starts
* in the state `APP_INDICATOR_STATUS_PASSIVE` and can be
* shown by setting it to `APP_INDICATOR_STATUS_ACTIVE`.
*/
/**
* These are the states that the indicator can be on in
* the user's panel. The indicator by default starts
* in the state `APP_INDICATOR_STATUS_PASSIVE` and can be
* shown by setting it to `APP_INDICATOR_STATUS_ACTIVE`.
*/
export namespace IndicatorStatus {
export const $gtype: GObject.GType<IndicatorStatus>;
}
enum IndicatorStatus {
/**
* The indicator should not be shown to the user.
*/
PASSIVE,
/**
* The indicator should be shown in it's default state.
*/
ACTIVE,
/**
* The indicator should show it's attention icon.
*/
ATTENTION,
}
/**
* String identifier for the #AppIndicator::connection-changed signal.
*/
const INDICATOR_SIGNAL_CONNECTION_CHANGED: string;
/**
* String identifier for the #AppIndicator::new-attention-icon signal.
*/
const INDICATOR_SIGNAL_NEW_ATTENTION_ICON: string;
/**
* String identifier for the #AppIndicator::new-icon signal.
*/
const INDICATOR_SIGNAL_NEW_ICON: string;
/**
* String identifier for the #AppIndicator::new-icon-theme-path signal.
*/
const INDICATOR_SIGNAL_NEW_ICON_THEME_PATH: string;
/**
* String identifier for the #AppIndicator::new-label signal.
*/
const INDICATOR_SIGNAL_NEW_LABEL: string;
/**
* String identifier for the #AppIndicator::new-status signal.
*/
const INDICATOR_SIGNAL_NEW_STATUS: string;
/**
* String identifier for the #AppIndicator::scroll-event signal.
*/
const INDICATOR_SIGNAL_SCROLL_EVENT: string;
namespace Indicator {
// Signal callback interfaces
interface ConnectionChanged {
(arg1: boolean): void;
}
interface NewAttentionIcon {
(): void;
}
interface NewIcon {
(): void;
}
interface NewIconThemePath {
(object: string): void;
}
interface NewLabel {
(object: string, p0: string): void;
}
interface NewStatus {
(arg1: string): void;
}
interface ScrollEvent {
(arg1: number, arg2: Gdk.ScrollDirection): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
attention_icon_desc: string;
attentionIconDesc: string;
attention_icon_name: string;
attentionIconName: string;
category: string;
connected: boolean;
icon_desc: string;
iconDesc: string;
icon_name: string;
iconName: string;
icon_theme_path: string;
iconThemePath: string;
id: string;
label: string;
label_guide: string;
labelGuide: string;
ordering_index: number;
orderingIndex: number;
status: string;
title: string;
}
}
/**
* A application indicator represents the values that are needed to show a
* unique status in the panel for an application. In general, applications
* should try to fit in the other indicators that are available on the
* panel before using this. But, sometimes it is necissary.
*
* Private fields
*/
class Indicator extends GObject.Object {
static $gtype: GObject.GType<Indicator>;
// Properties
/**
* If the indicator sets it's status to %APP_INDICATOR_STATUS_ATTENTION
* then this textual description of the icon shown.
*/
get attention_icon_desc(): string;
set attention_icon_desc(val: string);
/**
* If the indicator sets it's status to %APP_INDICATOR_STATUS_ATTENTION
* then this textual description of the icon shown.
*/
get attentionIconDesc(): string;
set attentionIconDesc(val: string);
/**
* If the indicator sets it's status to %APP_INDICATOR_STATUS_ATTENTION
* then this icon is shown.
*/
get attention_icon_name(): string;
set attention_icon_name(val: string);
/**
* If the indicator sets it's status to %APP_INDICATOR_STATUS_ATTENTION
* then this icon is shown.
*/
get attentionIconName(): string;
set attentionIconName(val: string);
/**
* The type of indicator that this represents. Please don't use 'Other'.
* Defaults to 'ApplicationStatus'.
*/
get category(): string;
/**
* Pretty simple, %TRUE if we have a reasonable expectation of being
* displayed through this object. You should hide your TrayIcon if so.
*/
get connected(): boolean;
/**
* The description of the regular icon that is shown for the indicator.
*/
get icon_desc(): string;
set icon_desc(val: string);
/**
* The description of the regular icon that is shown for the indicator.
*/
get iconDesc(): string;
set iconDesc(val: string);
/**
* The name of the regular icon that is shown for the indicator.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* The name of the regular icon that is shown for the indicator.
*/
get iconName(): string;
set iconName(val: string);
/**
* An additional place to look for icon names that may be installed by the
* application.
*/
get icon_theme_path(): string;
set icon_theme_path(val: string);
/**
* An additional place to look for icon names that may be installed by the
* application.
*/
get iconThemePath(): string;
set iconThemePath(val: string);
/**
* The ID for this indicator, which should be unique, but used consistently
* by this program and its indicator.
*/
get id(): string;
/**
* A label that can be shown next to the string in the application
* indicator. The label will not be shown unless there is an icon
* as well. The label is useful for numerical and other frequently
* updated information. In general, it shouldn't be shown unless a
* user requests it as it can take up a significant amount of space
* on the user's panel. This may not be shown in all visualizations.
*/
get label(): string;
set label(val: string);
/**
* An optional string to provide guidance to the panel on how big
* the #AppIndicator:label string could get. If this is set correctly
* then the panel should never 'jiggle' as the string adjusts through
* out the range of options. For instance, if you were providing a
* percentage like "54% thrust" in #AppIndicator:label you'd want to
* set this string to "100% thrust" to ensure space when Scotty can
* get you enough power.
*/
get label_guide(): string;
set label_guide(val: string);
/**
* An optional string to provide guidance to the panel on how big
* the #AppIndicator:label string could get. If this is set correctly
* then the panel should never 'jiggle' as the string adjusts through
* out the range of options. For instance, if you were providing a
* percentage like "54% thrust" in #AppIndicator:label you'd want to
* set this string to "100% thrust" to ensure space when Scotty can
* get you enough power.
*/
get labelGuide(): string;
set labelGuide(val: string);
/**
* The ordering index is an odd parameter, and if you think you don't need
* it you're probably right. In general, the application indicator try
* to place the applications in a recreatable place taking into account
* which category they're in to try and group them. But, there are some
* cases where you'd want to ensure indicators are next to each other.
* To do that you can override the generated ordering index and replace it
* with a new one. Again, you probably don't want to be doing this, but
* in case you do, this is the way.
*/
get ordering_index(): number;
set ordering_index(val: number);
/**
* The ordering index is an odd parameter, and if you think you don't need
* it you're probably right. In general, the application indicator try
* to place the applications in a recreatable place taking into account
* which category they're in to try and group them. But, there are some
* cases where you'd want to ensure indicators are next to each other.
* To do that you can override the generated ordering index and replace it
* with a new one. Again, you probably don't want to be doing this, but
* in case you do, this is the way.
*/
get orderingIndex(): number;
set orderingIndex(val: number);
/**
* Whether the indicator is shown or requests attention. Defaults to
* 'Passive'.
*/
get status(): string;
set status(val: string);
/**
* Provides a way to refer to this application indicator in a human
* readable form. This is used in the Unity desktop in the HUD as
* the first part of the menu entries to distinguish them from the
* focused application's entries.
*/
get title(): string;
set title(val: string);
// Constructors
constructor(properties?: Partial<Indicator.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](id: string, icon_name: string, category: IndicatorCategory): Indicator;
static new_with_path(
id: string,
icon_name: string,
category: IndicatorCategory,
icon_theme_path: string,
): Indicator;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'connection-changed', callback: (_source: this, arg1: boolean) => void): number;
connect_after(signal: 'connection-changed', callback: (_source: this, arg1: boolean) => void): number;
emit(signal: 'connection-changed', arg1: boolean): void;
connect(signal: 'new-attention-icon', callback: (_source: this) => void): number;
connect_after(signal: 'new-attention-icon', callback: (_source: this) => void): number;
emit(signal: 'new-attention-icon'): void;
connect(signal: 'new-icon', callback: (_source: this) => void): number;
connect_after(signal: 'new-icon', callback: (_source: this) => void): number;
emit(signal: 'new-icon'): void;
connect(signal: 'new-icon-theme-path', callback: (_source: this, object: string) => void): number;
connect_after(signal: 'new-icon-theme-path', callback: (_source: this, object: string) => void): number;
emit(signal: 'new-icon-theme-path', object: string): void;
connect(signal: 'new-label', callback: (_source: this, object: string, p0: string) => void): number;
connect_after(signal: 'new-label', callback: (_source: this, object: string, p0: string) => void): number;
emit(signal: 'new-label', object: string, p0: string): void;
connect(signal: 'new-status', callback: (_source: this, arg1: string) => void): number;
connect_after(signal: 'new-status', callback: (_source: this, arg1: string) => void): number;
emit(signal: 'new-status', arg1: string): void;
connect(
signal: 'scroll-event',
callback: (_source: this, arg1: number, arg2: Gdk.ScrollDirection) => void,
): number;
connect_after(
signal: 'scroll-event',
callback: (_source: this, arg1: number, arg2: Gdk.ScrollDirection) => void,
): number;
emit(signal: 'scroll-event', arg1: number, arg2: Gdk.ScrollDirection): void;
// Virtual methods
/**
* Slot for #AppIndicator::connection-changed.
* @param connected
*/
vfunc_connection_changed(connected: boolean): void;
/**
* Slot for #AppIndicator::new-attention-icon.
*/
vfunc_new_attention_icon(): void;
/**
* Slot for #AppIndicator::new-icon.
*/
vfunc_new_icon(): void;
/**
* Slot for #AppIndicator::new-icon-theme-path
* @param icon_theme_path
*/
vfunc_new_icon_theme_path(icon_theme_path: string): void;
/**
* Slot for #AppIndicator::new-label.
* @param label
* @param guide
*/
vfunc_new_label(label: string, guide: string): void;
/**
* Slot for #AppIndicator::new-status.
* @param status
*/
vfunc_new_status(status: string): void;
/**
* Slot for #AppIndicator::scroll-event
* @param delta
* @param direction
*/
vfunc_scroll_event(delta: number, direction: Gdk.ScrollDirection): void;
/**
* The function that gets called if an Application
* Indicator area appears after the fallback has been created.
* @param status_icon
*/
vfunc_unfallback(status_icon: Gtk.StatusIcon): void;
// Methods
/**
* This function allows for building the Application Indicator menu
* from a static desktop file.
* @param desktop_file A path to the desktop file to build the menu from
* @param desktop_profile Which entries should be used from the desktop file
*/
build_menu_from_desktop(desktop_file: string, desktop_profile: string): void;
/**
* Wrapper function for property #AppIndicator:attention-icon-name.
* @returns The current attention icon name.
*/
get_attention_icon(): string;
/**
* Wrapper function for property #AppIndicator:attention-icon-desc.
* @returns The current attention icon description.
*/
get_attention_icon_desc(): string;
/**
* Wrapper function for property #AppIndicator:category.
* @returns The current category.
*/
get_category(): IndicatorCategory;
/**
* Wrapper function for property #AppIndicator:icon-name.
* @returns The current icon name.
*/
get_icon(): string;
/**
* Wrapper function for property #AppIndicator:icon-desc.
* @returns The current icon description.
*/
get_icon_desc(): string;
/**
* Wrapper function for property #AppIndicator:icon-theme-path.
* @returns The current icon theme path.
*/
get_icon_theme_path(): string;
/**
* Wrapper function for property #AppIndicator:id.
* @returns The current ID
*/
get_id(): string;
/**
* Wrapper function for property #AppIndicator:label.
* @returns The current label.
*/
get_label(): string;
/**
* Wrapper function for property #AppIndicator:label-guide.
* @returns The current label guide.
*/
get_label_guide(): string;
/**
* Gets the menu being used for this application indicator.
* Wrapper function for property #AppIndicator:menu.
* @returns A #GtkMenu object or %NULL if one hasn't been set.
*/
get_menu(): Gtk.Menu;
/**
* Wrapper function for property #AppIndicator:ordering-index.
* @returns The current ordering index.
*/
get_ordering_index(): number;
/**
* Gets the menuitem being called on secondary-activate event.
* @returns A #GtkWidget object or %NULL if none has been set.
*/
get_secondary_activate_target(): Gtk.Widget;
/**
* Wrapper function for property #AppIndicator:status.
* @returns The current status.
*/
get_status(): IndicatorStatus;
/**
* Gets the title of the application indicator. See the function
* app_indicator_set_title() for information on the title.
* @returns The current title.
*/
get_title(): string;
/**
* Wrapper for app_indicator_set_attention_icon_full() with a NULL
* description.
* @param icon_name The name of the attention icon to set for this indicator
*/
set_attention_icon(icon_name: string): void;
/**
* Wrapper function for property #AppIndicator:attention-icon-name.
* @param icon_name The name of the attention icon to set for this indicator
* @param icon_desc A textual description of the icon
*/
set_attention_icon_full(icon_name: string, icon_desc: string): void;
/**
* Wrapper function for app_indicator_set_icon_full() with a NULL
* description.
* @param icon_name The icon name to set.
*/
set_icon(icon_name: string): void;
/**
* Sets the default icon to use when the status is active but
* not set to attention. In most cases, this should be the
* application icon for the program.
*
* Wrapper function for property #AppIndicator:icon-name and
* #AppIndicator::icon-desc.
* @param icon_name The icon name to set.
* @param icon_desc A textual description of the icon for accessibility
*/
set_icon_full(icon_name: string, icon_desc: string): void;
/**
* Sets the path to use when searching for icons.
* @param icon_theme_path The icon theme path to set.
*/
set_icon_theme_path(icon_theme_path: string): void;
/**
* This is a wrapper function for the #AppIndicator:label and
* #AppIndicator:guide properties. This function can take #NULL
* as either `label` or `guide` and will clear the entries.
* @param label The label to show next to the icon.
* @param guide A guide to size the label correctly.
*/
set_label(label: string, guide: string): void;
/**
* Sets the menu that should be shown when the Application Indicator
* is clicked on in the panel. An application indicator will not
* be rendered unless it has a menu.
*
* Wrapper function for property #AppIndicator:menu.
* @param menu A #GtkMenu to set
*/
set_menu(menu?: Gtk.Menu | null): void;
/**
* Sets the ordering index for the app indicator which effects the
* placement of it on the panel. For almost all app indicator
* this is not the function you're looking for.
*
* Wrapper function for property #AppIndicator:ordering-index.
* @param ordering_index A value for the ordering of this app indicator
*/
set_ordering_index(ordering_index: number): void;
/**
* Set the `menuitem` to be activated when a secondary activation event (i.e. a
* middle-click) is emitted over the #AppIndicator icon/label.
*
* The `menuitem` can be also a complex #GtkWidget, but to get activated when
* a secondary activation occurs in the #Appindicator, it must be a visible and
* active child (or inner-child) of the #AppIndicator:menu.
*
* Setting `menuitem` to %NULL causes to disable this feature.
* @param menuitem A #GtkWidget to be activated on secondary activation
*/
set_secondary_activate_target(menuitem?: Gtk.Widget | null): void;
/**
* Wrapper function for property #AppIndicator:status.
* @param status The status to set for this indicator
*/
set_status(status: IndicatorStatus | null): void;
/**
* Sets the title of the application indicator, or how it should be referred
* in a human readable form. This string should be UTF-8 and localized as it
* expected that users will set it.
*
* In the Unity desktop the most prominent place that this is show will be
* in the HUD. HUD listings for this application indicator will start with
* the title as the first part of the line for the menu items.
*
* Setting `title` to %NULL removes the title.
* @param title Title of the app indicator
*/
set_title(title?: string | null): void;
}
type IndicatorClass = typeof Indicator;
/**
* All of the private data in an instance of an application indicator.
* Private Fields
*/
abstract class IndicatorPrivate {
static $gtype: GObject.GType<IndicatorPrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AppIndicator3;
}
declare module 'gi://AppIndicator3' {
import AppIndicator301 from 'gi://AppIndicator3?version=0.1';
export default AppIndicator301;
}
// END

View File

@ -1,83 +0,0 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AppmenuGLibTranslator?version=24.02' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AppmenuGLibTranslator {
/**
* AppmenuGLibTranslator-24.02
*/
namespace Importer {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
action_group: Gio.ActionGroup;
actionGroup: Gio.ActionGroup;
bus_name: string;
busName: string;
model: Gio.MenuModel;
object_path: string;
objectPath: string;
}
}
class Importer extends GObject.Object {
static $gtype: GObject.GType<Importer>;
// Properties
get action_group(): Gio.ActionGroup;
get actionGroup(): Gio.ActionGroup;
set bus_name(val: string);
set busName(val: string);
get model(): Gio.MenuModel;
set object_path(val: string);
set objectPath(val: string);
// Constructors
constructor(properties?: Partial<Importer.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](bus_name: string, object_path: string): Importer;
}
type ImporterClass = typeof Importer;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AppmenuGLibTranslator;
}
declare module 'gi://AppmenuGLibTranslator' {
import AppmenuGLibTranslator2402 from 'gi://AppmenuGLibTranslator?version=24.02';
export default AppmenuGLibTranslator2402;
}
// END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,384 +0,0 @@
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalApps?version=0.1' {
// Module dependencies
import type GLib from 'gi://GLib?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
export namespace AstalApps {
/**
* AstalApps-0.1
*/
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
namespace Application {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
app: never;
frequency: number;
name: string;
entry: string;
description: string;
wm_class: string;
wmClass: string;
executable: string;
icon_name: string;
iconName: string;
keywords: string[];
categories: string[];
}
}
/**
* Object representing an applications .desktop file.
*/
class Application extends GObject.Object {
static $gtype: GObject.GType<Application>;
// Properties
/**
* The underlying DesktopAppInfo.
*/
get app(): never;
set app(val: never);
/**
* The number of times [method`AstalApps`.Application.launch] was called on this Application.
*/
get frequency(): number;
set frequency(val: number);
/**
* The name of this Application.
*/
get name(): string;
/**
* Name of the .desktop of this Application.
*/
get entry(): string;
/**
* Description of this Application.
*/
get description(): string;
/**
* `StartupWMClass` field from the desktop file. This represents the `WM_CLASS` property of the main window of the application.
*/
get wm_class(): string;
/**
* `StartupWMClass` field from the desktop file. This represents the `WM_CLASS` property of the main window of the application.
*/
get wmClass(): string;
/**
* `Exec` field from the desktop file. Note that if you want to launch this Application you should use the [method@
* AstalApps.Application.launch] method.
*/
get executable(): string;
/**
* `Icon` field from the desktop file. This is usually a named icon or a path to a file.
*/
get icon_name(): string;
/**
* `Icon` field from the desktop file. This is usually a named icon or a path to a file.
*/
get iconName(): string;
/**
* `Keywords` field from the desktop file.
*/
get keywords(): string[];
/**
* `Categories` field from the desktop file.
*/
get categories(): string[];
// Constructors
constructor(properties?: Partial<Application.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Get a value from the .desktop file by its key.
* @param key
*/
get_key(key: string): string;
/**
* Launches this application. The launched application inherits the environment of the launching process
*/
launch(): boolean;
/**
* Calculate a score for an application using fuzzy matching algorithm.
* @param term
*/
fuzzy_match(term: string): Score;
/**
* Calculate a score using exact string algorithm.
* @param term
*/
exact_match(term: string): Score;
get_app(): never;
set_app(value: never): void;
get_frequency(): number;
set_frequency(value: number): void;
get_name(): string;
get_entry(): string;
get_description(): string;
get_wm_class(): string;
get_executable(): string;
get_icon_name(): string;
get_keywords(): string[];
get_categories(): string[];
}
namespace Apps {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
show_hidden: boolean;
showHidden: boolean;
list: Application[];
min_score: number;
minScore: number;
name_multiplier: number;
nameMultiplier: number;
entry_multiplier: number;
entryMultiplier: number;
executable_multiplier: number;
executableMultiplier: number;
description_multiplier: number;
descriptionMultiplier: number;
keywords_multiplier: number;
keywordsMultiplier: number;
categories_multiplier: number;
categoriesMultiplier: number;
}
}
/**
* This object can be used to query applications. Multipliers can be set to customize [struct`AstalApps`.Score] results from queries which
* then are summed and sorted accordingly.
*/
class Apps extends GObject.Object {
static $gtype: GObject.GType<Apps>;
// Properties
/**
* Indicates wether hidden applications should included in queries.
*/
get show_hidden(): boolean;
set show_hidden(val: boolean);
/**
* Indicates wether hidden applications should included in queries.
*/
get showHidden(): boolean;
set showHidden(val: boolean);
/**
* Full list of available applications.
*/
get list(): Application[];
/**
* The minimum score the application has to meet in order to be included in queries.
*/
get min_score(): number;
set min_score(val: number);
/**
* The minimum score the application has to meet in order to be included in queries.
*/
get minScore(): number;
set minScore(val: number);
/**
* Extra multiplier to apply when matching the `name` of an application. Defaults to `2`
*/
get name_multiplier(): number;
set name_multiplier(val: number);
/**
* Extra multiplier to apply when matching the `name` of an application. Defaults to `2`
*/
get nameMultiplier(): number;
set nameMultiplier(val: number);
/**
* Extra multiplier to apply when matching the entry of an application. Defaults to `0`
*/
get entry_multiplier(): number;
set entry_multiplier(val: number);
/**
* Extra multiplier to apply when matching the entry of an application. Defaults to `0`
*/
get entryMultiplier(): number;
set entryMultiplier(val: number);
/**
* Extra multiplier to apply when matching the executable of an application. Defaults to `0.5`
*/
get executable_multiplier(): number;
set executable_multiplier(val: number);
/**
* Extra multiplier to apply when matching the executable of an application. Defaults to `0.5`
*/
get executableMultiplier(): number;
set executableMultiplier(val: number);
/**
* Extra multiplier to apply when matching the description of an application. Defaults to `0`
*/
get description_multiplier(): number;
set description_multiplier(val: number);
/**
* Extra multiplier to apply when matching the description of an application. Defaults to `0`
*/
get descriptionMultiplier(): number;
set descriptionMultiplier(val: number);
/**
* Extra multiplier to apply when matching the keywords of an application. Defaults to `0.5`
*/
get keywords_multiplier(): number;
set keywords_multiplier(val: number);
/**
* Extra multiplier to apply when matching the keywords of an application. Defaults to `0.5`
*/
get keywordsMultiplier(): number;
set keywordsMultiplier(val: number);
/**
* Extra multiplier to apply when matching the categories of an application. Defaults to `0`
*/
get categories_multiplier(): number;
set categories_multiplier(val: number);
/**
* Extra multiplier to apply when matching the categories of an application. Defaults to `0`
*/
get categoriesMultiplier(): number;
set categoriesMultiplier(val: number);
// Constructors
constructor(properties?: Partial<Apps.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Apps;
// Methods
/**
* Calculate a score for an application using fuzzy matching algorithm. Taking this Apps' include settings into consideration .
* @param search
* @param a
*/
fuzzy_score(search: string, a: Application): number;
/**
* Calculate a score for an application using exact string algorithm. Taking this Apps' include settings into consideration .
* @param search
* @param a
*/
exact_score(search: string, a: Application): number;
/**
* Query the `list` of applications with a fuzzy matching algorithm.
* @param search
*/
fuzzy_query(search?: string | null): Application[];
/**
* Query the `list` of applications with a simple string matching algorithm.
* @param search
*/
exact_query(search?: string | null): Application[];
/**
* Reload the `list` of Applications.
*/
reload(): void;
get_show_hidden(): boolean;
set_show_hidden(value: boolean): void;
get_list(): Application[];
get_min_score(): number;
set_min_score(value: number): void;
get_name_multiplier(): number;
set_name_multiplier(value: number): void;
get_entry_multiplier(): number;
set_entry_multiplier(value: number): void;
get_executable_multiplier(): number;
set_executable_multiplier(value: number): void;
get_description_multiplier(): number;
set_description_multiplier(value: number): void;
get_keywords_multiplier(): number;
set_keywords_multiplier(value: number): void;
get_categories_multiplier(): number;
set_categories_multiplier(value: number): void;
}
type ApplicationClass = typeof Application;
abstract class ApplicationPrivate {
static $gtype: GObject.GType<ApplicationPrivate>;
// Constructors
_init(...args: any[]): void;
}
type AppsClass = typeof Apps;
abstract class AppsPrivate {
static $gtype: GObject.GType<AppsPrivate>;
// Constructors
_init(...args: any[]): void;
}
class Score {
static $gtype: GObject.GType<Score>;
// Fields
name: number;
entry: number;
executable: number;
description: number;
keywords: number;
categories: number;
// Constructors
constructor(
properties?: Partial<{
name: number;
entry: number;
executable: number;
description: number;
keywords: number;
categories: number;
}>,
);
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalApps;
}
declare module 'gi://AstalApps' {
import AstalApps01 from 'gi://AstalApps?version=0.1';
export default AstalApps01;
}
// END

View File

@ -1,217 +0,0 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalAuth?version=0.1' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AstalAuth {
/**
* AstalAuth-0.1
*/
const MAJOR_VERSION: number;
const MICRO_VERSION: number;
const MINOR_VERSION: number;
const VERSION: string;
namespace Pam {
// Signal callback interfaces
interface AuthError {
(msg: string): void;
}
interface AuthInfo {
(msg: string): void;
}
interface AuthPromptHidden {
(msg: string): void;
}
interface AuthPromptVisible {
(msg: string): void;
}
interface Fail {
(msg: string): void;
}
interface Success {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
service: string;
username: string;
}
}
/**
* For simple authentication using only a password, using the [func`AstalAuth`.Pam.authenticate]
* method is recommended. Look at the simple examples for how to use it.
*
* There is also a way to get access to the pam conversation, to allow for a more complex
* authentication process, like using multiple factor authentication. Generally it can be used like
* this:
*
* 1. create the Pam object.
* 2. set username and service if so required. It has sane defaults, so in most cases you can skip
* this.
* 3. connect to the signals.
* After an `auth-*` signal is emitted, it has to be responded with exactly one
* [method`AstalAuth`.Pam.supply_secret] call. The secret is a string containing the user input. For
* [auth-info][signal`AstalAuth`.Pam::auth-info:] and [auth-error][signal`AstalAuth`.Pam::auth-error:]
* it should be `NULL`. Not connecting those signals, is equivalent to calling
* [method`AstalAuth`.Pam.supply_secret] with `NULL` immediately after the signal is emitted.
* 4. start authentication process using [method`AstalAuth`.Pam.start_authenticate].
* 5. it is possible to reuse the same Pam object for multiple sequential authentication attempts.
* Just call [method`AstalAuth`.Pam.start_authenticate] again after the `success` or `fail` signal
* was emitted.
*/
class Pam extends GObject.Object {
static $gtype: GObject.GType<Pam>;
// Properties
/**
* The pam service used for authentication.
* Changing the value of this property has no affect on an already started authentication
* process.
*
* Defaults to the astal-auth pam service.
*/
get service(): string;
set service(val: string);
/**
* The username used for authentication.
* Changing the value of this property has no affect on an already started authentication
* process.
*
* Defaults to the user that owns this process.
*/
get username(): string;
set username(val: string);
// Constructors
constructor(properties?: Partial<Pam.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'auth-error', callback: (_source: this, msg: string) => void): number;
connect_after(signal: 'auth-error', callback: (_source: this, msg: string) => void): number;
emit(signal: 'auth-error', msg: string): void;
connect(signal: 'auth-info', callback: (_source: this, msg: string) => void): number;
connect_after(signal: 'auth-info', callback: (_source: this, msg: string) => void): number;
emit(signal: 'auth-info', msg: string): void;
connect(signal: 'auth-prompt-hidden', callback: (_source: this, msg: string) => void): number;
connect_after(signal: 'auth-prompt-hidden', callback: (_source: this, msg: string) => void): number;
emit(signal: 'auth-prompt-hidden', msg: string): void;
connect(signal: 'auth-prompt-visible', callback: (_source: this, msg: string) => void): number;
connect_after(signal: 'auth-prompt-visible', callback: (_source: this, msg: string) => void): number;
emit(signal: 'auth-prompt-visible', msg: string): void;
connect(signal: 'fail', callback: (_source: this, msg: string) => void): number;
connect_after(signal: 'fail', callback: (_source: this, msg: string) => void): number;
emit(signal: 'fail', msg: string): void;
connect(signal: 'success', callback: (_source: this) => void): number;
connect_after(signal: 'success', callback: (_source: this) => void): number;
emit(signal: 'success'): void;
// Static methods
/**
* Requests authentication of the provided password using the PAM (Pluggable Authentication Modules)
* system.
* @param password the password to be authenticated
* @param result_callback a GAsyncReadyCallback to call when the request is satisfied
*/
static authenticate(password: string, result_callback?: Gio.AsyncReadyCallback<Pam> | null): boolean;
static authenticate_finish(res: Gio.AsyncResult): number;
// Methods
/**
* Fetches the service from AsalAuthPam object.
* @returns the service of the AsalAuthPam object. This string is owned by the object and must not be modified or freed.
*/
get_service(): string;
/**
* Fetches the username from AsalAuthPam object.
* @returns the username of the AsalAuthPam object. This string is owned by the object and must not be modified or freed.
*/
get_username(): string;
/**
* Sets the service to be used for authentication. This must be set to
* before calling start_authenticate.
* Changing it afterwards has no effect on the authentication process.
*
* Defaults to `astal-auth`.
* @param service the pam service used for authentication
*/
set_service(service: string): void;
/**
* Sets the username to be used for authentication. This must be set to
* before calling start_authenticate.
* Changing it afterwards has no effect on the authentication process.
*
* Defaults to the owner of the process.
* @param username the new username
*/
set_username(username: string): void;
/**
* starts a new authentication process using the PAM (Pluggable Authentication Modules) system.
* Note that this will cancel an already running authentication process
* associated with this AstalAuthPam object.
*/
start_authenticate(): boolean;
/**
* provides pam with a secret. This method must be called exactly once after a
* auth-* signal is emitted.
* @param secret the secret to be provided to pam. Can be NULL.
*/
supply_secret(secret?: string | null): void;
}
type PamClass = typeof Pam;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalAuth;
}
declare module 'gi://AstalAuth' {
import AstalAuth01 from 'gi://AstalAuth?version=0.1';
export default AstalAuth01;
}
// END

View File

@ -1,696 +0,0 @@
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalBattery?version=0.1' {
// Module dependencies
import type GLib from 'gi://GLib?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
export namespace AstalBattery {
/**
* AstalBattery-0.1
*/
export namespace State {
export const $gtype: GObject.GType<State>;
}
enum State {
UNKNOWN,
CHARGING,
DISCHARGING,
EMPTY,
FULLY_CHARGED,
PENDING_CHARGE,
PENDING_DISCHARGE,
}
export namespace Technology {
export const $gtype: GObject.GType<Technology>;
}
enum Technology {
UNKNOWN,
LITHIUM_ION,
LITHIUM_POLYMER,
LITHIUM_IRON_PHOSPHATE,
LEAD_ACID,
NICKEL_CADMIUM,
NICKEL_METAL_HYDRIDE,
}
export namespace WarningLevel {
export const $gtype: GObject.GType<WarningLevel>;
}
enum WarningLevel {
UNKNOWN,
NONE,
DISCHARGING,
LOW,
CRITICIAL,
ACTION,
}
export namespace BatteryLevel {
export const $gtype: GObject.GType<BatteryLevel>;
}
enum BatteryLevel {
UNKNOWN,
NONE,
LOW,
CRITICIAL,
NORMAL,
HIGH,
FULL,
}
export namespace Type {
export const $gtype: GObject.GType<Type>;
}
enum Type {
UNKNOWN,
LINE_POWER,
BATTERY,
UPS,
MONITOR,
MOUSE,
KEYBOARD,
PDA,
PHONE,
MEDIA_PLAYER,
TABLET,
COMPUTER,
GAMING_INPUT,
PEN,
TOUCHPAD,
MODEM,
NETWORK,
HEADSET,
SPEAKERS,
HEADPHONES,
VIDEO,
OTHER_AUDIO,
REMOVE_CONTROL,
PRINTER,
SCANNER,
CAMERA,
WEARABLE,
TOY,
BLUETOOTH_GENERIC,
}
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
/**
* Get the DisplayDevice.
*/
function get_default(): Device;
namespace Device {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
device_type: Type;
deviceType: Type;
native_path: string;
nativePath: string;
vendor: string;
model: string;
serial: string;
update_time: number;
updateTime: number;
power_supply: boolean;
powerSupply: boolean;
online: boolean;
energy: number;
energy_empty: number;
energyEmpty: number;
energy_full: number;
energyFull: number;
energy_full_design: number;
energyFullDesign: number;
energy_rate: number;
energyRate: number;
voltage: number;
charge_cycles: number;
chargeCycles: number;
luminosity: number;
time_to_empty: number;
timeToEmpty: number;
time_to_full: number;
timeToFull: number;
percentage: number;
temperature: number;
is_present: boolean;
isPresent: boolean;
state: State;
is_rechargable: boolean;
isRechargable: boolean;
capacity: number;
technology: Technology;
warning_level: WarningLevel;
warningLevel: WarningLevel;
battery_level: BatteryLevel;
batteryLevel: BatteryLevel;
icon_name: string;
iconName: string;
charging: boolean;
is_battery: boolean;
isBattery: boolean;
battery_icon_name: string;
batteryIconName: string;
device_type_name: string;
deviceTypeName: string;
device_type_icon: string;
deviceTypeIcon: string;
}
}
/**
* Client for a UPower [device](https://upower.freedesktop.org/docs/Device.html).
*/
class Device extends GObject.Object {
static $gtype: GObject.GType<Device>;
// Properties
/**
* If it is [enum`AstalBattery`.Type.BATTERY], you will need to verify that the property power-supply has the value `true` before
* considering it as a laptop battery. Otherwise it will likely be the battery for a device of an unknown type.
*/
get device_type(): Type;
set device_type(val: Type);
/**
* If it is [enum`AstalBattery`.Type.BATTERY], you will need to verify that the property power-supply has the value `true` before
* considering it as a laptop battery. Otherwise it will likely be the battery for a device of an unknown type.
*/
get deviceType(): Type;
set deviceType(val: Type);
/**
* Native path of the power source. This is the sysfs path, for example /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0. It is
* blank if the device is being driven by a user space driver.
*/
get native_path(): string;
set native_path(val: string);
/**
* Native path of the power source. This is the sysfs path, for example /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0. It is
* blank if the device is being driven by a user space driver.
*/
get nativePath(): string;
set nativePath(val: string);
/**
* Name of the vendor of the battery.
*/
get vendor(): string;
set vendor(val: string);
/**
* Name of the model of this battery.
*/
get model(): string;
set model(val: string);
/**
* Unique serial number of the battery.
*/
get serial(): string;
set serial(val: string);
/**
* The point in time (seconds since the Epoch) that data was read from the power source.
*/
get update_time(): number;
set update_time(val: number);
/**
* The point in time (seconds since the Epoch) that data was read from the power source.
*/
get updateTime(): number;
set updateTime(val: number);
/**
* If the power device is used to supply the system. This would be set `true` for laptop batteries and UPS devices, but set to `false` for
* wireless mice or PDAs.
*/
get power_supply(): boolean;
set power_supply(val: boolean);
/**
* If the power device is used to supply the system. This would be set `true` for laptop batteries and UPS devices, but set to `false` for
* wireless mice or PDAs.
*/
get powerSupply(): boolean;
set powerSupply(val: boolean);
/**
* Whether power is currently being provided through line power.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.LINE_POWER].
*/
get online(): boolean;
set online(val: boolean);
/**
* Amount of energy (measured in Wh) currently available in the power source.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energy(): number;
set energy(val: number);
/**
* Amount of energy (measured in Wh) in the power source when it's considered to be empty.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energy_empty(): number;
set energy_empty(val: number);
/**
* Amount of energy (measured in Wh) in the power source when it's considered to be empty.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energyEmpty(): number;
set energyEmpty(val: number);
/**
* Amount of energy (measured in Wh) in the power source when it's considered full.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energy_full(): number;
set energy_full(val: number);
/**
* Amount of energy (measured in Wh) in the power source when it's considered full.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energyFull(): number;
set energyFull(val: number);
/**
* Amount of energy (measured in Wh) the power source is designed to hold when it's considered full.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energy_full_design(): number;
set energy_full_design(val: number);
/**
* Amount of energy (measured in Wh) the power source is designed to hold when it's considered full.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energyFullDesign(): number;
set energyFullDesign(val: number);
/**
* Amount of energy being drained from the source, measured in W. If positive, the source is being discharged, if negative it's being charged.
*
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energy_rate(): number;
set energy_rate(val: number);
/**
* Amount of energy being drained from the source, measured in W. If positive, the source is being discharged, if negative it's being charged.
*
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energyRate(): number;
set energyRate(val: number);
/**
* Voltage in the Cell or being recorded by the meter.
*/
get voltage(): number;
set voltage(val: number);
/**
* The number of charge cycles as defined by the TCO certification, or -1 if that value is unknown or not applicable.
*/
get charge_cycles(): number;
set charge_cycles(val: number);
/**
* The number of charge cycles as defined by the TCO certification, or -1 if that value is unknown or not applicable.
*/
get chargeCycles(): number;
set chargeCycles(val: number);
/**
* Luminosity being recorded by the meter.
*/
get luminosity(): number;
set luminosity(val: number);
/**
* Number of seconds until the power source is considered empty. Is set to 0 if unknown.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get time_to_empty(): number;
set time_to_empty(val: number);
/**
* Number of seconds until the power source is considered empty. Is set to 0 if unknown.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get timeToEmpty(): number;
set timeToEmpty(val: number);
/**
* Number of seconds until the power source is considered full. Is set to 0 if unknown.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get time_to_full(): number;
set time_to_full(val: number);
/**
* Number of seconds until the power source is considered full. Is set to 0 if unknown.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get timeToFull(): number;
set timeToFull(val: number);
/**
* The amount of energy left in the power source expressed as a percentage between 0 and 1.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY]. The percentage
* will be an approximation if [property`AstalBattery`.Device:battery_level] is set to something other than None.
*/
get percentage(): number;
set percentage(val: number);
/**
* The temperature of the device in degrees Celsius.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get temperature(): number;
set temperature(val: number);
/**
* If the power source is present in the bay.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get is_present(): boolean;
set is_present(val: boolean);
/**
* If the power source is present in the bay.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get isPresent(): boolean;
set isPresent(val: boolean);
/**
* The battery power state.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get state(): State;
set state(val: State);
/**
* If the power source is rechargeable.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get is_rechargable(): boolean;
set is_rechargable(val: boolean);
/**
* If the power source is rechargeable.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get isRechargable(): boolean;
set isRechargable(val: boolean);
/**
* The capacity of the power source expressed as a percentage between 0 and 1.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get capacity(): number;
set capacity(val: number);
/**
* Technology used in the battery:
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get technology(): Technology;
set technology(val: Technology);
/**
* Warning level of the battery.
*/
get warning_level(): WarningLevel;
set warning_level(val: WarningLevel);
/**
* Warning level of the battery.
*/
get warningLevel(): WarningLevel;
set warningLevel(val: WarningLevel);
/**
* The level of the battery for devices which do not report a percentage but rather a coarse battery level. If the value is None. then the device
* does not support coarse battery reporting, and the [property`AstalBattery`.Device:percentage] should be used instead.
*/
get battery_level(): BatteryLevel;
set battery_level(val: BatteryLevel);
/**
* The level of the battery for devices which do not report a percentage but rather a coarse battery level. If the value is None. then the device
* does not support coarse battery reporting, and the [property`AstalBattery`.Device:percentage] should be used instead.
*/
get batteryLevel(): BatteryLevel;
set batteryLevel(val: BatteryLevel);
/**
* An icon name representing this Device.
* NOTE: [property`AstalBattery`.Device:battery_icon_name] might be a better fit as it is calculated from percentage.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* An icon name representing this Device.
* NOTE: [property`AstalBattery`.Device:battery_icon_name] might be a better fit as it is calculated from percentage.
*/
get iconName(): string;
set iconName(val: string);
/**
* Indicates if [property`AstalBattery`.Device:state] is charging or fully charged.
*/
get charging(): boolean;
set charging(val: boolean);
/**
* Indicates if [property`AstalBattery`.Device:device_type] is not line power or unknown.
*/
get is_battery(): boolean;
set is_battery(val: boolean);
/**
* Indicates if [property`AstalBattery`.Device:device_type] is not line power or unknown.
*/
get isBattery(): boolean;
set isBattery(val: boolean);
/**
* An icon name in the form of "battery-level-$percentage-$state-symbolic".
*/
get battery_icon_name(): string;
set battery_icon_name(val: string);
/**
* An icon name in the form of "battery-level-$percentage-$state-symbolic".
*/
get batteryIconName(): string;
set batteryIconName(val: string);
/**
* A string representation of this device's [property`AstalBattery`.Device:device_type].
*/
get device_type_name(): string;
set device_type_name(val: string);
/**
* A string representation of this device's [property`AstalBattery`.Device:device_type].
*/
get deviceTypeName(): string;
set deviceTypeName(val: string);
/**
* An icon name that can be used to represent this device's [property`AstalBattery`.Device:device_type].
*/
get device_type_icon(): string;
set device_type_icon(val: string);
/**
* An icon name that can be used to represent this device's [property`AstalBattery`.Device:device_type].
*/
get deviceTypeIcon(): string;
set deviceTypeIcon(val: string);
// Constructors
constructor(properties?: Partial<Device.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](path: never): Device;
// Static methods
/**
* Get the DisplayDevice.
*/
static get_default(): Device | null;
// Methods
get_device_type(): Type;
get_native_path(): string;
get_vendor(): string;
get_model(): string;
get_serial(): string;
get_update_time(): number;
get_power_supply(): boolean;
get_online(): boolean;
get_energy(): number;
get_energy_empty(): number;
get_energy_full(): number;
get_energy_full_design(): number;
get_energy_rate(): number;
get_voltage(): number;
get_charge_cycles(): number;
get_luminosity(): number;
get_time_to_empty(): number;
get_time_to_full(): number;
get_percentage(): number;
get_temperature(): number;
get_is_present(): boolean;
get_state(): State;
get_is_rechargable(): boolean;
get_capacity(): number;
get_technology(): Technology;
get_warning_level(): WarningLevel;
get_battery_level(): BatteryLevel;
get_icon_name(): string;
get_charging(): boolean;
get_is_battery(): boolean;
get_battery_icon_name(): string;
get_device_type_name(): string;
get_device_type_icon(): string;
}
namespace UPower {
// Signal callback interfaces
interface DeviceAdded {
(device: Device): void;
}
interface DeviceRemoved {
(device: Device): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
devices: Device[];
display_device: Device;
displayDevice: Device;
daemon_version: string;
daemonVersion: string;
on_battery: boolean;
onBattery: boolean;
lid_is_closed: boolean;
lidIsClosed: boolean;
lid_is_present: boolean;
lidIsPresent: boolean;
critical_action: string;
criticalAction: string;
}
}
/**
* Client for the UPower [dbus interface](https://upower.freedesktop.org/docs/UPower.html).
*/
class UPower extends GObject.Object {
static $gtype: GObject.GType<UPower>;
// Properties
/**
* List of UPower devices.
*/
get devices(): Device[];
/**
* A composite device that represents the battery status.
*/
get display_device(): Device;
/**
* A composite device that represents the battery status.
*/
get displayDevice(): Device;
get daemon_version(): string;
get daemonVersion(): string;
/**
* Indicates whether the system is running on battery power.
*/
get on_battery(): boolean;
/**
* Indicates whether the system is running on battery power.
*/
get onBattery(): boolean;
/**
* Indicates if the laptop lid is closed where the display cannot be seen.
*/
get lid_is_closed(): boolean;
/**
* Indicates if the laptop lid is closed where the display cannot be seen.
*/
get lidIsClosed(): boolean;
/**
* Indicates if the system has a lid device.
*/
get lid_is_present(): boolean;
/**
* Indicates if the system has a lid device.
*/
get lidIsPresent(): boolean;
/**
* When the system's power supply is critical (critically low batteries or UPS), the system will take this action.
*/
get critical_action(): string;
/**
* When the system's power supply is critical (critically low batteries or UPS), the system will take this action.
*/
get criticalAction(): string;
// Constructors
constructor(properties?: Partial<UPower.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): UPower;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'device-added', callback: (_source: this, device: Device) => void): number;
connect_after(signal: 'device-added', callback: (_source: this, device: Device) => void): number;
emit(signal: 'device-added', device: Device): void;
connect(signal: 'device-removed', callback: (_source: this, device: Device) => void): number;
connect_after(signal: 'device-removed', callback: (_source: this, device: Device) => void): number;
emit(signal: 'device-removed', device: Device): void;
// Methods
get_devices(): Device[];
get_display_device(): Device;
get_daemon_version(): string;
get_on_battery(): boolean;
get_lid_is_closed(): boolean;
get_lid_is_present(): boolean;
get_critical_action(): string;
}
type DeviceClass = typeof Device;
abstract class DevicePrivate {
static $gtype: GObject.GType<DevicePrivate>;
// Constructors
_init(...args: any[]): void;
}
type UPowerClass = typeof UPower;
abstract class UPowerPrivate {
static $gtype: GObject.GType<UPowerPrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalBattery;
}
declare module 'gi://AstalBattery' {
import AstalBattery01 from 'gi://AstalBattery?version=0.1';
export default AstalBattery01;
}
// END

View File

@ -1,551 +0,0 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalBluetooth?version=0.1' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AstalBluetooth {
/**
* AstalBluetooth-0.1
*/
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
/**
* Gets the default singleton Bluetooth object.
*/
function get_default(): Bluetooth;
namespace Adapter {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
uuids: string[];
discovering: boolean;
modalias: string;
name: string;
class: number;
address: string;
discoverable: boolean;
pairable: boolean;
powered: boolean;
alias: string;
discoverable_timeout: number;
discoverableTimeout: number;
pairable_timeout: number;
pairableTimeout: number;
}
}
/**
* Object representing an [adapter](https://github.com/RadiusNetworks/bluez/blob/master/doc/adapter-api.txt).
*/
class Adapter extends GObject.Object {
static $gtype: GObject.GType<Adapter>;
// Properties
/**
* List of 128-bit UUIDs that represents the available local services.
*/
get uuids(): string[];
/**
* Indicates that a device discovery procedure is active.
*/
get discovering(): boolean;
/**
* Local Device ID information in modalias format used by the kernel and udev.
*/
get modalias(): string;
/**
* The Bluetooth system name (pretty hostname).
*/
get name(): string;
/**
* The Bluetooth class of device.
*/
get class(): number;
/**
* The Bluetooth device address.
*/
get address(): string;
/**
* Switch an adapter to discoverable or non-discoverable to either make it visible or hide it.
*/
get discoverable(): boolean;
set discoverable(val: boolean);
/**
* Switch an adapter to pairable or non-pairable.
*/
get pairable(): boolean;
set pairable(val: boolean);
/**
* Switch an adapter on or off.
*/
get powered(): boolean;
set powered(val: boolean);
/**
* The Bluetooth friendly name.
* In case no alias is set, it will return [property`AstalBluetooth`.Adapter:name].
*/
get alias(): string;
set alias(val: string);
/**
* The discoverable timeout in seconds. A value of zero means that the timeout is disabled and it will stay in discoverable/limited mode forever
* until [method`AstalBluetooth`.Adapter.stop_discovery] is invoked. The default value for the discoverable timeout should be `180`.
*/
get discoverable_timeout(): number;
set discoverable_timeout(val: number);
/**
* The discoverable timeout in seconds. A value of zero means that the timeout is disabled and it will stay in discoverable/limited mode forever
* until [method`AstalBluetooth`.Adapter.stop_discovery] is invoked. The default value for the discoverable timeout should be `180`.
*/
get discoverableTimeout(): number;
set discoverableTimeout(val: number);
/**
* The pairable timeout in seconds.
* A value of zero means that the timeout is disabled and it will stay in pairable mode forever. The default value for pairable timeout should be
* disabled `0`.
*/
get pairable_timeout(): number;
set pairable_timeout(val: number);
/**
* The pairable timeout in seconds.
* A value of zero means that the timeout is disabled and it will stay in pairable mode forever. The default value for pairable timeout should be
* disabled `0`.
*/
get pairableTimeout(): number;
set pairableTimeout(val: number);
// Constructors
constructor(properties?: Partial<Adapter.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* This removes the remote device and the pairing information.
* Possible errors: `InvalidArguments`, `Failed`.
* @param device
*/
remove_device(device: Device): void;
/**
* This method starts the device discovery procedure.
* Possible errors: `NotReady`, `Failed`.
*/
start_discovery(): void;
/**
* This method will cancel any previous [method`AstalBluetooth`.Adapter.start_discovery] procedure.
* Possible errors: `NotReady`, `Failed`, `NotAuthorized`.
*/
stop_discovery(): void;
get_uuids(): string[];
get_discovering(): boolean;
get_modalias(): string;
get_name(): string;
get_class(): number;
get_address(): string;
get_discoverable(): boolean;
set_discoverable(value: boolean): void;
get_pairable(): boolean;
set_pairable(value: boolean): void;
get_powered(): boolean;
set_powered(value: boolean): void;
get_alias(): string;
set_alias(value: string): void;
get_discoverable_timeout(): number;
set_discoverable_timeout(value: number): void;
get_pairable_timeout(): number;
set_pairable_timeout(value: number): void;
}
namespace Bluetooth {
// Signal callback interfaces
interface DeviceAdded {
(device: Device): void;
}
interface DeviceRemoved {
(device: Device): void;
}
interface AdapterAdded {
(adapter: Adapter): void;
}
interface AdapterRemoved {
(adapter: Adapter): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
is_powered: boolean;
isPowered: boolean;
is_connected: boolean;
isConnected: boolean;
adapter: Adapter;
adapters: Adapter[];
devices: Device[];
}
}
/**
* Manager object for `org.bluez`.
*/
class Bluetooth extends GObject.Object {
static $gtype: GObject.GType<Bluetooth>;
// Properties
/**
* `true` if any of the [property`AstalBluetooth`.Bluetooth:adapters] are powered.
*/
get is_powered(): boolean;
set is_powered(val: boolean);
/**
* `true` if any of the [property`AstalBluetooth`.Bluetooth:adapters] are powered.
*/
get isPowered(): boolean;
set isPowered(val: boolean);
/**
* `true` if any of the [property`AstalBluetooth`.Bluetooth:devices] is connected.
*/
get is_connected(): boolean;
set is_connected(val: boolean);
/**
* `true` if any of the [property`AstalBluetooth`.Bluetooth:devices] is connected.
*/
get isConnected(): boolean;
set isConnected(val: boolean);
/**
* The first registered adapter which is usually the only adapter.
*/
get adapter(): Adapter;
/**
* List of adapters available on the host device.
*/
get adapters(): Adapter[];
/**
* List of registered devices on the `org.bluez` bus.
*/
get devices(): Device[];
// Constructors
constructor(properties?: Partial<Bluetooth.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Bluetooth;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'device-added', callback: (_source: this, device: Device) => void): number;
connect_after(signal: 'device-added', callback: (_source: this, device: Device) => void): number;
emit(signal: 'device-added', device: Device): void;
connect(signal: 'device-removed', callback: (_source: this, device: Device) => void): number;
connect_after(signal: 'device-removed', callback: (_source: this, device: Device) => void): number;
emit(signal: 'device-removed', device: Device): void;
connect(signal: 'adapter-added', callback: (_source: this, adapter: Adapter) => void): number;
connect_after(signal: 'adapter-added', callback: (_source: this, adapter: Adapter) => void): number;
emit(signal: 'adapter-added', adapter: Adapter): void;
connect(signal: 'adapter-removed', callback: (_source: this, adapter: Adapter) => void): number;
connect_after(signal: 'adapter-removed', callback: (_source: this, adapter: Adapter) => void): number;
emit(signal: 'adapter-removed', adapter: Adapter): void;
// Static methods
/**
* Gets the default singleton Bluetooth object.
*/
static get_default(): Bluetooth;
// Methods
/**
* Toggle the [property`AstalBluetooth`.Adapter:powered] property of the [property`AstalBluetooth`.Bluetooth:adapter].
*/
toggle(): void;
get_is_powered(): boolean;
get_is_connected(): boolean;
get_adapter(): Adapter | null;
get_adapters(): Adapter[];
get_devices(): Device[];
}
namespace Device {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
uuids: string[];
connected: boolean;
legacy_pairing: boolean;
legacyPairing: boolean;
paired: boolean;
rssi: number;
adapter: never;
address: string;
icon: string;
modalias: string;
name: string;
appearance: number;
class: number;
connecting: boolean;
blocked: boolean;
trusted: boolean;
battery_percentage: number;
batteryPercentage: number;
alias: string;
}
}
/**
* Object representing a [device](https://github.com/luetzel/bluez/blob/master/doc/device-api.txt).
*/
class Device extends GObject.Object {
static $gtype: GObject.GType<Device>;
// Properties
/**
* List of 128-bit UUIDs that represents the available remote services.
*/
get uuids(): string[];
/**
* Indicates if the remote device is currently connected.
*/
get connected(): boolean;
/**
* `true` if the device only supports the pre-2.1 pairing mechanism.
*/
get legacy_pairing(): boolean;
/**
* `true` if the device only supports the pre-2.1 pairing mechanism.
*/
get legacyPairing(): boolean;
/**
* Indicates if the remote device is paired.
*/
get paired(): boolean;
/**
* Received Signal Strength Indicator of the remote device (inquiry or advertising).
*/
get rssi(): number;
/**
* The object path of the adapter the device belongs to.
*/
get adapter(): never;
/**
* The Bluetooth device address of the remote device.
*/
get address(): string;
/**
* Proposed icon name.
*/
get icon(): string;
/**
* Remote Device ID information in modalias format used by the kernel and udev.
*/
get modalias(): string;
/**
* The Bluetooth remote name.
* It is always better to use [property`AstalBluetooth`.Device:alias].
*/
get name(): string;
/**
* External appearance of device, as found on GAP service.
*/
get appearance(): number;
/**
* The Bluetooth class of device of the remote device.
*/
get class(): number;
/**
* Indicates if this device is currently trying to be connected.
*/
get connecting(): boolean;
set connecting(val: boolean);
/**
* If set to `true` any incoming connections from the device will be immediately rejected.
*/
get blocked(): boolean;
set blocked(val: boolean);
/**
* Indicates if the remote is seen as trusted.
*/
get trusted(): boolean;
set trusted(val: boolean);
/**
* The percentage of battery left on the device if it has one, else -1.
*/
get battery_percentage(): number;
/**
* The percentage of battery left on the device if it has one, else -1.
*/
get batteryPercentage(): number;
/**
* The name alias for the remote device.
* In case no alias is set, it will return the remote device [property`AstalBluetooth`.Device:name].
*/
get alias(): string;
set alias(val: string);
// Constructors
constructor(properties?: Partial<Device.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* This is a generic method to connect any profiles the remote device supports that can be connected to.
* Possible errors: `NotReady`, `Failed`, `InProgress`, `AlreadyConnected`.
*/
connect_device(): Promise<void>;
/**
* This is a generic method to connect any profiles the remote device supports that can be connected to.
* Possible errors: `NotReady`, `Failed`, `InProgress`, `AlreadyConnected`.
* @param _callback_
*/
connect_device(_callback_: Gio.AsyncReadyCallback<this> | null): void;
/**
* This is a generic method to connect any profiles the remote device supports that can be connected to.
* Possible errors: `NotReady`, `Failed`, `InProgress`, `AlreadyConnected`.
* @param _callback_
*/
connect_device(_callback_?: Gio.AsyncReadyCallback<this> | null): Promise<void> | void;
connect_device_finish(_res_: Gio.AsyncResult): void;
/**
* This method gracefully disconnects all connected profiles.
* Possible errors: `NotConnected`.
*/
disconnect_device(): Promise<void>;
/**
* This method gracefully disconnects all connected profiles.
* Possible errors: `NotConnected`.
* @param _callback_
*/
disconnect_device(_callback_: Gio.AsyncReadyCallback<this> | null): void;
/**
* This method gracefully disconnects all connected profiles.
* Possible errors: `NotConnected`.
* @param _callback_
*/
disconnect_device(_callback_?: Gio.AsyncReadyCallback<this> | null): Promise<void> | void;
disconnect_device_finish(_res_: Gio.AsyncResult): void;
/**
* This method connects a specific profile of this device. The UUID provided is the remote service UUID for the profile.
* Possible errors: `Failed`, `InProgress`, `InvalidArguments`, `NotAvailable`, `NotReady`.
* @param uuid the remote service UUID.
*/
connect_profile(uuid: string): void;
/**
* This method disconnects a specific profile of this device.
* Possible errors: `Failed`, `InProgress`, `InvalidArguments`, `NotSupported`.
* @param uuid the remote service UUID.
*/
disconnect_profile(uuid: string): void;
/**
* This method will connect to the remote device and initiate pairing.
* Possible errors: `InvalidArguments`, `Failed`, `AlreadyExists`, `AuthenticationCanceled`, `AuthenticationFailed`, `AuthenticationRejected`,
* `AuthenticationTimeout`, `ConnectionAttemptFailed`.
*/
pair(): void;
/**
* This method can be used to cancel a pairing operation initiated by [method`AstalBluetooth`.Device.pair].
* Possible errors: `DoesNotExist`, `Failed`.
*/
cancel_pairing(): void;
get_uuids(): string[];
get_connected(): boolean;
get_legacy_pairing(): boolean;
get_paired(): boolean;
get_rssi(): number;
get_adapter(): never;
get_address(): string;
get_icon(): string;
get_modalias(): string;
get_name(): string;
get_appearance(): number;
get_class(): number;
get_connecting(): boolean;
get_blocked(): boolean;
set_blocked(value: boolean): void;
get_trusted(): boolean;
set_trusted(value: boolean): void;
get_battery_percentage(): number;
get_alias(): string;
set_alias(value: string): void;
}
type AdapterClass = typeof Adapter;
abstract class AdapterPrivate {
static $gtype: GObject.GType<AdapterPrivate>;
// Constructors
_init(...args: any[]): void;
}
type BluetoothClass = typeof Bluetooth;
abstract class BluetoothPrivate {
static $gtype: GObject.GType<BluetoothPrivate>;
// Constructors
_init(...args: any[]): void;
}
type DeviceClass = typeof Device;
abstract class DevicePrivate {
static $gtype: GObject.GType<DevicePrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalBluetooth;
}
declare module 'gi://AstalBluetooth' {
import AstalBluetooth01 from 'gi://AstalBluetooth?version=0.1';
export default AstalBluetooth01;
}
// END

View File

@ -1,222 +0,0 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalCava?version=0.1' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AstalCava {
/**
* AstalCava-0.1
*/
export namespace Input {
export const $gtype: GObject.GType<Input>;
}
enum Input {
FIFO,
PORTAUDIO,
PIPEWIRE,
ALSA,
PULSE,
SNDIO,
SHMEM,
WINSCAP,
}
/**
* gets the default Cava object.
*/
function get_default(): Cava | null;
namespace Cava {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
active: boolean;
autosens: boolean;
bars: number;
channels: number;
framerate: number;
high_cutoff: number;
highCutoff: number;
input: Input;
low_cutoff: number;
lowCutoff: number;
noise_reduction: number;
noiseReduction: number;
samplerate: number;
source: string;
stereo: boolean;
values: number[];
}
}
class Cava extends GObject.Object {
static $gtype: GObject.GType<Cava>;
// Properties
/**
* whether or not the audio capture and visualization is running. if false the values array will
* not be updated.
*/
get active(): boolean;
set active(val: boolean);
/**
* When set, the sensitivity will automatically be adjusted.
*/
get autosens(): boolean;
set autosens(val: boolean);
/**
* the number of bars the visualizer should create.
*/
get bars(): number;
set bars(val: number);
/**
* how many input channels to consider
*/
get channels(): number;
set channels(val: number);
/**
* how often the values should be updated
*/
get framerate(): number;
set framerate(val: number);
/**
* cut off frequencies above this value
*/
get high_cutoff(): number;
set high_cutoff(val: number);
/**
* cut off frequencies above this value
*/
get highCutoff(): number;
set highCutoff(val: number);
/**
* specifies which audio server should be used.
*/
get input(): Input;
set input(val: Input);
/**
* cut off frequencies below this value
*/
get low_cutoff(): number;
set low_cutoff(val: number);
/**
* cut off frequencies below this value
*/
get lowCutoff(): number;
set lowCutoff(val: number);
/**
* adjusts the noise-reduction filter. low values are fast and noisy, large values are slow and
* smooth.
*/
get noise_reduction(): number;
set noise_reduction(val: number);
/**
* adjusts the noise-reduction filter. low values are fast and noisy, large values are slow and
* smooth.
*/
get noiseReduction(): number;
set noiseReduction(val: number);
/**
* the samplerate of the input
*/
get samplerate(): number;
set samplerate(val: number);
/**
* specifies which audio source should be used. Refer to the cava docs on how to use this
* property.
*/
get source(): string;
set source(val: string);
get stereo(): boolean;
set stereo(val: boolean);
/**
* A list of values, each represent the height of one bar. The values are generally between 0
* and 1 but can overshoot occasionally, in which case the sensitivity will be decreased
* automatically if [property`AstalCava`.Cava:autosens] is set. The array will have
* [property`AstalCava`.Cava:bars] entries. If [property`AstalCava`.Cava:stereo] is set, the first
* half of the array will represent the left channel and the second half the right channel, so
* there will be only bars/2 bars per channel. If the number of bars is odd, the last value will
* be 0.
*/
get values(): number[];
// Constructors
constructor(properties?: Partial<Cava.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Static methods
/**
* gets the default Cava object.
*/
static get_default(): Cava | null;
// Methods
get_active(): boolean;
get_autosens(): boolean;
get_bars(): number;
get_channels(): number;
get_framerate(): number;
get_high_cutoff(): number;
get_input(): Input;
get_low_cutoff(): number;
get_noise_reduction(): number;
get_samplerate(): number;
get_source(): string;
get_stereo(): boolean;
get_values(): number[];
set_active(active: boolean): void;
set_autosens(autosens: boolean): void;
set_bars(bars: number): void;
set_channels(channels: number): void;
set_framerate(framerate: number): void;
set_high_cutoff(high_cutoff: number): void;
set_input(input: Input | null): void;
set_low_cutoff(low_cutoff: number): void;
set_noise_reduction(noise: number): void;
set_samplerate(samplerate: number): void;
set_source(source: string): void;
set_stereo(stereo: boolean): void;
}
type CavaClass = typeof Cava;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalCava;
}
declare module 'gi://AstalCava' {
import AstalCava01 from 'gi://AstalCava?version=0.1';
export default AstalCava01;
}
// END

View File

@ -1,533 +0,0 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalGreet?version=0.1' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AstalGreet {
/**
* AstalGreet-0.1
*/
export namespace ErrorType {
export const $gtype: GObject.GType<ErrorType>;
}
enum ErrorType {
/**
* Indicates that authentication failed. This is not a fatal error, and is likely caused by incorrect credentials.
*/
AUTH_ERROR,
/**
* A general error. See the error description for more information.
*/
ERROR,
}
export namespace AuthMessageType {
export const $gtype: GObject.GType<AuthMessageType>;
}
enum AuthMessageType {
/**
* Indicates that input from the user should be visible when they answer this question.
*/
VISIBLE,
/**
* Indicates that input from the user should be considered secret when they answer this question.
*/
SECRET,
/**
* Indicates that this message is informative, not a question.
*/
INFO,
/**
* Indicates that this message is an error, not a question.
*/
ERROR,
}
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
/**
* Shorthand for creating a session, posting the password, and starting the session with the given `cmd` which is parsed with [func@
* GLib.shell_parse_argv].
* @param username User to login to
* @param password Password of the user
* @param cmd Command to start the session with
*/
function login(username: string, password: string, cmd: string): Promise<void>;
/**
* Shorthand for creating a session, posting the password, and starting the session with the given `cmd` which is parsed with [func@
* GLib.shell_parse_argv].
* @param username User to login to
* @param password Password of the user
* @param cmd Command to start the session with
* @param _callback_
*/
function login(
username: string,
password: string,
cmd: string,
_callback_: Gio.AsyncReadyCallback<string> | null,
): void;
/**
* Shorthand for creating a session, posting the password, and starting the session with the given `cmd` which is parsed with [func@
* GLib.shell_parse_argv].
* @param username User to login to
* @param password Password of the user
* @param cmd Command to start the session with
* @param _callback_
*/
function login(
username: string,
password: string,
cmd: string,
_callback_?: Gio.AsyncReadyCallback<string> | null,
): Promise<void> | void;
function login_finish(_res_: Gio.AsyncResult): void;
/**
* Same as [func`AstalGreet`.login] but allow for setting additonal env in the form of `name=value` pairs.
* @param username User to login to
* @param password Password of the user
* @param cmd Command to start the session with
* @param env Additonal env vars to set for the session
*/
function login_with_env(username: string, password: string, cmd: string, env: string[]): Promise<void>;
/**
* Same as [func`AstalGreet`.login] but allow for setting additonal env in the form of `name=value` pairs.
* @param username User to login to
* @param password Password of the user
* @param cmd Command to start the session with
* @param env Additonal env vars to set for the session
* @param _callback_
*/
function login_with_env(
username: string,
password: string,
cmd: string,
env: string[],
_callback_: Gio.AsyncReadyCallback<string> | null,
): void;
/**
* Same as [func`AstalGreet`.login] but allow for setting additonal env in the form of `name=value` pairs.
* @param username User to login to
* @param password Password of the user
* @param cmd Command to start the session with
* @param env Additonal env vars to set for the session
* @param _callback_
*/
function login_with_env(
username: string,
password: string,
cmd: string,
env: string[],
_callback_?: Gio.AsyncReadyCallback<string> | null,
): Promise<void> | void;
function login_with_env_finish(_res_: Gio.AsyncResult): void;
namespace Request {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
type_name: string;
typeName: string;
}
}
/**
* Base Request type.
*/
abstract class Request extends GObject.Object {
static $gtype: GObject.GType<Request>;
// Properties
get type_name(): string;
get typeName(): string;
// Constructors
constructor(properties?: Partial<Request.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Virtual methods
vfunc_get_type_name(): string;
// Methods
/**
* Send this request to greetd.
*/
send(): Promise<Response>;
/**
* Send this request to greetd.
* @param _callback_
*/
send(_callback_: Gio.AsyncReadyCallback<this> | null): void;
/**
* Send this request to greetd.
* @param _callback_
*/
send(_callback_?: Gio.AsyncReadyCallback<this> | null): Promise<Response> | void;
send_finish(_res_: Gio.AsyncResult): Response;
get_type_name(): string;
}
namespace CreateSession {
// Constructor properties interface
interface ConstructorProps extends Request.ConstructorProps {
username: string;
}
}
/**
* Creates a session and initiates a login attempted for the given user. The session is ready to be started if a success is returned.
*/
class CreateSession extends Request {
static $gtype: GObject.GType<CreateSession>;
// Properties
get username(): string;
set username(val: string);
// Constructors
constructor(properties?: Partial<CreateSession.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](username: string): CreateSession;
// Methods
get_username(): string;
set_username(value: string): void;
}
namespace PostAuthMesssage {
// Constructor properties interface
interface ConstructorProps extends Request.ConstructorProps {
response: string;
}
}
/**
* Answers an authentication message. If the message was informative (info, error), then a response does not need to be set in this
* message. The session is ready to be started if a success is returned.
*/
class PostAuthMesssage extends Request {
static $gtype: GObject.GType<PostAuthMesssage>;
// Properties
get response(): string;
set response(val: string);
// Constructors
constructor(properties?: Partial<PostAuthMesssage.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](response: string): PostAuthMesssage;
// Methods
get_response(): string;
set_response(value: string): void;
}
namespace StartSession {
// Constructor properties interface
interface ConstructorProps extends Request.ConstructorProps {
cmd: string[];
env: string[];
}
}
/**
* Requests for the session to be started using the provided command line, adding the supplied environment to that created by PAM. The session
* will start after the greeter process terminates
*/
class StartSession extends Request {
static $gtype: GObject.GType<StartSession>;
// Properties
get cmd(): string[];
set cmd(val: string[]);
get env(): string[];
set env(val: string[]);
// Constructors
constructor(properties?: Partial<StartSession.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](cmd: string[], env: string[]): StartSession;
// Methods
get_cmd(): string[];
set_cmd(value: string[]): void;
get_env(): string[];
set_env(value: string[]): void;
}
namespace CancelSession {
// Constructor properties interface
interface ConstructorProps extends Request.ConstructorProps {}
}
/**
* Cancels the session that is currently under configuration.
*/
class CancelSession extends Request {
static $gtype: GObject.GType<CancelSession>;
// Constructors
constructor(properties?: Partial<CancelSession.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CancelSession;
}
namespace Response {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Base Response type.
*/
abstract class Response extends GObject.Object {
static $gtype: GObject.GType<Response>;
// Constructors
constructor(properties?: Partial<Response.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace Success {
// Constructor properties interface
interface ConstructorProps extends Response.ConstructorProps {}
}
/**
* Indicates that the request succeeded.
*/
class Success extends Response {
static $gtype: GObject.GType<Success>;
// Constructors
constructor(properties?: Partial<Success.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace Error {
// Constructor properties interface
interface ConstructorProps extends Response.ConstructorProps {
error_type: ErrorType;
errorType: ErrorType;
description: string;
}
}
/**
* Indicates that the request succeeded.
*/
class Error extends Response {
static $gtype: GObject.GType<Error>;
// Properties
get error_type(): ErrorType;
set error_type(val: ErrorType);
get errorType(): ErrorType;
set errorType(val: ErrorType);
get description(): string;
set description(val: string);
// Constructors
constructor(properties?: Partial<Error.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
get_error_type(): ErrorType;
get_description(): string;
}
namespace AuthMessage {
// Constructor properties interface
interface ConstructorProps extends Response.ConstructorProps {
message_type: AuthMessageType;
messageType: AuthMessageType;
message: string;
}
}
/**
* Indicates that the request succeeded.
*/
class AuthMessage extends Response {
static $gtype: GObject.GType<AuthMessage>;
// Properties
get message_type(): AuthMessageType;
set message_type(val: AuthMessageType);
get messageType(): AuthMessageType;
set messageType(val: AuthMessageType);
get message(): string;
set message(val: string);
// Constructors
constructor(properties?: Partial<AuthMessage.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
get_message_type(): AuthMessageType;
get_message(): string;
}
type RequestClass = typeof Request;
abstract class RequestPrivate {
static $gtype: GObject.GType<RequestPrivate>;
// Constructors
_init(...args: any[]): void;
}
type CreateSessionClass = typeof CreateSession;
abstract class CreateSessionPrivate {
static $gtype: GObject.GType<CreateSessionPrivate>;
// Constructors
_init(...args: any[]): void;
}
type PostAuthMesssageClass = typeof PostAuthMesssage;
abstract class PostAuthMesssagePrivate {
static $gtype: GObject.GType<PostAuthMesssagePrivate>;
// Constructors
_init(...args: any[]): void;
}
type StartSessionClass = typeof StartSession;
abstract class StartSessionPrivate {
static $gtype: GObject.GType<StartSessionPrivate>;
// Constructors
_init(...args: any[]): void;
}
type CancelSessionClass = typeof CancelSession;
abstract class CancelSessionPrivate {
static $gtype: GObject.GType<CancelSessionPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ResponseClass = typeof Response;
abstract class ResponsePrivate {
static $gtype: GObject.GType<ResponsePrivate>;
// Constructors
_init(...args: any[]): void;
}
type SuccessClass = typeof Success;
abstract class SuccessPrivate {
static $gtype: GObject.GType<SuccessPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ErrorClass = typeof Error;
abstract class ErrorPrivate {
static $gtype: GObject.GType<ErrorPrivate>;
// Constructors
_init(...args: any[]): void;
}
type AuthMessageClass = typeof AuthMessage;
abstract class AuthMessagePrivate {
static $gtype: GObject.GType<AuthMessagePrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalGreet;
}
declare module 'gi://AstalGreet' {
import AstalGreet01 from 'gi://AstalGreet?version=0.1';
export default AstalGreet01;
}
// END

View File

@ -1,887 +0,0 @@
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalHyprland?version=0.1' {
// Module dependencies
import type GLib from 'gi://GLib?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AstalHyprland {
/**
* AstalHyprland-0.1
*/
export namespace MonitorTransform {
export const $gtype: GObject.GType<MonitorTransform>;
}
enum MonitorTransform {
NORMAL,
ROTATE_90_DEG,
ROTATE_180_DEG,
ROTATE_270_DEG,
FLIPPED,
FLIPPED_ROTATE_90_DEG,
FLIPPED_ROTATE_180_DEG,
FLIPPED_ROTATE_270_DEG,
}
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
function get_default(): Hyprland;
export namespace Fullscreen {
export const $gtype: GObject.GType<Fullscreen>;
}
enum Fullscreen {
CURRENT,
NONE,
MAXIMIZED,
FULLSCREEN,
}
namespace Client {
// Signal callback interfaces
interface Removed {
(): void;
}
interface MovedTo {
(workspace: Workspace): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
address: string;
mapped: boolean;
hidden: boolean;
x: number;
y: number;
width: number;
height: number;
workspace: Workspace;
floating: boolean;
monitor: Monitor;
class: string;
title: string;
initial_class: string;
initialClass: string;
initial_title: string;
initialTitle: string;
pid: number;
xwayland: boolean;
pinned: boolean;
fullscreen: Fullscreen;
fullscreen_client: Fullscreen;
fullscreenClient: Fullscreen;
swallowing: string;
focus_history_id: number;
focusHistoryId: number;
}
}
class Client extends GObject.Object {
static $gtype: GObject.GType<Client>;
// Properties
get address(): string;
set address(val: string);
get mapped(): boolean;
set mapped(val: boolean);
get hidden(): boolean;
set hidden(val: boolean);
get x(): number;
set x(val: number);
get y(): number;
set y(val: number);
get width(): number;
set width(val: number);
get height(): number;
set height(val: number);
get workspace(): Workspace;
set workspace(val: Workspace);
get floating(): boolean;
set floating(val: boolean);
get monitor(): Monitor;
set monitor(val: Monitor);
get class(): string;
set class(val: string);
get title(): string;
set title(val: string);
get initial_class(): string;
set initial_class(val: string);
get initialClass(): string;
set initialClass(val: string);
get initial_title(): string;
set initial_title(val: string);
get initialTitle(): string;
set initialTitle(val: string);
get pid(): number;
set pid(val: number);
get xwayland(): boolean;
set xwayland(val: boolean);
get pinned(): boolean;
set pinned(val: boolean);
get fullscreen(): Fullscreen;
set fullscreen(val: Fullscreen);
get fullscreen_client(): Fullscreen;
set fullscreen_client(val: Fullscreen);
get fullscreenClient(): Fullscreen;
set fullscreenClient(val: Fullscreen);
get swallowing(): string;
set swallowing(val: string);
get focus_history_id(): number;
set focus_history_id(val: number);
get focusHistoryId(): number;
set focusHistoryId(val: number);
// Constructors
constructor(properties?: Partial<Client.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Client;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'removed', callback: (_source: this) => void): number;
connect_after(signal: 'removed', callback: (_source: this) => void): number;
emit(signal: 'removed'): void;
connect(signal: 'moved-to', callback: (_source: this, workspace: Workspace) => void): number;
connect_after(signal: 'moved-to', callback: (_source: this, workspace: Workspace) => void): number;
emit(signal: 'moved-to', workspace: Workspace): void;
// Methods
kill(): void;
focus(): void;
move_to(ws: Workspace): void;
toggle_floating(): void;
get_address(): string;
get_mapped(): boolean;
get_hidden(): boolean;
get_x(): number;
get_y(): number;
get_width(): number;
get_height(): number;
get_workspace(): Workspace;
get_floating(): boolean;
get_monitor(): Monitor;
get_class(): string;
get_title(): string;
get_initial_class(): string;
get_initial_title(): string;
get_pid(): number;
get_xwayland(): boolean;
get_pinned(): boolean;
get_fullscreen(): Fullscreen;
get_fullscreen_client(): Fullscreen;
get_swallowing(): string;
get_focus_history_id(): number;
}
namespace Hyprland {
// Signal callback interfaces
interface Event {
(event: string, args: string): void;
}
interface Minimize {
(client: Client, minimize: boolean): void;
}
interface Floating {
(client: Client, floating: boolean): void;
}
interface Urgent {
(client: Client): void;
}
interface ClientMoved {
(client: Client, ws: Workspace): void;
}
interface Submap {
(name: string): void;
}
interface KeyboardLayout {
(keyboard: string, layout: string): void;
}
interface ConfigReloaded {
(): void;
}
interface ClientAdded {
(client: Client): void;
}
interface ClientRemoved {
(address: string): void;
}
interface WorkspaceAdded {
(workspace: Workspace): void;
}
interface WorkspaceRemoved {
(id: number): void;
}
interface MonitorAdded {
(monitor: Monitor): void;
}
interface MonitorRemoved {
(id: number): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
monitors: Monitor[];
workspaces: Workspace[];
clients: Client[];
focused_workspace: Workspace;
focusedWorkspace: Workspace;
focused_monitor: Monitor;
focusedMonitor: Monitor;
focused_client: Client;
focusedClient: Client;
binds: Bind[];
cursor_position: Position;
cursorPosition: Position;
}
}
class Hyprland extends GObject.Object {
static $gtype: GObject.GType<Hyprland>;
// Properties
get monitors(): Monitor[];
get workspaces(): Workspace[];
get clients(): Client[];
get focused_workspace(): Workspace;
set focused_workspace(val: Workspace);
get focusedWorkspace(): Workspace;
set focusedWorkspace(val: Workspace);
get focused_monitor(): Monitor;
set focused_monitor(val: Monitor);
get focusedMonitor(): Monitor;
set focusedMonitor(val: Monitor);
get focused_client(): Client;
set focused_client(val: Client);
get focusedClient(): Client;
set focusedClient(val: Client);
get binds(): Bind[];
get cursor_position(): Position;
get cursorPosition(): Position;
// Constructors
constructor(properties?: Partial<Hyprland.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Hyprland;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'event', callback: (_source: this, event: string, args: string) => void): number;
connect_after(signal: 'event', callback: (_source: this, event: string, args: string) => void): number;
emit(signal: 'event', event: string, args: string): void;
connect(signal: 'minimize', callback: (_source: this, client: Client, minimize: boolean) => void): number;
connect_after(
signal: 'minimize',
callback: (_source: this, client: Client, minimize: boolean) => void,
): number;
emit(signal: 'minimize', client: Client, minimize: boolean): void;
connect(signal: 'floating', callback: (_source: this, client: Client, floating: boolean) => void): number;
connect_after(
signal: 'floating',
callback: (_source: this, client: Client, floating: boolean) => void,
): number;
emit(signal: 'floating', client: Client, floating: boolean): void;
connect(signal: 'urgent', callback: (_source: this, client: Client) => void): number;
connect_after(signal: 'urgent', callback: (_source: this, client: Client) => void): number;
emit(signal: 'urgent', client: Client): void;
connect(signal: 'client-moved', callback: (_source: this, client: Client, ws: Workspace) => void): number;
connect_after(
signal: 'client-moved',
callback: (_source: this, client: Client, ws: Workspace) => void,
): number;
emit(signal: 'client-moved', client: Client, ws: Workspace): void;
connect(signal: 'submap', callback: (_source: this, name: string) => void): number;
connect_after(signal: 'submap', callback: (_source: this, name: string) => void): number;
emit(signal: 'submap', name: string): void;
connect(
signal: 'keyboard-layout',
callback: (_source: this, keyboard: string, layout: string) => void,
): number;
connect_after(
signal: 'keyboard-layout',
callback: (_source: this, keyboard: string, layout: string) => void,
): number;
emit(signal: 'keyboard-layout', keyboard: string, layout: string): void;
connect(signal: 'config-reloaded', callback: (_source: this) => void): number;
connect_after(signal: 'config-reloaded', callback: (_source: this) => void): number;
emit(signal: 'config-reloaded'): void;
connect(signal: 'client-added', callback: (_source: this, client: Client) => void): number;
connect_after(signal: 'client-added', callback: (_source: this, client: Client) => void): number;
emit(signal: 'client-added', client: Client): void;
connect(signal: 'client-removed', callback: (_source: this, address: string) => void): number;
connect_after(signal: 'client-removed', callback: (_source: this, address: string) => void): number;
emit(signal: 'client-removed', address: string): void;
connect(signal: 'workspace-added', callback: (_source: this, workspace: Workspace) => void): number;
connect_after(signal: 'workspace-added', callback: (_source: this, workspace: Workspace) => void): number;
emit(signal: 'workspace-added', workspace: Workspace): void;
connect(signal: 'workspace-removed', callback: (_source: this, id: number) => void): number;
connect_after(signal: 'workspace-removed', callback: (_source: this, id: number) => void): number;
emit(signal: 'workspace-removed', id: number): void;
connect(signal: 'monitor-added', callback: (_source: this, monitor: Monitor) => void): number;
connect_after(signal: 'monitor-added', callback: (_source: this, monitor: Monitor) => void): number;
emit(signal: 'monitor-added', monitor: Monitor): void;
connect(signal: 'monitor-removed', callback: (_source: this, id: number) => void): number;
connect_after(signal: 'monitor-removed', callback: (_source: this, id: number) => void): number;
emit(signal: 'monitor-removed', id: number): void;
// Static methods
static get_default(): Hyprland | null;
// Methods
get_monitor(id: number): Monitor;
get_workspace(id: number): Workspace;
get_client(address: string): Client | null;
get_monitor_by_name(name: string): Monitor | null;
get_workspace_by_name(name: string): Workspace | null;
message(message: string): string;
message_async(message: string): Promise<string>;
message_async(message: string, _callback_: Gio.AsyncReadyCallback<this> | null): void;
message_async(message: string, _callback_?: Gio.AsyncReadyCallback<this> | null): Promise<string> | void;
message_finish(_res_: Gio.AsyncResult): string;
dispatch(dispatcher: string, args: string): void;
move_cursor(x: number, y: number): void;
sync_monitors(): Promise<void>;
sync_monitors(_callback_: Gio.AsyncReadyCallback<this> | null): void;
sync_monitors(_callback_?: Gio.AsyncReadyCallback<this> | null): Promise<void> | void;
sync_monitors_finish(_res_: Gio.AsyncResult): void;
sync_workspaces(): Promise<void>;
sync_workspaces(_callback_: Gio.AsyncReadyCallback<this> | null): void;
sync_workspaces(_callback_?: Gio.AsyncReadyCallback<this> | null): Promise<void> | void;
sync_workspaces_finish(_res_: Gio.AsyncResult): void;
sync_clients(): Promise<void>;
sync_clients(_callback_: Gio.AsyncReadyCallback<this> | null): void;
sync_clients(_callback_?: Gio.AsyncReadyCallback<this> | null): Promise<void> | void;
sync_clients_finish(_res_: Gio.AsyncResult): void;
get_monitors(): Monitor[];
get_workspaces(): Workspace[];
get_clients(): Client[];
get_focused_workspace(): Workspace;
get_focused_monitor(): Monitor;
get_focused_client(): Client;
get_binds(): Bind[];
get_cursor_position(): Position;
}
namespace Monitor {
// Signal callback interfaces
interface Removed {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
id: number;
name: string;
description: string;
make: string;
model: string;
serial: string;
width: number;
height: number;
refresh_rate: number;
refreshRate: number;
x: number;
y: number;
active_workspace: Workspace;
activeWorkspace: Workspace;
special_workspace: Workspace;
specialWorkspace: Workspace;
reserved_top: number;
reservedTop: number;
reserved_bottom: number;
reservedBottom: number;
reserved_left: number;
reservedLeft: number;
reserved_right: number;
reservedRight: number;
scale: number;
transform: MonitorTransform;
focused: boolean;
dpms_status: boolean;
dpmsStatus: boolean;
vrr: boolean;
actively_tearing: boolean;
activelyTearing: boolean;
disabled: boolean;
current_format: string;
currentFormat: string;
available_modes: string[];
availableModes: string[];
}
}
class Monitor extends GObject.Object {
static $gtype: GObject.GType<Monitor>;
// Properties
get id(): number;
set id(val: number);
get name(): string;
set name(val: string);
get description(): string;
set description(val: string);
get make(): string;
set make(val: string);
get model(): string;
set model(val: string);
get serial(): string;
set serial(val: string);
get width(): number;
set width(val: number);
get height(): number;
set height(val: number);
get refresh_rate(): number;
set refresh_rate(val: number);
get refreshRate(): number;
set refreshRate(val: number);
get x(): number;
set x(val: number);
get y(): number;
set y(val: number);
get active_workspace(): Workspace;
set active_workspace(val: Workspace);
get activeWorkspace(): Workspace;
set activeWorkspace(val: Workspace);
get special_workspace(): Workspace;
set special_workspace(val: Workspace);
get specialWorkspace(): Workspace;
set specialWorkspace(val: Workspace);
get reserved_top(): number;
set reserved_top(val: number);
get reservedTop(): number;
set reservedTop(val: number);
get reserved_bottom(): number;
set reserved_bottom(val: number);
get reservedBottom(): number;
set reservedBottom(val: number);
get reserved_left(): number;
set reserved_left(val: number);
get reservedLeft(): number;
set reservedLeft(val: number);
get reserved_right(): number;
set reserved_right(val: number);
get reservedRight(): number;
set reservedRight(val: number);
get scale(): number;
set scale(val: number);
get transform(): MonitorTransform;
set transform(val: MonitorTransform);
get focused(): boolean;
set focused(val: boolean);
get dpms_status(): boolean;
set dpms_status(val: boolean);
get dpmsStatus(): boolean;
set dpmsStatus(val: boolean);
get vrr(): boolean;
set vrr(val: boolean);
get actively_tearing(): boolean;
set actively_tearing(val: boolean);
get activelyTearing(): boolean;
set activelyTearing(val: boolean);
get disabled(): boolean;
set disabled(val: boolean);
get current_format(): string;
set current_format(val: string);
get currentFormat(): string;
set currentFormat(val: string);
get available_modes(): string[];
set available_modes(val: string[]);
get availableModes(): string[];
set availableModes(val: string[]);
// Constructors
constructor(properties?: Partial<Monitor.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Monitor;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'removed', callback: (_source: this) => void): number;
connect_after(signal: 'removed', callback: (_source: this) => void): number;
emit(signal: 'removed'): void;
// Methods
focus(): void;
get_id(): number;
get_name(): string;
get_description(): string;
get_make(): string;
get_model(): string;
get_serial(): string;
get_width(): number;
get_height(): number;
get_refresh_rate(): number;
get_x(): number;
get_y(): number;
get_active_workspace(): Workspace;
get_special_workspace(): Workspace;
get_reserved_top(): number;
get_reserved_bottom(): number;
get_reserved_left(): number;
get_reserved_right(): number;
get_scale(): number;
get_transform(): MonitorTransform;
get_focused(): boolean;
get_dpms_status(): boolean;
get_vrr(): boolean;
get_actively_tearing(): boolean;
get_disabled(): boolean;
get_current_format(): string;
get_available_modes(): string[];
}
namespace Bind {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
locked: boolean;
mouse: boolean;
release: boolean;
repeat: boolean;
long_press: boolean;
longPress: boolean;
non_consuming: boolean;
nonConsuming: boolean;
has_description: boolean;
hasDescription: boolean;
modmask: number;
submap: string;
key: string;
keycode: number;
catch_all: boolean;
catchAll: boolean;
description: string;
dispatcher: string;
arg: string;
}
}
class Bind extends GObject.Object {
static $gtype: GObject.GType<Bind>;
// Properties
get locked(): boolean;
set locked(val: boolean);
get mouse(): boolean;
set mouse(val: boolean);
get release(): boolean;
set release(val: boolean);
get repeat(): boolean;
set repeat(val: boolean);
get long_press(): boolean;
set long_press(val: boolean);
get longPress(): boolean;
set longPress(val: boolean);
get non_consuming(): boolean;
set non_consuming(val: boolean);
get nonConsuming(): boolean;
set nonConsuming(val: boolean);
get has_description(): boolean;
set has_description(val: boolean);
get hasDescription(): boolean;
set hasDescription(val: boolean);
get modmask(): number;
set modmask(val: number);
get submap(): string;
set submap(val: string);
get key(): string;
set key(val: string);
get keycode(): number;
set keycode(val: number);
get catch_all(): boolean;
set catch_all(val: boolean);
get catchAll(): boolean;
set catchAll(val: boolean);
get description(): string;
set description(val: string);
get dispatcher(): string;
set dispatcher(val: string);
get arg(): string;
set arg(val: string);
// Constructors
constructor(properties?: Partial<Bind.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Bind;
// Methods
get_locked(): boolean;
set_locked(value: boolean): void;
get_mouse(): boolean;
set_mouse(value: boolean): void;
get_release(): boolean;
set_release(value: boolean): void;
get_repeat(): boolean;
set_repeat(value: boolean): void;
get_long_press(): boolean;
set_long_press(value: boolean): void;
get_non_consuming(): boolean;
set_non_consuming(value: boolean): void;
get_has_description(): boolean;
set_has_description(value: boolean): void;
get_modmask(): number;
set_modmask(value: number): void;
get_submap(): string;
set_submap(value: string): void;
get_key(): string;
set_key(value: string): void;
get_keycode(): number;
set_keycode(value: number): void;
get_catch_all(): boolean;
set_catch_all(value: boolean): void;
get_description(): string;
set_description(value: string): void;
get_dispatcher(): string;
set_dispatcher(value: string): void;
get_arg(): string;
set_arg(value: string): void;
}
namespace Position {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
x: number;
y: number;
}
}
class Position extends GObject.Object {
static $gtype: GObject.GType<Position>;
// Properties
get x(): number;
set x(val: number);
get y(): number;
set y(val: number);
// Constructors
constructor(properties?: Partial<Position.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Position;
// Methods
get_x(): number;
set_x(value: number): void;
get_y(): number;
set_y(value: number): void;
}
namespace Workspace {
// Signal callback interfaces
interface Removed {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
id: number;
name: string;
monitor: Monitor;
clients: Client[];
has_fullscreen: boolean;
hasFullscreen: boolean;
last_client: Client;
lastClient: Client;
}
}
class Workspace extends GObject.Object {
static $gtype: GObject.GType<Workspace>;
// Properties
get id(): number;
set id(val: number);
get name(): string;
set name(val: string);
get monitor(): Monitor;
set monitor(val: Monitor);
get clients(): Client[];
get has_fullscreen(): boolean;
set has_fullscreen(val: boolean);
get hasFullscreen(): boolean;
set hasFullscreen(val: boolean);
get last_client(): Client;
set last_client(val: Client);
get lastClient(): Client;
set lastClient(val: Client);
// Constructors
constructor(properties?: Partial<Workspace.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static dummy(id: number, monitor?: Monitor | null): Workspace;
static ['new'](): Workspace;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'removed', callback: (_source: this) => void): number;
connect_after(signal: 'removed', callback: (_source: this) => void): number;
emit(signal: 'removed'): void;
// Methods
focus(): void;
move_to(m: Monitor): void;
get_id(): number;
get_name(): string;
get_monitor(): Monitor;
get_clients(): Client[];
get_has_fullscreen(): boolean;
get_last_client(): Client;
}
type ClientClass = typeof Client;
abstract class ClientPrivate {
static $gtype: GObject.GType<ClientPrivate>;
// Constructors
_init(...args: any[]): void;
}
type HyprlandClass = typeof Hyprland;
abstract class HyprlandPrivate {
static $gtype: GObject.GType<HyprlandPrivate>;
// Constructors
_init(...args: any[]): void;
}
type MonitorClass = typeof Monitor;
abstract class MonitorPrivate {
static $gtype: GObject.GType<MonitorPrivate>;
// Constructors
_init(...args: any[]): void;
}
type BindClass = typeof Bind;
abstract class BindPrivate {
static $gtype: GObject.GType<BindPrivate>;
// Constructors
_init(...args: any[]): void;
}
type PositionClass = typeof Position;
abstract class PositionPrivate {
static $gtype: GObject.GType<PositionPrivate>;
// Constructors
_init(...args: any[]): void;
}
type WorkspaceClass = typeof Workspace;
abstract class WorkspacePrivate {
static $gtype: GObject.GType<WorkspacePrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalHyprland;
}
declare module 'gi://AstalHyprland' {
import AstalHyprland01 from 'gi://AstalHyprland?version=0.1';
export default AstalHyprland01;
}
// END

File diff suppressed because it is too large Load Diff

View File

@ -1,651 +0,0 @@
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalMpris?version=0.1' {
// Module dependencies
import type GLib from 'gi://GLib?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
export namespace AstalMpris {
/**
* AstalMpris-0.1
*/
export namespace PlaybackStatus {
export const $gtype: GObject.GType<PlaybackStatus>;
}
enum PlaybackStatus {
PLAYING,
PAUSED,
STOPPED,
}
export namespace Loop {
export const $gtype: GObject.GType<Loop>;
}
enum Loop {
UNSUPPORTED,
/**
* The playback will stop when there are no more tracks to play.
*/
NONE,
/**
* The current track will start again from the begining once it has finished playing.
*/
TRACK,
/**
* The playback loops through a list of tracks.
*/
PLAYLIST,
}
export namespace Shuffle {
export const $gtype: GObject.GType<Shuffle>;
}
enum Shuffle {
UNSUPPORTED,
/**
* Playback is progressing through a playlist in some other order.
*/
ON,
/**
* Playback is progressing linearly through a playlist.
*/
OFF,
}
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
/**
* Gets the default singleton Mpris instance.
*/
function get_default(): Mpris;
namespace Mpris {
// Signal callback interfaces
interface PlayerAdded {
(player: Player): void;
}
interface PlayerClosed {
(player: Player): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
players: Player[];
}
}
/**
* Object that monitors dbus for players to appear and disappear.
*/
class Mpris extends GObject.Object {
static $gtype: GObject.GType<Mpris>;
// Properties
/**
* List of currently available players.
*/
get players(): Player[];
// Constructors
constructor(properties?: Partial<Mpris.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Mpris;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'player-added', callback: (_source: this, player: Player) => void): number;
connect_after(signal: 'player-added', callback: (_source: this, player: Player) => void): number;
emit(signal: 'player-added', player: Player): void;
connect(signal: 'player-closed', callback: (_source: this, player: Player) => void): number;
connect_after(signal: 'player-closed', callback: (_source: this, player: Player) => void): number;
emit(signal: 'player-closed', player: Player): void;
// Static methods
/**
* Gets the default singleton Mpris instance.
*/
static get_default(): Mpris;
// Methods
get_players(): Player[];
}
namespace Player {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
bus_name: string;
busName: string;
available: boolean;
can_quit: boolean;
canQuit: boolean;
fullscreen: boolean;
can_set_fullscreen: boolean;
canSetFullscreen: boolean;
can_raise: boolean;
canRaise: boolean;
identity: string;
entry: string;
supported_uri_schemes: string[];
supportedUriSchemes: string[];
supported_mime_types: string[];
supportedMimeTypes: string[];
loop_status: Loop;
loopStatus: Loop;
rate: number;
shuffle_status: Shuffle;
shuffleStatus: Shuffle;
volume: number;
position: number;
playback_status: PlaybackStatus;
playbackStatus: PlaybackStatus;
minimum_rate: number;
minimumRate: number;
maximum_rate: number;
maximumRate: number;
can_go_next: boolean;
canGoNext: boolean;
can_go_previous: boolean;
canGoPrevious: boolean;
can_play: boolean;
canPlay: boolean;
can_pause: boolean;
canPause: boolean;
can_seek: boolean;
canSeek: boolean;
can_control: boolean;
canControl: boolean;
metadata: GLib.HashTable<string, GLib.Variant>;
trackid: string;
length: number;
art_url: string;
artUrl: string;
album: string;
album_artist: string;
albumArtist: string;
artist: string;
lyrics: string;
title: string;
composer: string;
comments: string;
cover_art: string;
coverArt: string;
}
}
/**
* Object which tracks players through their mpris dbus interface. The most simple way is to use [class`AstalMpris`.Mpris] which tracks
* every player, but [class`AstalMpris`.Player] can be constructed for a dedicated players too.
*/
class Player extends GObject.Object {
static $gtype: GObject.GType<Player>;
// Properties
/**
* Full dbus namae of this player.
*/
get bus_name(): string;
set bus_name(val: string);
/**
* Full dbus namae of this player.
*/
get busName(): string;
set busName(val: string);
/**
* Indicates if [property`AstalMpris`.Player:bus_name] is available on dbus.
*/
get available(): boolean;
set available(val: boolean);
/**
* Indicates if [method`AstalMpris`.Player.quit] has any effect.
*/
get can_quit(): boolean;
set can_quit(val: boolean);
/**
* Indicates if [method`AstalMpris`.Player.quit] has any effect.
*/
get canQuit(): boolean;
set canQuit(val: boolean);
/**
* Indicates if the player is occupying the fullscreen. This is typically used for videos. Use [method`AstalMpris`.Player.toggle_fullscreen]
* to toggle fullscreen state.
*/
get fullscreen(): boolean;
set fullscreen(val: boolean);
/**
* Indicates if [method`AstalMpris`.Player.toggle_fullscreen] has any effect.
*/
get can_set_fullscreen(): boolean;
set can_set_fullscreen(val: boolean);
/**
* Indicates if [method`AstalMpris`.Player.toggle_fullscreen] has any effect.
*/
get canSetFullscreen(): boolean;
set canSetFullscreen(val: boolean);
/**
* Indicates if [method`AstalMpris`.Player.raise] has any effect.
*/
get can_raise(): boolean;
set can_raise(val: boolean);
/**
* Indicates if [method`AstalMpris`.Player.raise] has any effect.
*/
get canRaise(): boolean;
set canRaise(val: boolean);
/**
* A human friendly name to identify the player.
*/
get identity(): string;
set identity(val: string);
/**
* The base name of a .desktop file
*/
get entry(): string;
set entry(val: string);
/**
* The URI schemes supported by the media player.
* This can be viewed as protocols supported by the player in almost all cases. Almost every media player will include support for the "file
* " scheme. Other common schemes are "http" and "rtsp".
*/
get supported_uri_schemes(): string[];
set supported_uri_schemes(val: string[]);
/**
* The URI schemes supported by the media player.
* This can be viewed as protocols supported by the player in almost all cases. Almost every media player will include support for the "file
* " scheme. Other common schemes are "http" and "rtsp".
*/
get supportedUriSchemes(): string[];
set supportedUriSchemes(val: string[]);
/**
* The mime-types supported by the player.
*/
get supported_mime_types(): string[];
set supported_mime_types(val: string[]);
/**
* The mime-types supported by the player.
*/
get supportedMimeTypes(): string[];
set supportedMimeTypes(val: string[]);
/**
* The current loop/repeat status.
*/
get loop_status(): Loop;
set loop_status(val: Loop);
/**
* The current loop/repeat status.
*/
get loopStatus(): Loop;
set loopStatus(val: Loop);
/**
* The current playback rate.
*/
get rate(): number;
set rate(val: number);
/**
* The current shuffle status.
*/
get shuffle_status(): Shuffle;
set shuffle_status(val: Shuffle);
/**
* The current shuffle status.
*/
get shuffleStatus(): Shuffle;
set shuffleStatus(val: Shuffle);
/**
* The current volume level between 0 and 1.
*/
get volume(): number;
set volume(val: number);
/**
* The current position of the track in seconds. To get a progress percentage simply divide this with [property`AstalMpris`.Player:length].
*/
get position(): number;
set position(val: number);
/**
* The current playback status.
*/
get playback_status(): PlaybackStatus;
set playback_status(val: PlaybackStatus);
/**
* The current playback status.
*/
get playbackStatus(): PlaybackStatus;
set playbackStatus(val: PlaybackStatus);
/**
* The minimum value which the [property`AstalMpris`.Player:rate] can take.
*/
get minimum_rate(): number;
set minimum_rate(val: number);
/**
* The minimum value which the [property`AstalMpris`.Player:rate] can take.
*/
get minimumRate(): number;
set minimumRate(val: number);
/**
* The maximum value which the [property`AstalMpris`.Player:rate] can take.
*/
get maximum_rate(): number;
set maximum_rate(val: number);
/**
* The maximum value which the [property`AstalMpris`.Player:rate] can take.
*/
get maximumRate(): number;
set maximumRate(val: number);
/**
* Indicates if invoking [method`AstalMpris`.Player.next] has effect.
*/
get can_go_next(): boolean;
set can_go_next(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.next] has effect.
*/
get canGoNext(): boolean;
set canGoNext(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.previous] has effect.
*/
get can_go_previous(): boolean;
set can_go_previous(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.previous] has effect.
*/
get canGoPrevious(): boolean;
set canGoPrevious(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.play] has effect.
*/
get can_play(): boolean;
set can_play(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.play] has effect.
*/
get canPlay(): boolean;
set canPlay(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.pause] has effect.
*/
get can_pause(): boolean;
set can_pause(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.pause] has effect.
*/
get canPause(): boolean;
set canPause(val: boolean);
/**
* Indicates if setting [property`AstalMpris`.Player:position] has effect.
*/
get can_seek(): boolean;
set can_seek(val: boolean);
/**
* Indicates if setting [property`AstalMpris`.Player:position] has effect.
*/
get canSeek(): boolean;
set canSeek(val: boolean);
/**
* Indicates if the player can be controlled with methods such as [method`AstalMpris`.Player.play_pause].
*/
get can_control(): boolean;
set can_control(val: boolean);
/**
* Indicates if the player can be controlled with methods such as [method`AstalMpris`.Player.play_pause].
*/
get canControl(): boolean;
set canControl(val: boolean);
/**
* Metadata hashtable of this player. In languages that cannot introspect this use [method`AstalMpris`.Player.get_meta].
*/
get metadata(): GLib.HashTable<string, GLib.Variant>;
set metadata(val: GLib.HashTable<string, GLib.Variant>);
/**
* Currently playing track's id.
*/
get trackid(): string;
set trackid(val: string);
/**
* Length of the currently playing track in seconds.
*/
get length(): number;
set length(val: number);
/**
* The location of an image representing the track or album. You should always prefer to use [property`AstalMpris`.Player:cover_art].
*/
get art_url(): string;
set art_url(val: string);
/**
* The location of an image representing the track or album. You should always prefer to use [property`AstalMpris`.Player:cover_art].
*/
get artUrl(): string;
set artUrl(val: string);
/**
* Title of the currently playing album.
*/
get album(): string;
set album(val: string);
/**
* Artists of the currently playing album.
*/
get album_artist(): string;
set album_artist(val: string);
/**
* Artists of the currently playing album.
*/
get albumArtist(): string;
set albumArtist(val: string);
/**
* Artists of the currently playing track.
*/
get artist(): string;
set artist(val: string);
/**
* Lyrics of the currently playing track.
*/
get lyrics(): string;
set lyrics(val: string);
/**
* Title of the currently playing track.
*/
get title(): string;
set title(val: string);
/**
* Composers of the currently playing track.
*/
get composer(): string;
set composer(val: string);
/**
* Comments of the currently playing track.
*/
get comments(): string;
set comments(val: string);
/**
* Path of the cached [property`AstalMpris`.Player:art_url].
*/
get cover_art(): string;
set cover_art(val: string);
/**
* Path of the cached [property`AstalMpris`.Player:art_url].
*/
get coverArt(): string;
set coverArt(val: string);
// Constructors
constructor(properties?: Partial<Player.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](name: string): Player;
// Methods
/**
* Brings the player's user interface to the front using any appropriate mechanism available.
* The media player may be unable to control how its user interface is displayed, or it may not have a graphical user interface at all. In this
* case, the [property`AstalMpris`.Player:can_raise] is `false` and this method does nothing.
*/
raise(): void;
/**
* Causes the media player to stop running.
* The media player may refuse to allow clients to shut it down. In this case, the [property`AstalMpris`.Player:can_quit] property is false
* and this method does nothing.
*/
quit(): void;
/**
* Toggle [property`AstalMpris`.Player:fullscreen] state.
*/
toggle_fullscreen(): void;
/**
* Skips to the next track in the tracklist. If there is no next track (and endless playback and track repeat are both off), stop
* playback. If [property`AstalMpris`.Player:can_go_next] is `false` this method has no effect.
*/
next(): void;
/**
* Skips to the previous track in the tracklist. If there is no previous track (and endless playback and track repeat are both off),
* stop playback. If [property`AstalMpris`.Player:can_go_previous] is `false` this method has no effect.
*/
previous(): void;
/**
* Pauses playback. If playback is already paused, this has no effect. If [property`AstalMpris`.Player:can_pause] is `false` this method has
* no effect.
*/
pause(): void;
/**
* Pauses playback. If playback is already paused, resumes playback. If playback is stopped, starts playback.
*/
play_pause(): void;
/**
* Stops playback. If playback is already stopped, this has no effect. If [property`AstalMpris`.Player:can_control] is `false` this method
* has no effect.
*/
stop(): void;
/**
* Starts or resumes playback. If already playing, this has no effect. If paused, playback resumes from the current position. If [property@
* AstalMpris.Player:can_play] is `false` this method has no effect.
*/
play(): void;
/**
* uri scheme should be an element of [property`AstalMpris`.Player:supported_uri_schemes] and the mime-type should match one of the elements
* of [property`AstalMpris`.Player:supported_mime_types].
* @param uri Uri of the track to load.
*/
open_uri(uri: string): void;
/**
* Change [property`AstalMpris`.Player:loop_status] from none to track, from track to playlist, from playlist to none.
*/
loop(): void;
/**
* Toggle [property`AstalMpris`.Player:shuffle_status].
*/
shuffle(): void;
/**
* Lookup a key from [property`AstalMpris`.Player:metadata]. This method is useful for languages that fail to introspect hashtables.
* @param key
*/
get_meta(key: string): GLib.Variant | null;
get_bus_name(): string;
get_available(): boolean;
get_can_quit(): boolean;
get_fullscreen(): boolean;
get_can_set_fullscreen(): boolean;
get_can_raise(): boolean;
get_identity(): string;
get_entry(): string;
get_supported_uri_schemes(): string[];
get_supported_mime_types(): string[];
get_loop_status(): Loop;
set_loop_status(value: Loop | null): void;
get_rate(): number;
set_rate(value: number): void;
get_shuffle_status(): Shuffle;
set_shuffle_status(value: Shuffle | null): void;
get_volume(): number;
set_volume(value: number): void;
get_position(): number;
set_position(value: number): void;
get_playback_status(): PlaybackStatus;
get_minimum_rate(): number;
get_maximum_rate(): number;
get_can_go_next(): boolean;
get_can_go_previous(): boolean;
get_can_play(): boolean;
get_can_pause(): boolean;
get_can_seek(): boolean;
get_can_control(): boolean;
get_metadata(): GLib.HashTable<string, GLib.Variant>;
get_trackid(): string;
get_length(): number;
get_art_url(): string;
get_album(): string;
get_album_artist(): string;
get_artist(): string;
get_lyrics(): string;
get_title(): string;
get_composer(): string;
get_comments(): string;
get_cover_art(): string;
}
type MprisClass = typeof Mpris;
abstract class MprisPrivate {
static $gtype: GObject.GType<MprisPrivate>;
// Constructors
_init(...args: any[]): void;
}
type PlayerClass = typeof Player;
abstract class PlayerPrivate {
static $gtype: GObject.GType<PlayerPrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalMpris;
}
declare module 'gi://AstalMpris' {
import AstalMpris01 from 'gi://AstalMpris?version=0.1';
export default AstalMpris01;
}
// END

View File

@ -1,466 +0,0 @@
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./nm-1.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalNetwork?version=0.1' {
// Module dependencies
import type GLib from 'gi://GLib?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type NM from 'gi://NM?version=1.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AstalNetwork {
/**
* AstalNetwork-0.1
*/
export namespace Primary {
export const $gtype: GObject.GType<Primary>;
}
enum Primary {
UNKNOWN,
WIRED,
WIFI,
}
export namespace State {
export const $gtype: GObject.GType<State>;
}
enum State {
UNKNOWN,
ASLEEP,
DISCONNECTED,
DISCONNECTING,
CONNECTING,
CONNECTED_LOCAL,
CONNECTED_SITE,
CONNECTED_GLOBAL,
}
export namespace Connectivity {
export const $gtype: GObject.GType<Connectivity>;
}
enum Connectivity {
UNKNOWN,
NONE,
PORTAL,
LIMITED,
FULL,
}
export namespace DeviceState {
export const $gtype: GObject.GType<DeviceState>;
}
enum DeviceState {
UNKNOWN,
UNMANAGED,
UNAVAILABLE,
DISCONNECTED,
PREPARE,
CONFIG,
NEED_AUTH,
IP_CONFIG,
IP_CHECK,
SECONDARIES,
ACTIVATED,
DEACTIVATING,
FAILED,
}
export namespace Internet {
export const $gtype: GObject.GType<Internet>;
}
enum Internet {
CONNECTED,
CONNECTING,
DISCONNECTED,
}
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
function primary_to_string(): string;
function primary_from_connection_type(type: string): Primary;
function state_to_string(): string;
function connectivity_to_string(): string;
function device_state_to_string(): string;
function internet_from_device(device: NM.Device): Internet;
function internet_to_string(): string;
function get_default(): Network;
namespace Network {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
client: NM.Client;
wifi: Wifi;
wired: Wired;
primary: Primary;
connectivity: Connectivity;
state: State;
}
}
class Network extends GObject.Object {
static $gtype: GObject.GType<Network>;
// Properties
get client(): NM.Client;
set client(val: NM.Client);
get wifi(): Wifi;
set wifi(val: Wifi);
get wired(): Wired;
set wired(val: Wired);
get primary(): Primary;
set primary(val: Primary);
get connectivity(): Connectivity;
get state(): State;
// Constructors
constructor(properties?: Partial<Network.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Network;
// Static methods
static get_default(): Network;
// Methods
get_client(): NM.Client;
get_wifi(): Wifi | null;
get_wired(): Wired | null;
get_primary(): Primary;
get_connectivity(): Connectivity;
get_state(): State;
}
namespace Wifi {
// Signal callback interfaces
interface StateChanged {
(new_state: DeviceState, old_state: DeviceState, reaseon: NM.DeviceStateReason): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
device: NM.DeviceWifi;
active_connection: NM.ActiveConnection;
activeConnection: NM.ActiveConnection;
active_access_point: AccessPoint;
activeAccessPoint: AccessPoint;
access_points: AccessPoint[];
accessPoints: AccessPoint[];
enabled: boolean;
internet: Internet;
bandwidth: number;
ssid: string;
strength: number;
frequency: number;
state: DeviceState;
icon_name: string;
iconName: string;
is_hotspot: boolean;
isHotspot: boolean;
scanning: boolean;
}
}
class Wifi extends GObject.Object {
static $gtype: GObject.GType<Wifi>;
// Properties
get device(): NM.DeviceWifi;
set device(val: NM.DeviceWifi);
get active_connection(): NM.ActiveConnection;
set active_connection(val: NM.ActiveConnection);
get activeConnection(): NM.ActiveConnection;
set activeConnection(val: NM.ActiveConnection);
get active_access_point(): AccessPoint;
set active_access_point(val: AccessPoint);
get activeAccessPoint(): AccessPoint;
set activeAccessPoint(val: AccessPoint);
get access_points(): AccessPoint[];
get accessPoints(): AccessPoint[];
get enabled(): boolean;
set enabled(val: boolean);
get internet(): Internet;
set internet(val: Internet);
get bandwidth(): number;
set bandwidth(val: number);
get ssid(): string;
set ssid(val: string);
get strength(): number;
set strength(val: number);
get frequency(): number;
set frequency(val: number);
get state(): DeviceState;
set state(val: DeviceState);
get icon_name(): string;
set icon_name(val: string);
get iconName(): string;
set iconName(val: string);
get is_hotspot(): boolean;
set is_hotspot(val: boolean);
get isHotspot(): boolean;
set isHotspot(val: boolean);
get scanning(): boolean;
set scanning(val: boolean);
// Constructors
constructor(properties?: Partial<Wifi.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(
signal: 'state-changed',
callback: (
_source: this,
new_state: DeviceState,
old_state: DeviceState,
reaseon: NM.DeviceStateReason,
) => void,
): number;
connect_after(
signal: 'state-changed',
callback: (
_source: this,
new_state: DeviceState,
old_state: DeviceState,
reaseon: NM.DeviceStateReason,
) => void,
): number;
emit(
signal: 'state-changed',
new_state: DeviceState,
old_state: DeviceState,
reaseon: NM.DeviceStateReason,
): void;
// Methods
scan(): void;
get_device(): NM.DeviceWifi;
set_device(value: NM.DeviceWifi): void;
get_active_connection(): NM.ActiveConnection | null;
get_active_access_point(): AccessPoint | null;
get_access_points(): AccessPoint[];
get_enabled(): boolean;
set_enabled(value: boolean): void;
get_internet(): Internet;
get_bandwidth(): number;
get_ssid(): string;
get_strength(): number;
get_frequency(): number;
get_state(): DeviceState;
get_icon_name(): string;
get_is_hotspot(): boolean;
get_scanning(): boolean;
}
namespace Wired {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
device: NM.DeviceEthernet;
speed: number;
internet: Internet;
state: DeviceState;
icon_name: string;
iconName: string;
}
}
class Wired extends GObject.Object {
static $gtype: GObject.GType<Wired>;
// Properties
get device(): NM.DeviceEthernet;
set device(val: NM.DeviceEthernet);
get speed(): number;
set speed(val: number);
get internet(): Internet;
set internet(val: Internet);
get state(): DeviceState;
set state(val: DeviceState);
get icon_name(): string;
set icon_name(val: string);
get iconName(): string;
set iconName(val: string);
// Fields
connection: NM.ActiveConnection;
// Constructors
constructor(properties?: Partial<Wired.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
get_device(): NM.DeviceEthernet;
set_device(value: NM.DeviceEthernet): void;
get_speed(): number;
get_internet(): Internet;
get_state(): DeviceState;
get_icon_name(): string;
}
namespace AccessPoint {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
bandwidth: number;
bssid: string;
frequency: number;
last_seen: number;
lastSeen: number;
max_bitrate: number;
maxBitrate: number;
strength: number;
icon_name: string;
iconName: string;
mode: NM.__80211Mode;
flags: NM.__80211ApFlags;
rsn_flags: NM.__80211ApSecurityFlags;
rsnFlags: NM.__80211ApSecurityFlags;
wpa_flags: NM.__80211ApSecurityFlags;
wpaFlags: NM.__80211ApSecurityFlags;
ssid: string;
}
}
class AccessPoint extends GObject.Object {
static $gtype: GObject.GType<AccessPoint>;
// Properties
get bandwidth(): number;
get bssid(): string;
get frequency(): number;
get last_seen(): number;
get lastSeen(): number;
get max_bitrate(): number;
get maxBitrate(): number;
get strength(): number;
get icon_name(): string;
set icon_name(val: string);
get iconName(): string;
set iconName(val: string);
get mode(): NM.__80211Mode;
get flags(): NM.__80211ApFlags;
get rsn_flags(): NM.__80211ApSecurityFlags;
get rsnFlags(): NM.__80211ApSecurityFlags;
get wpa_flags(): NM.__80211ApSecurityFlags;
get wpaFlags(): NM.__80211ApSecurityFlags;
get ssid(): string;
// Constructors
constructor(properties?: Partial<AccessPoint.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
get_bandwidth(): number;
get_bssid(): string;
get_frequency(): number;
get_last_seen(): number;
get_max_bitrate(): number;
get_strength(): number;
get_icon_name(): string;
get_mode(): NM.__80211Mode;
get_flags(): NM.__80211ApFlags;
get_rsn_flags(): NM.__80211ApSecurityFlags;
get_wpa_flags(): NM.__80211ApSecurityFlags;
get_ssid(): string | null;
}
type NetworkClass = typeof Network;
abstract class NetworkPrivate {
static $gtype: GObject.GType<NetworkPrivate>;
// Constructors
_init(...args: any[]): void;
}
type WifiClass = typeof Wifi;
abstract class WifiPrivate {
static $gtype: GObject.GType<WifiPrivate>;
// Constructors
_init(...args: any[]): void;
}
type WiredClass = typeof Wired;
abstract class WiredPrivate {
static $gtype: GObject.GType<WiredPrivate>;
// Constructors
_init(...args: any[]): void;
}
type AccessPointClass = typeof AccessPoint;
abstract class AccessPointPrivate {
static $gtype: GObject.GType<AccessPointPrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalNetwork;
}
declare module 'gi://AstalNetwork' {
import AstalNetwork01 from 'gi://AstalNetwork?version=0.1';
export default AstalNetwork01;
}
// END

View File

@ -1,443 +0,0 @@
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalNotifd?version=0.1' {
// Module dependencies
import type GLib from 'gi://GLib?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
export namespace AstalNotifd {
/**
* AstalNotifd-0.1
*/
export namespace ClosedReason {
export const $gtype: GObject.GType<ClosedReason>;
}
enum ClosedReason {
EXPIRED,
DISMISSED_BY_USER,
CLOSED,
UNDEFINED,
}
export namespace Urgency {
export const $gtype: GObject.GType<Urgency>;
}
enum Urgency {
LOW,
NORMAL,
CRITICAL,
}
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
function get_default(): Notifd;
namespace Notifd {
// Signal callback interfaces
interface Notified {
(id: number, replaced: boolean): void;
}
interface Resolved {
(id: number, reason: ClosedReason): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
ignore_timeout: boolean;
ignoreTimeout: boolean;
dont_disturb: boolean;
dontDisturb: boolean;
notifications: Notification[];
}
}
/**
* The Notification daemon.
* This class queues up to become the next daemon, while acting as a proxy in the meantime.
*/
class Notifd extends GObject.Object {
static $gtype: GObject.GType<Notifd>;
// Properties
/**
* Ignore the timeout specified by incoming notifications.
* By default notifications can specify a timeout in milliseconds after which the daemon will resolve them even without user input.
*/
get ignore_timeout(): boolean;
set ignore_timeout(val: boolean);
/**
* Ignore the timeout specified by incoming notifications.
* By default notifications can specify a timeout in milliseconds after which the daemon will resolve them even without user input.
*/
get ignoreTimeout(): boolean;
set ignoreTimeout(val: boolean);
/**
* Indicate to frontends to not show popups to the user.
* This property does not have any effect on its own, its merely a value to use between the daemon process and proxies for frontends to use.
*/
get dont_disturb(): boolean;
set dont_disturb(val: boolean);
/**
* Indicate to frontends to not show popups to the user.
* This property does not have any effect on its own, its merely a value to use between the daemon process and proxies for frontends to use.
*/
get dontDisturb(): boolean;
set dontDisturb(val: boolean);
/**
* List of currently unresolved notifications.
*/
get notifications(): Notification[];
// Constructors
constructor(properties?: Partial<Notifd.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Notifd;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'notified', callback: (_source: this, id: number, replaced: boolean) => void): number;
connect_after(signal: 'notified', callback: (_source: this, id: number, replaced: boolean) => void): number;
emit(signal: 'notified', id: number, replaced: boolean): void;
connect(signal: 'resolved', callback: (_source: this, id: number, reason: ClosedReason) => void): number;
connect_after(
signal: 'resolved',
callback: (_source: this, id: number, reason: ClosedReason) => void,
): number;
emit(signal: 'resolved', id: number, reason: ClosedReason): void;
// Static methods
/**
* Get the singleton instance
*/
static get_default(): Notifd;
// Methods
/**
* Gets the [class`AstalNotifd`.Notification] with id or null if there is no such Notification.
* @param id
*/
get_notification(id: number): Notification;
get_ignore_timeout(): boolean;
set_ignore_timeout(value: boolean): void;
get_dont_disturb(): boolean;
set_dont_disturb(value: boolean): void;
get_notifications(): Notification[];
}
namespace Notification {
// Signal callback interfaces
interface Resolved {
(reason: ClosedReason): void;
}
interface Invoked {
(action_id: string): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
time: number;
app_name: string;
appName: string;
app_icon: string;
appIcon: string;
summary: string;
body: string;
id: number;
expire_timeout: number;
expireTimeout: number;
actions: Action[];
image: string;
action_icons: boolean;
actionIcons: boolean;
category: string;
desktop_entry: string;
desktopEntry: string;
resident: boolean;
sound_file: string;
soundFile: string;
sound_name: string;
soundName: string;
suppress_sound: boolean;
suppressSound: boolean;
transient: boolean;
x: number;
y: number;
urgency: Urgency;
}
}
/**
* Class representing a notification.
*/
class Notification extends GObject.Object {
static $gtype: GObject.GType<Notification>;
// Properties
/**
* Unix time of when the notification was sent.
*/
get time(): number;
set time(val: number);
/**
* Name of the sending application.
*/
get app_name(): string;
set app_name(val: string);
/**
* Name of the sending application.
*/
get appName(): string;
set appName(val: string);
/**
* Icon name of the sending application.
*/
get app_icon(): string;
set app_icon(val: string);
/**
* Icon name of the sending application.
*/
get appIcon(): string;
set appIcon(val: string);
/**
* Single line overview of the notification.
*/
get summary(): string;
set summary(val: string);
/**
* Multi-line body of text, where each line is a paragraph. May contain markup.
*/
get body(): string;
set body(val: string);
/**
* Id of the notification.
*/
get id(): number;
set id(val: number);
/**
* Time in milliseconds after the notification expires.
*/
get expire_timeout(): number;
set expire_timeout(val: number);
/**
* Time in milliseconds after the notification expires.
*/
get expireTimeout(): number;
set expireTimeout(val: number);
/**
* List of [struct`AstalNotifd`.Action] of the notification.
* Can be invoked by calling [method`AstalNotifd`.Notification.invoke] with the action's id.
*/
get actions(): Action[];
/**
* Path of an image
*/
get image(): string;
/**
* Indicates whether [struct`AstalNotifd`.Action] identifier should be interpreted as a named icon.
*/
get action_icons(): boolean;
/**
* Indicates whether [struct`AstalNotifd`.Action] identifier should be interpreted as a named icon.
*/
get actionIcons(): boolean;
/**
* [](https://specifications.freedesktop.org/notification-spec/latest/categories.html)
*/
get category(): string;
/**
* Specifies the name of the desktop filename representing the calling program.
*/
get desktop_entry(): string;
/**
* Specifies the name of the desktop filename representing the calling program.
*/
get desktopEntry(): string;
/**
* Indicates whether notification is kept after action invocation.
*/
get resident(): boolean;
/**
* The path to a sound file to play when the notification pops up.
*/
get sound_file(): string;
/**
* The path to a sound file to play when the notification pops up.
*/
get soundFile(): string;
/**
* A themeable named sound from to play when the notification pops up
*/
get sound_name(): string;
/**
* A themeable named sound from to play when the notification pops up
*/
get soundName(): string;
/**
* Indicates to suppress playing any sounds.
*/
get suppress_sound(): boolean;
/**
* Indicates to suppress playing any sounds.
*/
get suppressSound(): boolean;
/**
* Indicates that the notification should be excluded from persistency.
*/
get transient(): boolean;
/**
* Specifies the X location on the screen that the notification should point to. The "y" hint must also be specified.
*/
get x(): number;
/**
* Specifies the Y location on the screen that the notification should point to. The "x" hint must also be specified.
*/
get y(): number;
/**
* [enum`AstalNotifd`.Urgency] level of the notification.
*/
get urgency(): Urgency;
// Constructors
constructor(properties?: Partial<Notification.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'resolved', callback: (_source: this, reason: ClosedReason) => void): number;
connect_after(signal: 'resolved', callback: (_source: this, reason: ClosedReason) => void): number;
emit(signal: 'resolved', reason: ClosedReason): void;
connect(signal: 'invoked', callback: (_source: this, action_id: string) => void): number;
connect_after(signal: 'invoked', callback: (_source: this, action_id: string) => void): number;
emit(signal: 'invoked', action_id: string): void;
// Methods
get_hint(hint: string): GLib.Variant | null;
get_str_hint(hint: string): string;
get_bool_hint(hint: string): boolean;
get_int_hint(hint: string): number;
get_byte_hint(hint: string): number;
/**
* Resolve this notification with [enum`AstalNotifd`.ClosedReason.DISMISSED_BY_USER].
*/
dismiss(): void;
/**
* Invoke an [struct`AstalNotifd`.Action] of this notification.
* Note that this method just notifies the client that this action was invoked by the user. If for example this notification persists through the
* lifetime of the sending program this action will have no effect.
* @param action_id
*/
invoke(action_id: string): void;
get_time(): number;
get_app_name(): string;
get_app_icon(): string;
get_summary(): string;
get_body(): string;
get_id(): number;
get_expire_timeout(): number;
get_actions(): Action[];
get_image(): string;
get_action_icons(): boolean;
get_category(): string;
get_desktop_entry(): string;
get_resident(): boolean;
get_sound_file(): string;
get_sound_name(): string;
get_suppress_sound(): boolean;
get_transient(): boolean;
get_x(): number;
get_y(): number;
get_urgency(): Urgency;
}
type NotifdClass = typeof Notifd;
abstract class NotifdPrivate {
static $gtype: GObject.GType<NotifdPrivate>;
// Constructors
_init(...args: any[]): void;
}
type NotificationClass = typeof Notification;
abstract class NotificationPrivate {
static $gtype: GObject.GType<NotificationPrivate>;
// Constructors
_init(...args: any[]): void;
}
class Action {
static $gtype: GObject.GType<Action>;
// Fields
id: string;
label: string;
// Constructors
constructor(
properties?: Partial<{
id: string;
label: string;
}>,
);
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalNotifd;
}
declare module 'gi://AstalNotifd' {
import AstalNotifd01 from 'gi://AstalNotifd?version=0.1';
export default AstalNotifd01;
}
// END

View File

@ -1,224 +0,0 @@
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalPowerProfiles?version=0.1' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
export namespace AstalPowerProfiles {
/**
* AstalPowerProfiles-0.1
*/
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
function get_default(): PowerProfiles;
namespace PowerProfiles {
// Signal callback interfaces
interface ProfileReleased {
(cookie: number): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
active_profile: string;
activeProfile: string;
icon_name: string;
iconName: string;
actions: string[];
performance_degraded: string;
performanceDegraded: string;
version: string;
}
}
/**
* Client for <ulink url="https://freedesktop-team.pages.debian.net/power-profiles-daemon/gdbus-org.freedesktop.UPower.PowerProfiles.html">
* PowerProfiles</ulink>.
*/
class PowerProfiles extends GObject.Object {
static $gtype: GObject.GType<PowerProfiles>;
// Properties
/**
* The type of the currently active profile. It might change automatically if a profile is held, using the [method@
* AstalPowerProfiles.PowerProfiles.hold_profile] method.
*/
get active_profile(): string;
set active_profile(val: string);
/**
* The type of the currently active profile. It might change automatically if a profile is held, using the [method@
* AstalPowerProfiles.PowerProfiles.hold_profile] method.
*/
get activeProfile(): string;
set activeProfile(val: string);
/**
* Return a named icon based [property`AstalPowerProfiles`.PowerProfiles:active_profile].
*/
get icon_name(): string;
/**
* Return a named icon based [property`AstalPowerProfiles`.PowerProfiles:active_profile].
*/
get iconName(): string;
/**
* List of the "actions" implemented in the running daemon. This can used to figure out whether particular functionality is available in
* the daemon.
*/
get actions(): string[];
/**
* This will be set if the performance power profile is running in degraded mode, with the value being used to identify the reason for that
* degradation. Possible values are: - "lap-detected" (the computer is sitting on the user's lap) - "high-operating-
* temperature" (the computer is close to overheating) - "" (the empty string, if not performance is not degraded)
*/
get performance_degraded(): string;
/**
* This will be set if the performance power profile is running in degraded mode, with the value being used to identify the reason for that
* degradation. Possible values are: - "lap-detected" (the computer is sitting on the user's lap) - "high-operating-
* temperature" (the computer is close to overheating) - "" (the empty string, if not performance is not degraded)
*/
get performanceDegraded(): string;
/**
* The version of the power-profiles-daemon software.
*/
get version(): string;
// Constructors
constructor(properties?: Partial<PowerProfiles.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): PowerProfiles;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'profile-released', callback: (_source: this, cookie: number) => void): number;
connect_after(signal: 'profile-released', callback: (_source: this, cookie: number) => void): number;
emit(signal: 'profile-released', cookie: number): void;
// Static methods
/**
* Gets the default singleton PowerProfiles instance.
*/
static get_default(): PowerProfiles;
// Methods
/**
* This forces the passed profile (either 'power-saver' or 'performance') to be activated until either the caller
* quits, [method`AstalPowerProfiles`.PowerProfiles.release_profile] is called, or the [property@
* AstalPowerProfiles.PowerProfiles:active_profile] is changed by the user. When conflicting profiles are requested to be held, the 'power-saver
* ' profile will be activated in preference to the 'performance' profile. Those holds will be automatically cancelled if the user
* manually switches to another profile, and the [signal`AstalPowerProfiles`.PowerProfiles::profile_released] signal will be emitted.
* @param profile
* @param reason
* @param application_id
*/
hold_profile(profile: string, reason: string, application_id: string): number;
/**
* This removes the hold that was set on a profile.
* @param cookie
*/
release_profile(cookie: number): void;
get_active_profile(): string;
set_active_profile(value: string): void;
get_icon_name(): string;
get_actions(): string[];
get_active_profile_holds(): Hold[];
get_performance_degraded(): string;
get_profiles(): Profile[];
get_version(): string;
}
type PowerProfilesClass = typeof PowerProfiles;
abstract class PowerProfilesPrivate {
static $gtype: GObject.GType<PowerProfilesPrivate>;
// Constructors
_init(...args: any[]): void;
}
class Profile {
static $gtype: GObject.GType<Profile>;
// Fields
profile: string;
cpu_driver: string;
platform_driver: string;
driver: string;
// Constructors
constructor(
properties?: Partial<{
profile: string;
cpu_driver: string;
platform_driver: string;
driver: string;
}>,
);
_init(...args: any[]): void;
}
class Hold {
static $gtype: GObject.GType<Hold>;
// Fields
application_id: string;
profile: string;
reason: string;
// Constructors
constructor(
properties?: Partial<{
application_id: string;
profile: string;
reason: string;
}>,
);
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalPowerProfiles;
}
declare module 'gi://AstalPowerProfiles' {
import AstalPowerProfiles01 from 'gi://AstalPowerProfiles?version=0.1';
export default AstalPowerProfiles01;
}
// END

View File

@ -1,941 +0,0 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalRiver?version=0.1' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AstalRiver {
/**
* AstalRiver-0.1
*/
export namespace Transform {
export const $gtype: GObject.GType<Transform>;
}
enum Transform {
NORMAL,
ROTATE_90,
ROTATE_180,
ROTATE_270,
FLIPPED,
FLIPPED_ROTATE_90,
FLIPPED_ROTATE_180,
FLIPPED_ROTATE_270,
}
const MAJOR_VERSION: number;
const MICRO_VERSION: number;
const MINOR_VERSION: number;
const VERSION: string;
function get_default(): River | null;
interface CommandCallback {
(success: boolean, msg: string): void;
}
namespace Output {
// Signal callback interfaces
interface Changed {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
description: string;
focused_tags: number;
focusedTags: number;
focused_view: string;
focusedView: string;
height: number;
id: number;
layout_name: string;
layoutName: string;
make: string;
model: string;
name: string;
occupied_tags: number;
occupiedTags: number;
physical_height: number;
physicalHeight: number;
physical_width: number;
physicalWidth: number;
refresh_rate: number;
refreshRate: number;
scale_factor: number;
scaleFactor: number;
transform: Transform;
urgent_tags: number;
urgentTags: number;
width: number;
x: number;
y: number;
}
}
/**
* holds all the information associated with a monitor.
*/
class Output extends GObject.Object {
static $gtype: GObject.GType<Output>;
// Properties
get description(): string;
/**
* The currently focused tags
*/
get focused_tags(): number;
set focused_tags(val: number);
/**
* The currently focused tags
*/
get focusedTags(): number;
set focusedTags(val: number);
/**
* The name of currently focused view
*/
get focused_view(): string;
/**
* The name of currently focused view
*/
get focusedView(): string;
get height(): number;
/**
* The id of the underlying wl_output object
*/
get id(): number;
/**
* The name of active layout
*/
get layout_name(): string;
/**
* The name of active layout
*/
get layoutName(): string;
get make(): string;
get model(): string;
/**
* The name of this output
*/
get name(): string;
/**
* The currently occupied tags
*/
get occupied_tags(): number;
/**
* The currently occupied tags
*/
get occupiedTags(): number;
get physical_height(): number;
get physicalHeight(): number;
get physical_width(): number;
get physicalWidth(): number;
get refresh_rate(): number;
get refreshRate(): number;
get scale_factor(): number;
get scaleFactor(): number;
get transform(): Transform;
/**
* The currently tags marked as urgent
*/
get urgent_tags(): number;
/**
* The currently tags marked as urgent
*/
get urgentTags(): number;
get width(): number;
get x(): number;
get y(): number;
// Constructors
constructor(properties?: Partial<Output.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
// Methods
/**
* the description of the output
*/
get_description(): string;
/**
* the focused tags of the output
* @returns the focused tags of the output
*/
get_focused_tags(): number;
/**
* the focused view on the output
* @returns the focused view on the output
*/
get_focused_view(): string | null;
/**
* the height of the output
*/
get_height(): number;
/**
* the id of the underlying wl_output object
* @returns the id of the underlying wl_output object
*/
get_id(): number;
/**
* the currently used layout name of the output
* @returns the currently used layout name of the output
*/
get_layout_name(): string | null;
/**
* the make of the output
*/
get_make(): string;
/**
* the model of the output
*/
get_model(): string;
/**
* the name of the output
* @returns the name of the output
*/
get_name(): string | null;
/**
* the occupied tags of the output
* @returns the occupied tags of the output
*/
get_occupied_tags(): number;
/**
* the physical height of the output
*/
get_physical_height(): number;
/**
* the physical width of the output
*/
get_physical_width(): number;
/**
* the refresh rate of the output
*/
get_refresh_rate(): number;
/**
* the scale factor of the output
*/
get_scale_factor(): number;
/**
* the urgent tags of the output
* @returns the urgent tags of the output
*/
get_urgent_tags(): number;
/**
* the width of the output
*/
get_width(): number;
/**
* the x coordinate of the outputs position
*/
get_x(): number;
/**
* the y coordinate of the outputs position
*/
get_y(): number;
/**
* sets the focused tags of the output
* @param tags the tagmask to be focused
*/
set_focused_tags(tags: number): void;
}
namespace River {
// Signal callback interfaces
interface Changed {
(): void;
}
interface OutputAdded {
(output: string): void;
}
interface OutputRemoved {
(output: string): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Gio.Initable.ConstructorProps {
focused_output: string;
focusedOutput: string;
focused_view: string;
focusedView: string;
mode: string;
outputs: Output[];
}
}
/**
* This class creates a connection to the river compositor.
*/
class River extends GObject.Object implements Gio.Initable {
static $gtype: GObject.GType<River>;
// Properties
/**
* The name of the currently focused output
*/
get focused_output(): string;
/**
* The name of the currently focused output
*/
get focusedOutput(): string;
/**
* The name of the currently focused view
*/
get focused_view(): string;
/**
* The name of the currently focused view
*/
get focusedView(): string;
/**
* The currently active mode
*/
get mode(): string;
/**
* A list of [class`AstalRiver`.Output] objects
*/
get outputs(): Output[];
// Constructors
constructor(properties?: Partial<River.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): River;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
connect(signal: 'output-added', callback: (_source: this, output: string) => void): number;
connect_after(signal: 'output-added', callback: (_source: this, output: string) => void): number;
emit(signal: 'output-added', output: string): void;
connect(signal: 'output-removed', callback: (_source: this, output: string) => void): number;
connect_after(signal: 'output-removed', callback: (_source: this, output: string) => void): number;
emit(signal: 'output-removed', output: string): void;
// Static methods
/**
* returns the default River object.
*/
static get_default(): River | null;
// Methods
/**
* returns the name of the currently focused output
* @returns the name of the currently focused output
*/
get_focused_output(): string | null;
/**
* returns the currently focused view
* @returns the currently focused view
*/
get_focused_view(): string | null;
/**
* returns the currently active mode
* @returns the currently active mode
*/
get_mode(): string | null;
/**
* returns the output with the given name or null
* @param name the name of the output
* @returns the output with the given name or null
*/
get_output(name: string): Output | null;
/**
* returns a list of all outputs
* @returns a list of all outputs
*/
get_outputs(): Output[];
/**
* Sends a given command to the compositor and calls the callback after it was executed.
* @param cmd the command to execute
* @param callback the callback to invoke.
*/
run_command_async(cmd: string[], callback?: CommandCallback | null): void;
// Inherited methods
/**
* Initializes the object implementing the interface.
*
* This method is intended for language bindings. If writing in C,
* g_initable_new() should typically be used instead.
*
* The object must be initialized before any real use after initial
* construction, either with this function or g_async_initable_init_async().
*
* Implementations may also support cancellation. If `cancellable` is not %NULL,
* then initialization can be cancelled by triggering the cancellable object
* from another thread. If the operation was cancelled, the error
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL and
* the object doesn't support cancellable initialization the error
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
*
* If the object is not initialized, or initialization returns with an
* error, then all operations on the object except g_object_ref() and
* g_object_unref() are considered to be invalid, and have undefined
* behaviour. See the [description][iface`Gio`.Initable#description] for more details.
*
* Callers should not assume that a class which implements #GInitable can be
* initialized multiple times, unless the class explicitly documents itself as
* supporting this. Generally, a class implementation of init() can assume
* (and assert) that it will only be called once. Previously, this documentation
* recommended all #GInitable implementations should be idempotent; that
* recommendation was relaxed in GLib 2.54.
*
* If a class explicitly supports being initialized multiple times, it is
* recommended that the method is idempotent: multiple calls with the same
* arguments should return the same results. Only the first call initializes
* the object; further calls return the result of the first call.
*
* One reason why a class might need to support idempotent initialization is if
* it is designed to be used via the singleton pattern, with a
* #GObjectClass.constructor that sometimes returns an existing instance.
* In this pattern, a caller would expect to be able to call g_initable_init()
* on the result of g_object_new(), regardless of whether it is in fact a new
* instance.
* @param cancellable optional #GCancellable object, %NULL to ignore.
* @returns %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
*/
init(cancellable?: Gio.Cancellable | null): boolean;
/**
* Initializes the object implementing the interface.
*
* This method is intended for language bindings. If writing in C,
* g_initable_new() should typically be used instead.
*
* The object must be initialized before any real use after initial
* construction, either with this function or g_async_initable_init_async().
*
* Implementations may also support cancellation. If `cancellable` is not %NULL,
* then initialization can be cancelled by triggering the cancellable object
* from another thread. If the operation was cancelled, the error
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL and
* the object doesn't support cancellable initialization the error
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
*
* If the object is not initialized, or initialization returns with an
* error, then all operations on the object except g_object_ref() and
* g_object_unref() are considered to be invalid, and have undefined
* behaviour. See the [description][iface`Gio`.Initable#description] for more details.
*
* Callers should not assume that a class which implements #GInitable can be
* initialized multiple times, unless the class explicitly documents itself as
* supporting this. Generally, a class implementation of init() can assume
* (and assert) that it will only be called once. Previously, this documentation
* recommended all #GInitable implementations should be idempotent; that
* recommendation was relaxed in GLib 2.54.
*
* If a class explicitly supports being initialized multiple times, it is
* recommended that the method is idempotent: multiple calls with the same
* arguments should return the same results. Only the first call initializes
* the object; further calls return the result of the first call.
*
* One reason why a class might need to support idempotent initialization is if
* it is designed to be used via the singleton pattern, with a
* #GObjectClass.constructor that sometimes returns an existing instance.
* In this pattern, a caller would expect to be able to call g_initable_init()
* on the result of g_object_new(), regardless of whether it is in fact a new
* instance.
* @param cancellable optional #GCancellable object, %NULL to ignore.
*/
vfunc_init(cancellable?: Gio.Cancellable | null): boolean;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
type OutputClass = typeof Output;
type RiverClass = typeof River;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalRiver;
}
declare module 'gi://AstalRiver' {
import AstalRiver01 from 'gi://AstalRiver?version=0.1';
export default AstalRiver01;
}
// END

View File

@ -1,419 +0,0 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./gdkpixbuf-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalTray?version=0.1' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
export namespace AstalTray {
/**
* AstalTray-0.1
*/
export namespace Category {
export const $gtype: GObject.GType<Category>;
}
enum Category {
APPLICATION,
COMMUNICATIONS,
SYSTEM,
HARDWARE,
}
export namespace Status {
export const $gtype: GObject.GType<Status>;
}
enum Status {
PASSIVE,
ACTIVE,
NEEDS_ATTENTION,
}
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
function category_to_nick(): string;
function status_to_nick(): string;
/**
* Get the singleton instance of [class`AstalTray`.Tray]
*/
function get_default(): Tray;
namespace Tray {
// Signal callback interfaces
interface ItemAdded {
(item_id: string): void;
}
interface ItemRemoved {
(item_id: string): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
items: TrayItem[];
}
}
class Tray extends GObject.Object {
static $gtype: GObject.GType<Tray>;
// Properties
/**
* List of currently registered tray items
*/
get items(): TrayItem[];
// Constructors
constructor(properties?: Partial<Tray.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Tray;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'item-added', callback: (_source: this, item_id: string) => void): number;
connect_after(signal: 'item-added', callback: (_source: this, item_id: string) => void): number;
emit(signal: 'item-added', item_id: string): void;
connect(signal: 'item-removed', callback: (_source: this, item_id: string) => void): number;
connect_after(signal: 'item-removed', callback: (_source: this, item_id: string) => void): number;
emit(signal: 'item-removed', item_id: string): void;
// Static methods
/**
* Get the singleton instance of [class`AstalTray`.Tray]
*/
static get_default(): Tray;
// Methods
/**
* gets the TrayItem with the given item-id.
* @param item_id
*/
get_item(item_id: string): TrayItem;
get_items(): TrayItem[];
}
namespace TrayItem {
// Signal callback interfaces
interface Changed {
(): void;
}
interface Ready {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
title: string;
category: Category;
status: Status;
tooltip: Tooltip;
tooltip_markup: string;
tooltipMarkup: string;
id: string;
is_menu: boolean;
isMenu: boolean;
icon_theme_path: string;
iconThemePath: string;
icon_name: string;
iconName: string;
icon_pixbuf: GdkPixbuf.Pixbuf;
iconPixbuf: GdkPixbuf.Pixbuf;
gicon: Gio.Icon;
item_id: string;
itemId: string;
menu_model: Gio.MenuModel;
menuModel: Gio.MenuModel;
action_group: Gio.ActionGroup;
actionGroup: Gio.ActionGroup;
}
}
class TrayItem extends GObject.Object {
static $gtype: GObject.GType<TrayItem>;
// Properties
/**
* The Title of the TrayItem
*/
get title(): string;
/**
* The category this item belongs to
*/
get category(): Category;
/**
* The current status of this item
*/
get status(): Status;
/**
* The tooltip of this item
*/
get tooltip(): Tooltip;
/**
* A markup representation of the tooltip. This is basically equvivalent to `tooltip.title \n tooltip.description`
*/
get tooltip_markup(): string;
/**
* A markup representation of the tooltip. This is basically equvivalent to `tooltip.title \n tooltip.description`
*/
get tooltipMarkup(): string;
/**
* the id of the item. This id is specified by the tray app.
*/
get id(): string;
/**
* If set, this only supports the menu, so showing the menu should be prefered over calling [method`AstalTray`.TrayItem.activate].
*/
get is_menu(): boolean;
/**
* If set, this only supports the menu, so showing the menu should be prefered over calling [method`AstalTray`.TrayItem.activate].
*/
get isMenu(): boolean;
/**
* The icon theme path, where to look for the [property`AstalTray`.TrayItem:icon-name]. It is recommended to use the [property@
* AstalTray.TrayItem:gicon] property, which does the icon lookups for you.
*/
get icon_theme_path(): string;
/**
* The icon theme path, where to look for the [property`AstalTray`.TrayItem:icon-name]. It is recommended to use the [property@
* AstalTray.TrayItem:gicon] property, which does the icon lookups for you.
*/
get iconThemePath(): string;
/**
* The name of the icon. This should be looked up in the [property`AstalTray`.TrayItem:icon-theme-path] if set or in the currently used icon
* theme otherwise. It is recommended to use the [property`AstalTray`.TrayItem:gicon] property, which does the icon lookups for you.
*/
get icon_name(): string;
/**
* The name of the icon. This should be looked up in the [property`AstalTray`.TrayItem:icon-theme-path] if set or in the currently used icon
* theme otherwise. It is recommended to use the [property`AstalTray`.TrayItem:gicon] property, which does the icon lookups for you.
*/
get iconName(): string;
/**
* A pixbuf containing the icon. It is recommended to use the [property`AstalTray`.TrayItem:gicon] property, which does the icon lookups for
* you.
*/
get icon_pixbuf(): GdkPixbuf.Pixbuf;
/**
* A pixbuf containing the icon. It is recommended to use the [property`AstalTray`.TrayItem:gicon] property, which does the icon lookups for
* you.
*/
get iconPixbuf(): GdkPixbuf.Pixbuf;
/**
* Contains the items icon. This property is intended to be used with the gicon property of the Icon widget and the recommended way to display the
* icon. This property unifies the [property`AstalTray`.TrayItem:icon-name], [property`AstalTray`.TrayItem:icon-theme-path] and [property
* `AstalTray`.TrayItem:icon-pixbuf] properties.
*/
get gicon(): Gio.Icon;
set gicon(val: Gio.Icon);
/**
* The id of the item used to uniquely identify the TrayItems by this lib.
*/
get item_id(): string;
set item_id(val: string);
/**
* The id of the item used to uniquely identify the TrayItems by this lib.
*/
get itemId(): string;
set itemId(val: string);
/**
* The MenuModel describing the menu for this TrayItem to be used with a MenuButton or PopoverMenu. The actions for this menu are defined in
* [property`AstalTray`.TrayItem:action-group].
*/
get menu_model(): Gio.MenuModel;
/**
* The MenuModel describing the menu for this TrayItem to be used with a MenuButton or PopoverMenu. The actions for this menu are defined in
* [property`AstalTray`.TrayItem:action-group].
*/
get menuModel(): Gio.MenuModel;
/**
* The ActionGroup containing the actions for the menu. All actions have the `dbusmenu` prefix and are setup to work with the [property@
* AstalTray.TrayItem:menu-model]. Make sure to insert this action group into a parent widget of the menu, eg the MenuButton for which the MenuModel for
* this TrayItem is set.
*/
get action_group(): Gio.ActionGroup;
/**
* The ActionGroup containing the actions for the menu. All actions have the `dbusmenu` prefix and are setup to work with the [property@
* AstalTray.TrayItem:menu-model]. Make sure to insert this action group into a parent widget of the menu, eg the MenuButton for which the MenuModel for
* this TrayItem is set.
*/
get actionGroup(): Gio.ActionGroup;
// Constructors
constructor(properties?: Partial<TrayItem.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
connect(signal: 'ready', callback: (_source: this) => void): number;
connect_after(signal: 'ready', callback: (_source: this) => void): number;
emit(signal: 'ready'): void;
// Methods
/**
* tells the tray app that its menu is about to be opened, so it can update the menu if needed. You should call this method before openening the
* menu.
*/
about_to_show(): void;
/**
* Send an activate request to the tray app.
* @param x
* @param y
*/
activate(x: number, y: number): void;
/**
* Send a secondary activate request to the tray app.
* @param x
* @param y
*/
secondary_activate(x: number, y: number): void;
/**
* Send a scroll request to the tray app. valid values for the orientation are "horizontal" and "vertical".
* @param delta
* @param orientation
*/
scroll(delta: number, orientation: string): void;
to_json_string(): string;
get_title(): string;
get_category(): Category;
get_status(): Status;
get_tooltip(): Tooltip | null;
get_tooltip_markup(): string;
get_id(): string;
get_is_menu(): boolean;
get_icon_theme_path(): string;
get_icon_name(): string;
get_icon_pixbuf(): GdkPixbuf.Pixbuf;
get_gicon(): Gio.Icon;
get_item_id(): string;
get_menu_model(): Gio.MenuModel | null;
get_action_group(): Gio.ActionGroup | null;
}
type TrayClass = typeof Tray;
abstract class TrayPrivate {
static $gtype: GObject.GType<TrayPrivate>;
// Constructors
_init(...args: any[]): void;
}
type TrayItemClass = typeof TrayItem;
abstract class TrayItemPrivate {
static $gtype: GObject.GType<TrayItemPrivate>;
// Constructors
_init(...args: any[]): void;
}
class Pixmap {
static $gtype: GObject.GType<Pixmap>;
// Fields
width: number;
height: number;
bytes: Uint8Array;
bytes_length1: number;
// Constructors
constructor(
properties?: Partial<{
width: number;
height: number;
bytes: Uint8Array;
bytes_length1: number;
}>,
);
_init(...args: any[]): void;
}
class Tooltip {
static $gtype: GObject.GType<Tooltip>;
// Fields
icon_name: string;
icon: Pixmap[];
icon_length1: number;
title: string;
description: string;
// Constructors
constructor(
properties?: Partial<{
icon_name: string;
icon: Pixmap[];
icon_length1: number;
title: string;
description: string;
}>,
);
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalTray;
}
declare module 'gi://AstalTray' {
import AstalTray01 from 'gi://AstalTray?version=0.1';
export default AstalTray01;
}
// END

View File

@ -1,937 +0,0 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalWp?version=0.1' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AstalWp {
/**
* AstalWp-0.1
*/
export namespace DeviceType {
export const $gtype: GObject.GType<DeviceType>;
}
enum DeviceType {
AUDIO,
VIDEO,
}
export namespace MediaClass {
export const $gtype: GObject.GType<MediaClass>;
}
enum MediaClass {
AUDIO_MICROPHONE,
AUDIO_SPEAKER,
AUDIO_RECORDER,
AUDIO_STREAM,
VIDEO_SOURCE,
VIDEO_SINK,
VIDEO_RECORDER,
VIDEO_STREAM,
}
export namespace Scale {
export const $gtype: GObject.GType<Scale>;
}
enum Scale {
LINEAR,
CUBIC,
}
const MAJOR_VERSION: number;
const MICRO_VERSION: number;
const MINOR_VERSION: number;
const VERSION: string;
/**
* gets the default wireplumber object.
* @returns gets the default wireplumber object.
*/
function get_default(): Wp | null;
namespace Audio {
// Signal callback interfaces
interface DeviceAdded {
(object: Device): void;
}
interface DeviceRemoved {
(object: Device): void;
}
interface MicrophoneAdded {
(object: Endpoint): void;
}
interface MicrophoneRemoved {
(object: Endpoint): void;
}
interface RecorderAdded {
(object: Endpoint): void;
}
interface RecorderRemoved {
(object: Endpoint): void;
}
interface SpeakerAdded {
(object: Endpoint): void;
}
interface SpeakerRemoved {
(object: Endpoint): void;
}
interface StreamAdded {
(object: Endpoint): void;
}
interface StreamRemoved {
(object: Endpoint): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
default_microphone: Endpoint;
defaultMicrophone: Endpoint;
default_speaker: Endpoint;
defaultSpeaker: Endpoint;
devices: Device[];
microphones: Endpoint[];
recorders: Endpoint[];
speakers: Endpoint[];
streams: Endpoint[];
}
}
/**
* is instanciated by [class`AstalWp`.Wp]. An instance of class can only be received there.
*
* This is a convinience class and acts as a filter for [class`AstalWp`.Wp] to filter for audio
* endpoints and devices.
*/
class Audio extends GObject.Object {
static $gtype: GObject.GType<Audio>;
// Properties
/**
* The AstalWndpoint object representing the default speaker
*/
get default_microphone(): Endpoint;
/**
* The AstalWndpoint object representing the default speaker
*/
get defaultMicrophone(): Endpoint;
/**
* The AstalWndpoint object representing the default speaker
*/
get default_speaker(): Endpoint;
/**
* The AstalWndpoint object representing the default speaker
*/
get defaultSpeaker(): Endpoint;
/**
* A list of AstalWpEndpoint objects
*/
get devices(): Device[];
/**
* A list of AstalWpEndpoint objects
*/
get microphones(): Endpoint[];
/**
* A list of AstalWpEndpoint objects
*/
get recorders(): Endpoint[];
/**
* A list of AstalWpEndpoint objects
*/
get speakers(): Endpoint[];
/**
* A list of AstalWpEndpoint objects
*/
get streams(): Endpoint[];
// Constructors
constructor(properties?: Partial<Audio.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](wp: Wp): Audio;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'device-added', callback: (_source: this, object: Device) => void): number;
connect_after(signal: 'device-added', callback: (_source: this, object: Device) => void): number;
emit(signal: 'device-added', object: Device): void;
connect(signal: 'device-removed', callback: (_source: this, object: Device) => void): number;
connect_after(signal: 'device-removed', callback: (_source: this, object: Device) => void): number;
emit(signal: 'device-removed', object: Device): void;
connect(signal: 'microphone-added', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'microphone-added', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'microphone-added', object: Endpoint): void;
connect(signal: 'microphone-removed', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'microphone-removed', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'microphone-removed', object: Endpoint): void;
connect(signal: 'recorder-added', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'recorder-added', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'recorder-added', object: Endpoint): void;
connect(signal: 'recorder-removed', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'recorder-removed', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'recorder-removed', object: Endpoint): void;
connect(signal: 'speaker-added', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'speaker-added', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'speaker-added', object: Endpoint): void;
connect(signal: 'speaker-removed', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'speaker-removed', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'speaker-removed', object: Endpoint): void;
connect(signal: 'stream-added', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'stream-added', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'stream-added', object: Endpoint): void;
connect(signal: 'stream-removed', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'stream-removed', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'stream-removed', object: Endpoint): void;
// Methods
/**
* gets the default microphone object
*/
get_default_microphone(): Endpoint | null;
/**
* gets the default speaker object
*/
get_default_speaker(): Endpoint | null;
/**
* gets the device with the given id
* @param id the id of the device
*/
get_device(id: number): Device | null;
/**
* a GList containing the devices
*/
get_devices(): Device[] | null;
/**
* the endpoint with the given id
* @param id the id of the endpoint
*/
get_endpoint(id: number): Endpoint | null;
/**
* gets the microphone with the given id
* @param id the id of the endpoint
*/
get_microphone(id: number): Endpoint | null;
/**
* a GList containing the microphones
*/
get_microphones(): Endpoint[] | null;
/**
* gets the recorder with the given id
* @param id the id of the endpoint
*/
get_recorder(id: number): Endpoint | null;
/**
* a GList containing the recorders
*/
get_recorders(): Endpoint[] | null;
/**
* gets the speaker with the given id
* @param id the id of the endpoint
*/
get_speaker(id: number): Endpoint | null;
/**
* a GList containing the speakers
*/
get_speakers(): Endpoint[] | null;
/**
* gets the stream with the given id
* @param id the id of the endpoint
*/
get_stream(id: number): Endpoint | null;
/**
* a GList containing the streams
*/
get_streams(): Endpoint[] | null;
}
namespace Device {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
active_profile_id: number;
activeProfileId: number;
description: string;
device_type: DeviceType;
deviceType: DeviceType;
icon: string;
id: number;
profiles: Profile[];
}
}
class Device extends GObject.Object {
static $gtype: GObject.GType<Device>;
// Properties
/**
* The id of the currently active profile.
*/
get active_profile_id(): number;
set active_profile_id(val: number);
/**
* The id of the currently active profile.
*/
get activeProfileId(): number;
set activeProfileId(val: number);
/**
* The description of this device.
*/
get description(): string;
/**
* The type of this device
*/
get device_type(): DeviceType;
/**
* The type of this device
*/
get deviceType(): DeviceType;
/**
* The icon name for this device.
*/
get icon(): string;
/**
* The id of this device.
*/
get id(): number;
/**
* A list of available profiles
*/
get profiles(): Profile[];
// Constructors
constructor(properties?: Partial<Device.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* gets the currently active profile of this device
*/
get_active_profile(): number;
/**
* gets the description of this device
*/
get_description(): string;
/**
* gets the type of this device
*/
get_device_type(): DeviceType;
/**
* gets the icon of this device
*/
get_icon(): string;
/**
* gets the id of this device
*/
get_id(): number;
/**
* gets the profile with the given id
* @param id the id of the profile
*/
get_profile(id: number): Profile | null;
/**
* gets a GList containing the profiles
*/
get_profiles(): Profile[] | null;
/**
* sets the profile for this device
* @param profile_id the id of the profile
*/
set_active_profile(profile_id: number): void;
}
namespace Endpoint {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
description: string;
icon: string;
id: number;
is_default: boolean;
isDefault: boolean;
lock_channels: boolean;
lockChannels: boolean;
media_class: MediaClass;
mediaClass: MediaClass;
mute: boolean;
name: string;
path: string;
serial: number;
volume: number;
volume_icon: string;
volumeIcon: string;
}
}
class Endpoint extends GObject.Object {
static $gtype: GObject.GType<Endpoint>;
// Properties
/**
* The description of this endpoint
*/
get description(): string;
/**
* The icon of this endpoint. Note that endpoints do not have icons associated with them in
* pipewire, so the icon of the associated device is used instead.
*/
get icon(): string;
/**
* The pipewire id of this endpoint.
*/
get id(): number;
/**
* Whether this endpoint is the default one used for this media-class. Note that setting this
* property to false has no effect.
*/
get is_default(): boolean;
set is_default(val: boolean);
/**
* Whether this endpoint is the default one used for this media-class. Note that setting this
* property to false has no effect.
*/
get isDefault(): boolean;
set isDefault(val: boolean);
/**
* Whether to lock the channels together or not.
*/
get lock_channels(): boolean;
set lock_channels(val: boolean);
/**
* Whether to lock the channels together or not.
*/
get lockChannels(): boolean;
set lockChannels(val: boolean);
/**
* The media class of this endpoint
*/
get media_class(): MediaClass;
/**
* The media class of this endpoint
*/
get mediaClass(): MediaClass;
/**
* The mute state of this endpoint
*/
get mute(): boolean;
set mute(val: boolean);
/**
* The name of this endpoint
*/
get name(): string;
/**
* The object path of this endpoint
*/
get path(): string;
/**
* The object serial of this endpoint.
*/
get serial(): number;
/**
* The volume of this endpoint
*/
get volume(): number;
set volume(val: number);
/**
* The volume icon of this endpoint
*/
get volume_icon(): string;
/**
* The volume icon of this endpoint
*/
get volumeIcon(): string;
// Constructors
constructor(properties?: Partial<Endpoint.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* gets the description of this endpoint
*/
get_description(): string;
/**
* gets the icon for this endpoint
*/
get_icon(): string;
/**
* gets the id of the endpoint.
*/
get_id(): number;
get_is_default(): boolean;
get_lock_channels(): boolean;
/**
* gets the media class of the endpoint.
*/
get_media_class(): MediaClass;
/**
* gets the mute status of the endpoint.
*/
get_mute(): boolean;
/**
* gets the name of this endpoint
*/
get_name(): string;
/**
* gets the object path of this endpoint
*/
get_path(): string;
/**
* gets the serial number of this endpoint
*/
get_serial(): number;
/**
* gets the volume
*/
get_volume(): number;
get_volume_icon(): string;
set_is_default(is_default: boolean): void;
set_lock_channels(lock_channels: boolean): void;
/**
* Sets the mute status for the endpoint.
* @param mute A boolean indicating whether to mute the endpoint.
*/
set_mute(mute: boolean): void;
/**
* Sets the volume level for this endpoint. The volume is clamped to be between
* 0 and 1.5.
* @param volume The new volume level to set.
*/
set_volume(volume: number): void;
}
namespace Profile {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
description: string;
index: number;
}
}
class Profile extends GObject.Object {
static $gtype: GObject.GType<Profile>;
// Properties
get description(): string;
get index(): number;
// Constructors
constructor(properties?: Partial<Profile.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
get_description(): string;
get_index(): number;
}
namespace Video {
// Signal callback interfaces
interface DeviceAdded {
(object: Device): void;
}
interface DeviceRemoved {
(object: Device): void;
}
interface RecorderAdded {
(object: Endpoint): void;
}
interface RecorderRemoved {
(object: Endpoint): void;
}
interface SinkAdded {
(object: Endpoint): void;
}
interface SinkRemoved {
(object: Endpoint): void;
}
interface SourceAdded {
(object: Endpoint): void;
}
interface SourceRemoved {
(object: Endpoint): void;
}
interface StreamAdded {
(object: Endpoint): void;
}
interface StreamRemoved {
(object: Endpoint): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
devices: Endpoint[];
recorders: any;
sinks: Endpoint[];
sources: Endpoint[];
streams: Endpoint[];
}
}
/**
* is instanciated by [class`AstalWp`.Wp]. An instance of class can only be received there.
*
* This is a convinience class and acts as a filter for [class`AstalWp`.Wp] to filter for video
* endpoints and devices.
*/
class Video extends GObject.Object {
static $gtype: GObject.GType<Video>;
// Properties
/**
* A list of AstalWpEndpoint objects
*/
get devices(): Endpoint[];
get recorders(): any;
/**
* A list of AstalWpEndpoint objects
*/
get sinks(): Endpoint[];
/**
* A list of AstalWpEndpoint objects
*/
get sources(): Endpoint[];
/**
* A list of AstalWpEndpoint objects
*/
get streams(): Endpoint[];
// Constructors
constructor(properties?: Partial<Video.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](wp: Wp): Video;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'device-added', callback: (_source: this, object: Device) => void): number;
connect_after(signal: 'device-added', callback: (_source: this, object: Device) => void): number;
emit(signal: 'device-added', object: Device): void;
connect(signal: 'device-removed', callback: (_source: this, object: Device) => void): number;
connect_after(signal: 'device-removed', callback: (_source: this, object: Device) => void): number;
emit(signal: 'device-removed', object: Device): void;
connect(signal: 'recorder-added', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'recorder-added', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'recorder-added', object: Endpoint): void;
connect(signal: 'recorder-removed', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'recorder-removed', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'recorder-removed', object: Endpoint): void;
connect(signal: 'sink-added', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'sink-added', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'sink-added', object: Endpoint): void;
connect(signal: 'sink-removed', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'sink-removed', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'sink-removed', object: Endpoint): void;
connect(signal: 'source-added', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'source-added', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'source-added', object: Endpoint): void;
connect(signal: 'source-removed', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'source-removed', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'source-removed', object: Endpoint): void;
connect(signal: 'stream-added', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'stream-added', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'stream-added', object: Endpoint): void;
connect(signal: 'stream-removed', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'stream-removed', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'stream-removed', object: Endpoint): void;
// Methods
/**
* the device with the given id
* @param id the id of the device
* @returns the device with the given id
*/
get_device(id: number): Device | null;
/**
* a list containing the devices
* @returns a GList containing the devices
*/
get_devices(): Device[] | null;
/**
* the recorder with the given id
* @param id the id of the endpoint
* @returns the recorder with the given id
*/
get_recorder(id: number): Endpoint | null;
/**
* a list containing the video recorders
* @returns a GList containing the video recorders
*/
get_recorders(): Endpoint[] | null;
/**
* the sink with the given id
* @param id the id of the endpoint
* @returns the sink with the given id
*/
get_sink(id: number): Endpoint | null;
/**
* a list containing the video sinks
* @returns a GList containing the video sinks
*/
get_sinks(): Endpoint[] | null;
/**
* the source with the given id
* @param id the id of the endpoint
* @returns the source with the given id
*/
get_source(id: number): Endpoint | null;
/**
* a list containing the video sources
* @returns a GList containing the video sources
*/
get_sources(): Endpoint[] | null;
/**
* the stream with the given id
* @param id the id of the endpoint
* @returns the stream with the given id
*/
get_stream(id: number): Endpoint | null;
/**
* a list containing the video streams
* @returns a GList containing the video streams
*/
get_streams(): Endpoint[] | null;
}
namespace Wp {
// Signal callback interfaces
interface DeviceAdded {
(object: Device): void;
}
interface DeviceRemoved {
(object: Device): void;
}
interface EndpointAdded {
(object: Endpoint): void;
}
interface EndpointRemoved {
(object: Endpoint): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
audio: Audio;
default_microphone: Endpoint;
defaultMicrophone: Endpoint;
default_speaker: Endpoint;
defaultSpeaker: Endpoint;
devices: Device[];
endpoints: Endpoint[];
scale: Scale;
video: Video;
}
}
/**
* manages the connection to wireplumber. Usually you don't want to use this class directly, but use
* the [class`AstalWp`.Audio] or [class`AstalWp`.Video] instead.
*/
class Wp extends GObject.Object {
static $gtype: GObject.GType<Wp>;
// Properties
get audio(): Audio;
/**
* The [class`AstalWp`.Endpoint] representing the default speaker
*/
get default_microphone(): Endpoint;
/**
* The [class`AstalWp`.Endpoint] representing the default speaker
*/
get defaultMicrophone(): Endpoint;
/**
* The [class`AstalWp`.Endpoint] representing the default speaker
*/
get default_speaker(): Endpoint;
/**
* The [class`AstalWp`.Endpoint] representing the default speaker
*/
get defaultSpeaker(): Endpoint;
/**
* A list of [class`AstalWp`.Device] objects
*/
get devices(): Device[];
/**
* A list of [class`AstalWp`.Endpoint] objects
*/
get endpoints(): Endpoint[];
/**
* The scale used for the volume
*/
get scale(): Scale;
set scale(val: Scale);
get video(): Video;
// Constructors
constructor(properties?: Partial<Wp.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'device-added', callback: (_source: this, object: Device) => void): number;
connect_after(signal: 'device-added', callback: (_source: this, object: Device) => void): number;
emit(signal: 'device-added', object: Device): void;
connect(signal: 'device-removed', callback: (_source: this, object: Device) => void): number;
connect_after(signal: 'device-removed', callback: (_source: this, object: Device) => void): number;
emit(signal: 'device-removed', object: Device): void;
connect(signal: 'endpoint-added', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'endpoint-added', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'endpoint-added', object: Endpoint): void;
connect(signal: 'endpoint-removed', callback: (_source: this, object: Endpoint) => void): number;
connect_after(signal: 'endpoint-removed', callback: (_source: this, object: Endpoint) => void): number;
emit(signal: 'endpoint-removed', object: Endpoint): void;
// Static methods
/**
* gets the default wireplumber object.
*/
static get_default(): Wp | null;
// Methods
/**
* gets the [class`AstalWp`.Audio] object
* @returns gets the audio object
*/
get_audio(): Audio | null;
/**
* gets the default microphone object
* @returns gets the default microphone object
*/
get_default_microphone(): Endpoint | null;
/**
* gets the default speaker object
* @returns gets the default speaker object
*/
get_default_speaker(): Endpoint | null;
/**
* the device with the given id
* @param id the id of the device
* @returns the device with the given id
*/
get_device(id: number): Device | null;
/**
* the GList containing the devices
* @returns a GList containing the devices
*/
get_devices(): Device[] | null;
/**
* the endpoint with the given id
* @param id the id of the endpoint
* @returns the endpoint with the given id
*/
get_endpoint(id: number): Endpoint | null;
/**
* a GList containing all endpoints
* @returns a GList containing the endpoints
*/
get_endpoints(): Endpoint[] | null;
get_scale(): Scale;
/**
* gets the video object
* @returns gets the video object
*/
get_video(): Video | null;
set_scale(scale: Scale | null): void;
}
type AudioClass = typeof Audio;
type DeviceClass = typeof Device;
type EndpointClass = typeof Endpoint;
type ProfileClass = typeof Profile;
type VideoClass = typeof Video;
type WpClass = typeof Wp;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalWp;
}
declare module 'gi://AstalWp' {
import AstalWp01 from 'gi://AstalWp?version=0.1';
export default AstalWp01;
}
// END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,746 +0,0 @@
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./avahicore-0.6.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://Avahi?version=0.6' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type AvahiCore from 'gi://AvahiCore?version=0.6';
export namespace Avahi {
/**
* Avahi-0.6
*/
export namespace BrowserEvent {
export const $gtype: GObject.GType<BrowserEvent>;
}
enum BrowserEvent {
GA_BROWSER_NEW,
GA_BROWSER_REMOVE,
GA_BROWSER_CACHE_EXHAUSTED,
GA_BROWSER_ALL_FOR_NOW,
GA_BROWSER_FAILURE,
}
export namespace ClientFlags {
export const $gtype: GObject.GType<ClientFlags>;
}
enum ClientFlags {
GA_CLIENT_FLAG_NO_FLAGS,
GA_CLIENT_FLAG_IGNORE_USER_CONFIG,
GA_CLIENT_FLAG_NO_FAIL,
}
export namespace ClientState {
export const $gtype: GObject.GType<ClientState>;
}
enum ClientState {
GA_CLIENT_STATE_NOT_STARTED,
GA_CLIENT_STATE_S_REGISTERING,
GA_CLIENT_STATE_S_RUNNING,
GA_CLIENT_STATE_S_COLLISION,
GA_CLIENT_STATE_FAILURE,
GA_CLIENT_STATE_CONNECTING,
}
export namespace EntryGroupState {
export const $gtype: GObject.GType<EntryGroupState>;
}
enum EntryGroupState {
GA_ENTRY_GROUP_STATE_UNCOMMITED,
GA_ENTRY_GROUP_STATE_REGISTERING,
GA_ENTRY_GROUP_STATE_ESTABLISHED,
GA_ENTRY_GROUP_STATE_COLLISION,
GA_ENTRY_GROUP_STATE_FAILURE,
}
export namespace LookupFlags {
export const $gtype: GObject.GType<LookupFlags>;
}
enum LookupFlags {
GA_LOOKUP_NO_FLAGS,
GA_LOOKUP_USE_WIDE_AREA,
GA_LOOKUP_USE_MULTICAST,
GA_LOOKUP_NO_TXT,
GA_LOOKUP_NO_ADDRESS,
}
export namespace LookupResultFlags {
export const $gtype: GObject.GType<LookupResultFlags>;
}
enum LookupResultFlags {
GA_LOOKUP_RESULT_CACHED,
GA_LOOKUP_RESULT_WIDE_AREA,
GA_LOOKUP_RESULT_MULTICAST,
GA_LOOKUP_RESULT_LOCAL,
GA_LOOKUP_RESULT_OUR_OWN,
GA_LOOKUP_RESULT_STATIC,
}
export namespace Protocol {
export const $gtype: GObject.GType<Protocol>;
}
enum Protocol {
GA_PROTOCOL_INET,
GA_PROTOCOL_INET6,
GA_PROTOCOL_UNSPEC,
}
export namespace ResolverEvent {
export const $gtype: GObject.GType<ResolverEvent>;
}
enum ResolverEvent {
GA_RESOLVER_FOUND,
GA_RESOLVER_FAILURE,
}
function error_quark(): GLib.Quark;
namespace Client {
// Signal callback interfaces
interface StateChanged {
(object: ClientState): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
flags: ClientFlags;
state: ClientState;
}
}
class Client extends GObject.Object {
static $gtype: GObject.GType<Client>;
// Properties
get flags(): ClientFlags;
get state(): ClientState;
// Constructors
constructor(properties?: Partial<Client.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](flags: ClientFlags): Client;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'state-changed', callback: (_source: this, object: ClientState) => void): number;
connect_after(signal: 'state-changed', callback: (_source: this, object: ClientState) => void): number;
emit(signal: 'state-changed', object: ClientState): void;
// Methods
start(): boolean;
start_in_context(context: GLib.MainContext): boolean;
}
namespace EntryGroup {
// Signal callback interfaces
interface StateChanged {
(object: EntryGroupState): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
state: EntryGroupState;
}
}
class EntryGroup extends GObject.Object {
static $gtype: GObject.GType<EntryGroup>;
// Properties
get state(): EntryGroupState;
// Constructors
constructor(properties?: Partial<EntryGroup.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): EntryGroup;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'state-changed', callback: (_source: this, object: EntryGroupState) => void): number;
connect_after(signal: 'state-changed', callback: (_source: this, object: EntryGroupState) => void): number;
emit(signal: 'state-changed', object: EntryGroupState): void;
// Methods
add_record(
flags: AvahiCore.PublishFlags | null,
name: string,
type: number,
ttl: number,
rdata: any | null,
size: number,
): boolean;
add_record_full(
_interface: AvahiCore.IfIndex,
protocol: AvahiCore.Protocol | null,
flags: AvahiCore.PublishFlags | null,
name: string,
clazz: number,
type: number,
ttl: number,
rdata: any | null,
size: number,
): boolean;
attach(client: Client): boolean;
commit(): boolean;
reset(): boolean;
}
namespace RecordBrowser {
// Signal callback interfaces
interface AllForNow {
(): void;
}
interface CacheExhausted {
(): void;
}
interface Failure {
(object?: any | null): void;
}
interface NewRecord {
(
object: number,
p0: Protocol,
p1: string,
p2: number,
p3: number,
p4: any | null,
p5: number,
p6: LookupResultFlags,
): void;
}
interface RemovedRecord {
(
object: number,
p0: Protocol,
p1: string,
p2: number,
p3: number,
p4: any | null,
p5: number,
p6: LookupResultFlags,
): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
class: number;
flags: LookupFlags;
interface: number;
name: string;
protocol: Protocol;
type: number;
}
}
class RecordBrowser extends GObject.Object {
static $gtype: GObject.GType<RecordBrowser>;
// Properties
get class(): number;
set class(val: number);
get flags(): LookupFlags;
set flags(val: LookupFlags);
get interface(): number;
set interface(val: number);
get name(): string;
set name(val: string);
get protocol(): Protocol;
set protocol(val: Protocol);
get type(): number;
set type(val: number);
// Constructors
constructor(properties?: Partial<RecordBrowser.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](name: string, type: number): RecordBrowser;
static new_full(
_interface: AvahiCore.IfIndex,
protocol: AvahiCore.Protocol,
name: string,
clazz: number,
type: number,
flags: LookupFlags,
): RecordBrowser;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'all-for-now', callback: (_source: this) => void): number;
connect_after(signal: 'all-for-now', callback: (_source: this) => void): number;
emit(signal: 'all-for-now'): void;
connect(signal: 'cache-exhausted', callback: (_source: this) => void): number;
connect_after(signal: 'cache-exhausted', callback: (_source: this) => void): number;
emit(signal: 'cache-exhausted'): void;
connect(signal: 'failure', callback: (_source: this, object: any | null) => void): number;
connect_after(signal: 'failure', callback: (_source: this, object: any | null) => void): number;
emit(signal: 'failure', object?: any | null): void;
connect(
signal: 'new-record',
callback: (
_source: this,
object: number,
p0: Protocol,
p1: string,
p2: number,
p3: number,
p4: any | null,
p5: number,
p6: LookupResultFlags,
) => void,
): number;
connect_after(
signal: 'new-record',
callback: (
_source: this,
object: number,
p0: Protocol,
p1: string,
p2: number,
p3: number,
p4: any | null,
p5: number,
p6: LookupResultFlags,
) => void,
): number;
emit(
signal: 'new-record',
object: number,
p0: Protocol,
p1: string,
p2: number,
p3: number,
p4: any | null,
p5: number,
p6: LookupResultFlags,
): void;
connect(
signal: 'removed-record',
callback: (
_source: this,
object: number,
p0: Protocol,
p1: string,
p2: number,
p3: number,
p4: any | null,
p5: number,
p6: LookupResultFlags,
) => void,
): number;
connect_after(
signal: 'removed-record',
callback: (
_source: this,
object: number,
p0: Protocol,
p1: string,
p2: number,
p3: number,
p4: any | null,
p5: number,
p6: LookupResultFlags,
) => void,
): number;
emit(
signal: 'removed-record',
object: number,
p0: Protocol,
p1: string,
p2: number,
p3: number,
p4: any | null,
p5: number,
p6: LookupResultFlags,
): void;
// Methods
attach(client: Client): boolean;
}
namespace ServiceBrowser {
// Signal callback interfaces
interface AllForNow {
(): void;
}
interface CacheExhausted {
(): void;
}
interface Failure {
(object?: any | null): void;
}
interface NewService {
(object: number, p0: Protocol, p1: string, p2: string, p3: string, p4: LookupResultFlags): void;
}
interface RemovedService {
(object: number, p0: Protocol, p1: string, p2: string, p3: string, p4: LookupResultFlags): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
domain: string;
flags: LookupFlags;
interface: number;
protocol: Protocol;
type: string;
}
}
class ServiceBrowser extends GObject.Object {
static $gtype: GObject.GType<ServiceBrowser>;
// Properties
get domain(): string;
set domain(val: string);
get flags(): LookupFlags;
set flags(val: LookupFlags);
get interface(): number;
set interface(val: number);
get protocol(): Protocol;
set protocol(val: Protocol);
get type(): string;
set type(val: string);
// Constructors
constructor(properties?: Partial<ServiceBrowser.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](type: string): ServiceBrowser;
static new_full(
_interface: AvahiCore.IfIndex,
protocol: AvahiCore.Protocol,
type: string,
domain: string,
flags: LookupFlags,
): ServiceBrowser;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'all-for-now', callback: (_source: this) => void): number;
connect_after(signal: 'all-for-now', callback: (_source: this) => void): number;
emit(signal: 'all-for-now'): void;
connect(signal: 'cache-exhausted', callback: (_source: this) => void): number;
connect_after(signal: 'cache-exhausted', callback: (_source: this) => void): number;
emit(signal: 'cache-exhausted'): void;
connect(signal: 'failure', callback: (_source: this, object: any | null) => void): number;
connect_after(signal: 'failure', callback: (_source: this, object: any | null) => void): number;
emit(signal: 'failure', object?: any | null): void;
connect(
signal: 'new-service',
callback: (
_source: this,
object: number,
p0: Protocol,
p1: string,
p2: string,
p3: string,
p4: LookupResultFlags,
) => void,
): number;
connect_after(
signal: 'new-service',
callback: (
_source: this,
object: number,
p0: Protocol,
p1: string,
p2: string,
p3: string,
p4: LookupResultFlags,
) => void,
): number;
emit(
signal: 'new-service',
object: number,
p0: Protocol,
p1: string,
p2: string,
p3: string,
p4: LookupResultFlags,
): void;
connect(
signal: 'removed-service',
callback: (
_source: this,
object: number,
p0: Protocol,
p1: string,
p2: string,
p3: string,
p4: LookupResultFlags,
) => void,
): number;
connect_after(
signal: 'removed-service',
callback: (
_source: this,
object: number,
p0: Protocol,
p1: string,
p2: string,
p3: string,
p4: LookupResultFlags,
) => void,
): number;
emit(
signal: 'removed-service',
object: number,
p0: Protocol,
p1: string,
p2: string,
p3: string,
p4: LookupResultFlags,
): void;
// Methods
attach(client: Client): boolean;
}
namespace ServiceResolver {
// Signal callback interfaces
interface Failure {
(object?: any | null): void;
}
interface Found {
(
object: number,
p0: Protocol,
p1: string,
p2: string,
p3: string,
p4: string,
p5: any | null,
p6: number,
p7: any | null,
p8: LookupResultFlags,
): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
aprotocol: Protocol;
domain: string;
flags: LookupFlags;
interface: number;
name: string;
protocol: Protocol;
type: string;
}
}
class ServiceResolver extends GObject.Object {
static $gtype: GObject.GType<ServiceResolver>;
// Properties
get aprotocol(): Protocol;
set aprotocol(val: Protocol);
get domain(): string;
set domain(val: string);
get flags(): LookupFlags;
set flags(val: LookupFlags);
get interface(): number;
set interface(val: number);
get name(): string;
set name(val: string);
get protocol(): Protocol;
set protocol(val: Protocol);
get type(): string;
set type(val: string);
// Constructors
constructor(properties?: Partial<ServiceResolver.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
_interface: AvahiCore.IfIndex,
protocol: AvahiCore.Protocol,
name: string,
type: string,
domain: string,
address_protocol: AvahiCore.Protocol,
flags: LookupFlags,
): ServiceResolver;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'failure', callback: (_source: this, object: any | null) => void): number;
connect_after(signal: 'failure', callback: (_source: this, object: any | null) => void): number;
emit(signal: 'failure', object?: any | null): void;
connect(
signal: 'found',
callback: (
_source: this,
object: number,
p0: Protocol,
p1: string,
p2: string,
p3: string,
p4: string,
p5: any | null,
p6: number,
p7: any | null,
p8: LookupResultFlags,
) => void,
): number;
connect_after(
signal: 'found',
callback: (
_source: this,
object: number,
p0: Protocol,
p1: string,
p2: string,
p3: string,
p4: string,
p5: any | null,
p6: number,
p7: any | null,
p8: LookupResultFlags,
) => void,
): number;
emit(
signal: 'found',
object: number,
p0: Protocol,
p1: string,
p2: string,
p3: string,
p4: string,
p5: any | null,
p6: number,
p7: any | null,
p8: LookupResultFlags,
): void;
// Methods
attach(client: Client): boolean;
get_address(address: AvahiCore.Address, port: number): boolean;
}
type ClientClass = typeof Client;
type EntryGroupClass = typeof EntryGroup;
class EntryGroupService {
static $gtype: GObject.GType<EntryGroupService>;
// Fields
'interface': AvahiCore.IfIndex;
protocol: AvahiCore.Protocol;
flags: AvahiCore.PublishFlags;
name: string;
type: string;
domain: string;
host: string;
port: number;
// Constructors
_init(...args: any[]): void;
// Methods
freeze(): void;
remove_key(key: string): boolean;
set(key: string, value: string): boolean;
set_arbitrary(key: string, value: number, size: number): boolean;
thaw(): boolean;
}
type RecordBrowserClass = typeof RecordBrowser;
type ServiceBrowserClass = typeof ServiceBrowser;
type ServiceResolverClass = typeof ServiceResolver;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default Avahi;
}
declare module 'gi://Avahi' {
import Avahi06 from 'gi://Avahi?version=0.6';
export default Avahi06;
}
// END

View File

@ -1,91 +0,0 @@
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AvahiCore?version=0.6' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
export namespace AvahiCore {
/**
* AvahiCore-0.6
*/
export namespace Protocol {
export const $gtype: GObject.GType<Protocol>;
}
enum Protocol {
INET,
INET6,
UNSPEC,
}
function server_get_host_name(): string;
export namespace PublishFlags {
export const $gtype: GObject.GType<PublishFlags>;
}
enum PublishFlags {
UNIQUE,
NO_PROBE,
NO_ANNOUNCE,
ALLOW_MULTIPLE,
NO_REVERSE,
NO_COOKIE,
UPDATE,
USE_WIDE_AREA,
USE_MULTICAST,
}
class StringList {
static $gtype: GObject.GType<StringList>;
// Constructors
_init(...args: any[]): void;
}
class Address {
static $gtype: GObject.GType<Address>;
// Constructors
_init(...args: any[]): void;
}
class Client {
static $gtype: GObject.GType<Client>;
// Constructors
_init(...args: any[]): void;
}
type IfIndex = number;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AvahiCore;
}
declare module 'gi://AvahiCore' {
import AvahiCore06 from 'gi://AvahiCore?version=0.6';
export default AvahiCore06;
}
// END

View File

@ -1,533 +0,0 @@
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://Babl?version=0.1' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
export namespace Babl {
/**
* Babl-0.1
*/
export namespace IccIntent {
export const $gtype: GObject.GType<IccIntent>;
}
enum IccIntent {
PERCEPTUAL,
RELATIVE_COLORIMETRIC,
SATURATION,
ABSOLUTE_COLORIMETRIC,
PERFORMANCE,
}
export namespace SpaceFlags {
export const $gtype: GObject.GType<SpaceFlags>;
}
enum SpaceFlags {
NONE,
EQUALIZE,
}
const ALPHA_FLOOR: number;
const ALPHA_FLOOR_F: number;
const MAJOR_VERSION: number;
const MICRO_VERSION: number;
const MINOR_VERSION: number;
/**
* Returns the babl object representing the color component given by
* `name` such as for example "R", "cyan" or "CIE L".
* @param name
*/
function component(name: string): Object;
/**
* Returns the RGB space defined for the destination of conversion.
* @param conversion
*/
function conversion_get_destination_space(conversion: Object): Object;
/**
* Returns the RGB space defined for the source of conversion.
* @param conversion
*/
function conversion_get_source_space(conversion: Object): Object;
/**
* Deinitializes the babl library and frees any resources used when
* matched with the number of calls to babl_init().
*/
function exit(): void;
/**
* Create a faster than normal fish with specified performance (and thus
* corresponding precision tradeoff), values tolerance can hold: NULL and
* "default", means do same as babl_fish(), other values understood in
* increasing order of speed gain are:
* "exact" "precise" "fast" "glitch"
*
* Fast fishes should be cached, since they are not internally kept track
* of/made into singletons by babl and many creations of fast fishes will
* otherwise be a leak.
* @param source_format
* @param destination_format
* @param performance
*/
function fast_fish(source_format: any | null, destination_format: any | null, performance: string): Object;
/**
* Create a babl fish capable of converting from source_format to
* destination_format, source and destination can be either strings
* with the names of the formats or Babl-format objects.
* @param source_format
* @param destination_format
*/
function fish(source_format?: any | null, destination_format?: any | null): Object;
/**
* Returns the babl object representing the color format given by
* `name` such as for example "RGB u8", "CMYK float" or "CIE Lab u16",
* creates a format using the sRGB space, to also specify the color space
* and TRCs for a format, see babl_format_with_space.
* @param encoding
*/
function format(encoding: string): Object;
/**
* Returns 1 if the provided format name is known by babl or 0 if it is
* not. Can also be used to verify that specific extension formats are
* available (though this can also be inferred from the version of babl).
* @param name
*/
function format_exists(name: string): number;
/**
* Returns the bytes per pixel for a babl color format.
* @param format
*/
function format_get_bytes_per_pixel(format: Object): number;
/**
* Returns the components and data type, without space suffix.
* @param babl
*/
function format_get_encoding(babl: Object): string;
/**
* Return the model used for constructing the format.
* @param format
*/
function format_get_model(format: Object): Object;
/**
* Returns the number of components for the given `format`.
* @param format
*/
function format_get_n_components(format: Object): number;
function format_get_space(format: Object): Object;
/**
* Returns the type in the given `format` for the given
* `component_index`.
* @param format
* @param component_index
*/
function format_get_type(format: Object, component_index: number): Object;
/**
* Returns whether the `format` has an alpha channel.
* @param format
*/
function format_has_alpha(format: Object): number;
/**
* Returns whether the `format` is a format_n type.
* @param format
*/
function format_is_format_n(format: Object): number;
/**
* check whether a format is a palette backed format.
* @param format
*/
function format_is_palette(format: Object): number;
function format_n(type: Object, components: number): Object;
/**
* Returns the babl object representing the color format given by
* `name` such as for example "RGB u8", "R'G'B'A float", "Y float" with
* a specific RGB working space used as the space, the resulting format
* has -space suffixed to it, unless the space requested is sRGB then
* the unsuffixed version is used. If a format is passed in as space
* the space of the format is used.
* @param encoding
* @param space
*/
function format_with_space(encoding: string, space: Object): Object;
function get_model_flags(model: Object): ModelFlag;
/**
* Returns a string describing a Babl object.
* @param babl
*/
function get_name(babl: Object): string;
/**
* Get the version information on the babl library
*/
function get_version(): [number, number, number];
function icc_get_key(
icc_data: string,
icc_length: number,
key: string,
language: string,
country: string,
): string;
function icc_make_space(icc_data: string, icc_length: number, intent: IccIntent | null, error: string): Object;
/**
* Initializes the babl library.
*/
function init(): void;
/**
* introspect a given BablObject
* @param babl A #Babl
*/
function introspect(babl: Object): void;
/**
* Returns the babl object representing the color model given by `name`
* such as for example "RGB", "CMYK" or "CIE Lab".
* @param name
*/
function model(name: string): Object;
function model_is(babl: Object, model_name: string): number;
/**
* The models for formats also have a space in babl, try to avoid code
* needing to use this.
* @param name
* @param space
*/
function model_with_space(name: string, space: Object): Object;
/**
* create a new palette based format, name is optional pass in NULL to get
* an anonymous format. If you pass in with_alpha the format also gets
* an 8bit alpha channel. Returns the BablModel of the color model. If
* you pass in the same name the previous formats will be provided
* again.
* @param name
* @param format_u8
* @param format_u8_with_alpha
*/
function new_palette(name: string, format_u8: Object, format_u8_with_alpha: Object): Object;
/**
* create a new palette based format, name is optional pass in NULL to get
* an anonymous format. If you pass in with_alpha the format also gets
* an 8bit alpha channel. Returns the BablModel of the color model. If
* you pass in the same name the previous formats will be provided
* again.
* @param name
* @param space
* @param format_u8
* @param format_u8_with_alpha
*/
function new_palette_with_space(
name: string,
space: Object,
format_u8: Object,
format_u8_with_alpha: Object,
): Object;
/**
* reset a palette to initial state, frees up some caches that optimize
* conversions.
* @param babl
*/
function palette_reset(babl: Object): void;
/**
* Assign a palette to a palette format, the data is a single span of pixels
* representing the colors of the palette.
* @param babl a #Babl
* @param format The pixel format
* @param data The pixel data
* @param count The number of pixels in @data
*/
function palette_set_palette(babl: Object, format: Object, data: Uint8Array | string, count: number): void;
/**
* Process n pixels from source to destination using babl_fish,
* returns number of pixels converted.
* @param babl_fish
* @param source
* @param destination
* @param n
*/
function process(babl_fish: Object, source: any | null, destination: any | null, n: number): number;
function process_rows(
babl_fish: Object,
source: any | null,
source_stride: number,
dest: any | null,
dest_stride: number,
n: number,
rows: number,
): number;
/**
* Returns the babl object representing the `horizontal` and `vertical`
* sampling such as for example 2, 2 for the chroma components in
* YCbCr.
* @param horizontal
* @param vertical
*/
function sampling(horizontal: number, vertical: number): Object;
/**
* Returns the babl object representing the specific RGB matrix color
* working space referred to by name. Babl knows of:
* sRGB, Rec2020, Adobish, Apple and ProPhoto
* @param name
*/
function space(name: string): Object;
/**
* Creates a new babl-space/ RGB matrix color space definition with the
* specified CIE xy(Y) values for white point: wx, wy and primary
* chromaticities: rx,ry,gx,gy,bx,by and TRCs to be used. After registering a
* new babl-space it can be used with babl_space() passing its name;
*
* Internally this does the math to derive the RGBXYZ matrix as used in an ICC
* profile.
* @param name The name for the color space
* @param wx The X-coordinate of the color space's white point
* @param wy The Y-coordinate of the color space's white point
* @param rx The X-coordinate of the red primary
* @param ry The Y-coordinate of the red primary
* @param gx The X-coordinate of the green primary
* @param gy The Y-coordinate of the green primary
* @param bx The X-coordinate of the blue primary
* @param by The Y-coordinate of the blue primary
* @param trc_red The red component of the TRC.
* @param trc_green The green component of the TRC (can be %NULL if it's the same as @trc_red).
* @param trc_blue The blue component of the TRC (can be %NULL if it's the same as @trc_red).
* @param flags The #BablSpaceFlags
*/
function space_from_chromaticities(
name: string | null,
wx: number,
wy: number,
rx: number,
ry: number,
gx: number,
gy: number,
bx: number,
by: number,
trc_red: Object,
trc_green: Object | null,
trc_blue: Object | null,
flags: SpaceFlags | null,
): Object;
/**
* Create a babl space from an in memory ICC profile, the profile does no
* longer need to be loaded for the space to work, multiple calls with the same
* icc profile and same intent will result in the same babl space.
*
* On a profile that doesn't contain A2B0 and B2A0 CLUTs perceptual and
* relative-colorimetric intents are treated the same.
*
* If a BablSpace cannot be created from the profile NULL is returned and a
* static string is set on the const char *value pointed at with &value
* containing a message describing why the provided data does not yield a babl
* space.
* @param icc_data pointer to icc profile in memory
* @param icc_length length of icc profile in bytes
* @param intent the intent from the ICC profile to use.
*/
function space_from_icc(icc_data: string, icc_length: number, intent: IccIntent | null): [Object, string];
/**
* Creates a new RGB matrix color space definition using a precomputed D50
* adapted 3x3 matrix and associated CIE XYZ whitepoint, as possibly read from
* an ICC profile.
* @param name The name for the color space
* @param wx The X-coordinate of the color space's white point
* @param wy The Y-coordinate of the color space's white point
* @param wz The Z-coordinate of the color space's white point
* @param rx The X-coordinate of the red primary
* @param gx The X-coordinate of the green primary
* @param bx The X-coordinate of the blue primary
* @param ry The Y-coordinate of the red primary
* @param gy The Y-coordinate of the green primary
* @param by The Y-coordinate of the blue primary
* @param rz The Z-coordinate of the red primary
* @param gz The Z-coordinate of the green primary
* @param bz The Z-coordinate of the blue primary
* @param trc_red The red component of the TRC.
* @param trc_green The green component of the TRC (can be %NULL if it's the same as @trc_red).
* @param trc_blue The blue component of the TRC (can be %NULL if it's the same as @trc_red).
*/
function space_from_rgbxyz_matrix(
name: string | null,
wx: number,
wy: number,
wz: number,
rx: number,
gx: number,
bx: number,
ry: number,
gy: number,
by: number,
rz: number,
gz: number,
bz: number,
trc_red: Object,
trc_green?: Object | null,
trc_blue?: Object | null,
): Object;
/**
* query the chromaticities of white point and primaries as well as trcs
* used for r g a nd b, all arguments are optional (can be %NULL).
* @param space A #Babl instance
*/
function space_get(
space: Object,
): [
number,
number,
number,
number,
number,
number,
number,
number,
Object | null,
Object | null,
Object | null,
];
function space_get_gamma(space: Object): number;
/**
* Return pointer to ICC profile for space note that this is
* the ICC profile for R'G'B', though in formats only supporting linear
* like EXR GEGL chooses to load this lienar data as RGB and use the sRGB
* TRC.
* @param babl a #Babl
* @returns pointer to ICC profile data.
*/
function space_get_icc(babl: Object): Uint8Array;
/**
* Retrieve the relevant RGB luminance constants for a babl space.
*
* Note: these luminance coefficients should only ever be used on linear data.
* If your input `space` is non-linear, you should convert your pixel values to
* the linearized variant of `space` before making any computation with these
* coefficients. See #83.
* @param space a BablSpace
*/
function space_get_rgb_luminance(space: Object): [number, number, number];
function space_is_cmyk(space: Object): number;
function space_is_gray(space: Object): number;
function space_is_rgb(space: Object): number;
/**
* Creates a variant of an existing space with different trc.
* @param space
* @param trc
*/
function space_with_trc(space: Object, trc: Object): Object;
/**
* Look up a TRC by name, "sRGB" and "linear" are recognized
* strings in a stock babl configuration.
* @param name
*/
function trc(name: string): Object;
/**
* Creates a Babl TRC for a specific gamma value, it will be given
* a name that is a short string representation of the value.
* @param gamma
*/
function trc_gamma(gamma: number): Object;
/**
* Returns the babl object representing the data type given by `name`
* such as for example "u8", "u16" or "float".
* @param name
*/
function type(name: string): Object;
interface FishProcess {
(babl: Object, src: string, dst: string, n: number, data?: any | null): void;
}
interface FuncLinear {
(conversion: Object, src: string, dst: string, n: number): void;
}
interface FuncPlanar {
(
conversion: Object,
src_bands: number,
src: string,
src_pitch: number,
dst_bands: number,
dst: string,
dst_pitch: number,
n: number,
): void;
}
export namespace ModelFlag {
export const $gtype: GObject.GType<ModelFlag>;
}
enum ModelFlag {
/**
* the model encodes alpha.
*/
ALPHA,
/**
* the alpha is associated alpha.
*/
ASSOCIATED,
/**
* the components are inverted (used for getting the additive complement space of CMYK).
*/
INVERTED,
/**
* the data has no TRC, i.e. is linear
*/
LINEAR,
/**
* the data has a TRC - the TRC from the configured space
*/
NONLINEAR,
/**
* the data has a TRC - a perceptual TRC where 50% gray is 0.5
*/
PERCEPTUAL,
/**
* this is a gray component model
*/
GRAY,
/**
* this is an RGB based component model, the space associated is expected to contain an RGB matrix profile.
*/
RGB,
/**
* this model is part of the CIE family of spaces
*/
CIE,
/**
* the encodings described are CMYK encodings, the space associated is expected to contain an CMYK ICC profile.
*/
CMYK,
}
/**
* The babl API is based around polymorphism and almost everything is
* a Babl object.
*/
class Object {
static $gtype: GObject.GType<Object>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default Babl;
}
declare module 'gi://Babl' {
import Babl01 from 'gi://Babl?version=0.1';
export default Babl01;
}
// END

File diff suppressed because it is too large Load Diff

View File

@ -1,536 +0,0 @@
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://cairo?version=1.0' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
export namespace cairo {
/**
* cairo-1.0
*/
export namespace Status {
export const $gtype: GObject.GType<Status>;
}
enum Status {
SUCCESS,
NO_MEMORY,
INVALID_RESTORE,
INVALID_POP_GROUP,
NO_CURRENT_POINT,
INVALID_MATRIX,
INVALID_STATUS,
NULL_POINTER,
INVALID_STRING,
INVALID_PATH_DATA,
READ_ERROR,
WRITE_ERROR,
SURFACE_FINISHED,
SURFACE_TYPE_MISMATCH,
PATTERN_TYPE_MISMATCH,
INVALID_CONTENT,
INVALID_FORMAT,
INVALID_VISUAL,
FILE_NOT_FOUND,
INVALID_DASH,
INVALID_DSC_COMMENT,
INVALID_INDEX,
CLIP_NOT_REPRESENTABLE,
TEMP_FILE_ERROR,
INVALID_STRIDE,
FONT_TYPE_MISMATCH,
USER_FONT_IMMUTABLE,
USER_FONT_ERROR,
NEGATIVE_COUNT,
INVALID_CLUSTERS,
INVALID_SLANT,
INVALID_WEIGHT,
INVALID_SIZE,
USER_FONT_NOT_IMPLEMENTED,
DEVICE_TYPE_MISMATCH,
DEVICE_ERROR,
INVALID_MESH_CONSTRUCTION,
DEVICE_FINISHED,
JBIG2_GLOBAL_MISSING,
}
export namespace Content {
export const $gtype: GObject.GType<Content>;
}
enum Content {
COLOR,
ALPHA,
COLOR_ALPHA,
}
export namespace Operator {
export const $gtype: GObject.GType<Operator>;
}
enum Operator {
CLEAR,
SOURCE,
OVER,
IN,
OUT,
ATOP,
DEST,
DEST_OVER,
DEST_IN,
DEST_OUT,
DEST_ATOP,
XOR,
ADD,
SATURATE,
MULTIPLY,
SCREEN,
OVERLAY,
DARKEN,
LIGHTEN,
COLOR_DODGE,
COLOR_BURN,
HARD_LIGHT,
SOFT_LIGHT,
DIFFERENCE,
EXCLUSION,
HSL_HUE,
HSL_SATURATION,
HSL_COLOR,
HSL_LUMINOSITY,
}
export namespace Antialias {
export const $gtype: GObject.GType<Antialias>;
}
enum Antialias {
DEFAULT,
NONE,
GRAY,
SUBPIXEL,
FAST,
GOOD,
BEST,
}
export namespace FillRule {
export const $gtype: GObject.GType<FillRule>;
}
enum FillRule {
WINDING,
EVEN_ODD,
}
export namespace LineCap {
export const $gtype: GObject.GType<LineCap>;
}
enum LineCap {
BUTT,
ROUND,
SQUARE,
}
export namespace LineJoin {
export const $gtype: GObject.GType<LineJoin>;
}
enum LineJoin {
MITER,
ROUND,
BEVEL,
}
export namespace TextClusterFlags {
export const $gtype: GObject.GType<TextClusterFlags>;
}
enum TextClusterFlags {
BACKWARD,
}
export namespace FontSlant {
export const $gtype: GObject.GType<FontSlant>;
}
enum FontSlant {
NORMAL,
ITALIC,
OBLIQUE,
}
export namespace FontWeight {
export const $gtype: GObject.GType<FontWeight>;
}
enum FontWeight {
NORMAL,
BOLD,
}
export namespace SubpixelOrder {
export const $gtype: GObject.GType<SubpixelOrder>;
}
enum SubpixelOrder {
DEFAULT,
RGB,
BGR,
VRGB,
VBGR,
}
export namespace HintStyle {
export const $gtype: GObject.GType<HintStyle>;
}
enum HintStyle {
DEFAULT,
NONE,
SLIGHT,
MEDIUM,
FULL,
}
export namespace HintMetrics {
export const $gtype: GObject.GType<HintMetrics>;
}
enum HintMetrics {
DEFAULT,
OFF,
ON,
}
export namespace FontType {
export const $gtype: GObject.GType<FontType>;
}
enum FontType {
TOY,
FT,
WIN32,
QUARTZ,
USER,
}
export namespace PathDataType {
export const $gtype: GObject.GType<PathDataType>;
}
enum PathDataType {
MOVE_TO,
LINE_TO,
CURVE_TO,
CLOSE_PATH,
}
export namespace DeviceType {
export const $gtype: GObject.GType<DeviceType>;
}
enum DeviceType {
DRM,
GL,
SCRIPT,
XCB,
XLIB,
XML,
COGL,
WIN32,
INVALID,
}
export namespace SurfaceType {
export const $gtype: GObject.GType<SurfaceType>;
}
enum SurfaceType {
IMAGE,
PDF,
PS,
XLIB,
XCB,
GLITZ,
QUARTZ,
WIN32,
BEOS,
DIRECTFB,
SVG,
OS2,
WIN32_PRINTING,
QUARTZ_IMAGE,
SCRIPT,
QT,
RECORDING,
VG,
GL,
DRM,
TEE,
XML,
SKIA,
SUBSURFACE,
COGL,
}
export namespace Format {
export const $gtype: GObject.GType<Format>;
}
enum Format {
INVALID,
ARGB32,
RGB24,
A8,
A1,
RGB16_565,
RGB30,
}
export namespace PatternType {
export const $gtype: GObject.GType<PatternType>;
}
enum PatternType {
SOLID,
SURFACE,
LINEAR,
RADIAL,
MESH,
RASTER_SOURCE,
}
export namespace Extend {
export const $gtype: GObject.GType<Extend>;
}
enum Extend {
NONE,
REPEAT,
REFLECT,
PAD,
}
export namespace Filter {
export const $gtype: GObject.GType<Filter>;
}
enum Filter {
FAST,
GOOD,
BEST,
NEAREST,
BILINEAR,
GAUSSIAN,
}
export namespace RegionOverlap {
export const $gtype: GObject.GType<RegionOverlap>;
}
enum RegionOverlap {
IN,
OUT,
PART,
}
function image_surface_create(): void;
class Context {
static $gtype: GObject.GType<Context>;
// Constructors
_init(...args: any[]): void;
}
class Device {
static $gtype: GObject.GType<Device>;
// Constructors
_init(...args: any[]): void;
}
class Surface {
static $gtype: GObject.GType<Surface>;
// Constructors
_init(...args: any[]): void;
}
class Matrix {
static $gtype: GObject.GType<Matrix>;
// Constructors
_init(...args: any[]): void;
}
class Pattern {
static $gtype: GObject.GType<Pattern>;
// Constructors
_init(...args: any[]): void;
}
class Region {
static $gtype: GObject.GType<Region>;
// Constructors
_init(...args: any[]): void;
}
class FontOptions {
static $gtype: GObject.GType<FontOptions>;
// Constructors
_init(...args: any[]): void;
}
class FontFace {
static $gtype: GObject.GType<FontFace>;
// Constructors
_init(...args: any[]): void;
}
class ScaledFont {
static $gtype: GObject.GType<ScaledFont>;
// Constructors
_init(...args: any[]): void;
}
class Path {
static $gtype: GObject.GType<Path>;
// Constructors
_init(...args: any[]): void;
}
class Rectangle {
static $gtype: GObject.GType<Rectangle>;
// Fields
x: number;
y: number;
width: number;
height: number;
// Constructors
constructor(
properties?: Partial<{
x: number;
y: number;
width: number;
height: number;
}>,
);
_init(...args: any[]): void;
}
class RectangleInt {
static $gtype: GObject.GType<RectangleInt>;
// Fields
x: number;
y: number;
width: number;
height: number;
// Constructors
constructor(
properties?: Partial<{
x: number;
y: number;
width: number;
height: number;
}>,
);
_init(...args: any[]): void;
}
class Glyph {
static $gtype: GObject.GType<Glyph>;
// Fields
index: number;
x: number;
y: number;
// Constructors
constructor(
properties?: Partial<{
index: number;
x: number;
y: number;
}>,
);
_init(...args: any[]): void;
}
class TextCluster {
static $gtype: GObject.GType<TextCluster>;
// Fields
num_bytes: number;
num_glyphs: number;
// Constructors
constructor(
properties?: Partial<{
num_bytes: number;
num_glyphs: number;
}>,
);
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default cairo;
}
declare module 'gi://cairo' {
import Cairo10 from 'gi://cairo?version=1.0';
export default Cairo10;
}
// END

View File

@ -1,845 +0,0 @@
declare module 'cairo' {
// Cairo 1.0
import Cairo from 'gi://cairo?version=1.0';
import type GObject from 'gi://GObject?version=2.0';
namespace giCairo {
// Re-export enums directly from Cairo
export import Status = Cairo.Status;
export import Content = Cairo.Content;
export import Operator = Cairo.Operator;
export import Antialias = Cairo.Antialias;
export import FillRule = Cairo.FillRule;
export import LineCap = Cairo.LineCap;
export import LineJoin = Cairo.LineJoin;
export import TextClusterFlags = Cairo.TextClusterFlags;
export import FontSlant = Cairo.FontSlant;
export import FontWeight = Cairo.FontWeight;
export import SubpixelOrder = Cairo.SubpixelOrder;
export import HintStyle = Cairo.HintStyle;
export import HintMetrics = Cairo.HintMetrics;
export import FontType = Cairo.FontType;
export import PathDataType = Cairo.PathDataType;
export import DeviceType = Cairo.DeviceType;
export import SurfaceType = Cairo.SurfaceType;
export import Format = Cairo.Format;
export import PatternType = Cairo.PatternType;
export import Extend = Cairo.Extend;
export import Filter = Cairo.Filter;
export import RegionOverlap = Cairo.RegionOverlap;
/**
* Describes the metrics of a string of text
*/
export interface TextExtents {
/** The horizontal distance from the origin to the leftmost part of the text */
xBearing: number;
/** The vertical distance from the origin to the topmost part of the text */
yBearing: number;
/** The width of the text */
width: number;
/** The height of the text */
height: number;
/** The distance to advance horizontally after drawing the text */
xAdvance: number;
/** The distance to advance vertically after drawing the text */
yAdvance: number;
}
/**
* The main Cairo drawing context
*
* A Cairo context is used to draw to surfaces and perform drawing operations.
* When you're done with a context, you must call $dispose() to free memory.
*/
export class Context extends Cairo.Context {
/**
* Creates a new Cairo context for drawing to the given surface
* @param surface The surface to draw on
*/
constructor(surface: Surface);
/**
* Free a Cairo.Context and all associated memory
*
* Unlike other objects in GJS, Cairo contexts must be explicitly disposed
* to avoid memory leaks.
*/
$dispose(): void;
/**
* Adds a circular arc of the given radius to the current path
* @param xc X coordinate of the center of the arc
* @param yc Y coordinate of the center of the arc
* @param radius Radius of the arc
* @param angle1 Starting angle in radians
* @param angle2 End angle in radians
*/
arc(xc: number, yc: number, radius: number, angle1: number, angle2: number): void;
/**
* Adds a circular arc of the given radius to the current path, but draws
* the arc in the opposite direction from arc()
* @param xc X coordinate of the center of the arc
* @param yc Y coordinate of the center of the arc
* @param radius Radius of the arc
* @param angle1 Starting angle in radians
* @param angle2 End angle in radians
*/
arcNegative(xc: number, yc: number, radius: number, angle1: number, angle2: number): void;
/**
* Adds a cubic Bézier spline to the current path
* @param x1 X coordinate of the first control point
* @param y1 Y coordinate of the first control point
* @param x2 X coordinate of the second control point
* @param y2 Y coordinate of the second control point
* @param x3 X coordinate of the end point
* @param y3 Y coordinate of the end point
*/
curveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number): void;
/**
* Establishes a new clip region by intersecting the current clip region
* with the current path, then clearing the current path
*/
clip(): void;
/**
* Like clip() but preserves the current path
*/
clipPreserve(): void;
/**
* Returns the current clip extents as [x1, y1, x2, y2]
* @returns An array with [x1, y1, x2, y2] clip extents
*/
clipExtents(): [number, number, number, number];
/**
* Closes the current path by drawing a line to the beginning of the current subpath
*/
closePath(): void;
/**
* Emits the current page, but doesn't clear it
*/
copyPage(): void;
/**
* Transforms a coordinate from device space to user space
* @param x X coordinate
* @param y Y coordinate
* @returns An array with [x, y] transformed coordinates
*/
deviceToUser(x: number, y: number): [number, number];
/**
* Transforms a distance vector from device space to user space
* @param x X component of the distance vector
* @param y Y component of the distance vector
* @returns An array with [x, y] transformed distance vector
*/
deviceToUserDistance(x: number, y: number): [number, number];
/**
* Fills the current path using the current fill rule, then clears the path
*/
fill(): void;
/**
* Fills the current path using the current fill rule, but doesn't clear the path
*/
fillPreserve(): void;
/**
* Returns the current fill extents as [x1, y1, x2, y2]
* @returns An array with [x1, y1, x2, y2] fill extents
*/
fillExtents(): [number, number, number, number];
/**
* Gets the current antialiasing mode
* @returns The current antialiasing mode
*/
getAntialias(): Antialias;
/**
* Gets the current point of the current path
* @returns An array with [x, y] coordinates of the current point
*/
getCurrentPoint(): [number, number];
/**
* Gets the current dash count
* @returns The number of elements in the current dash pattern
*/
getDashCount(): number;
/**
* Gets the current fill rule
* @returns The current fill rule
*/
getFillRule(): FillRule;
/**
* Gets the current line cap style
* @returns The current line cap style
*/
getLineCap(): LineCap;
/**
* Gets the current line join style
* @returns The current line join style
*/
getLineJoin(): LineJoin;
/**
* Gets the current line width
* @returns The current line width
*/
getLineWidth(): number;
/**
* Gets the current miter limit
* @returns The current miter limit
*/
getMiterLimit(): number;
/**
* Gets the current compositing operator
* @returns The current compositing operator
*/
getOperator(): Operator;
/**
* Gets the current source pattern
* @returns The current source pattern
*/
getSource(): Pattern;
/**
* Gets the surface the Cairo context is drawing on
* @returns The target surface
*/
getTarget(): Surface;
/**
* Gets the current tolerance value
* @returns The current tolerance value
*/
getTolerance(): number;
/**
* Checks if there is a current point defined
* @returns True if there is a current point
*/
hasCurrentPoint(): boolean;
/**
* Resets the current transformation matrix to the identity matrix
*/
identityMatrix(): void;
/**
* Tests whether the given point is inside the area filled by the current path
* @param x X coordinate of the point to test
* @param y Y coordinate of the point to test
* @returns True if the point is inside the path
*/
inFill(x: number, y: number): boolean;
/**
* Tests whether the given point is inside the area that would be inked
* by the current path with the current line width and stroke parameters
* @param x X coordinate of the point to test
* @param y Y coordinate of the point to test
* @returns True if the point would be inked
*/
inStroke(x: number, y: number): boolean;
/**
* Adds a line to the current path from the current point to the given point
* @param x X coordinate of the end point
* @param y Y coordinate of the end point
*/
lineTo(x: number, y: number): void;
/**
* Sets the current mask pattern used for painting operations
* @param pattern A pattern to use as mask
*/
mask(pattern: Pattern): void;
/**
* Sets the current mask to a surface
* @param surface A surface to use as mask
* @param x X coordinate at which to place the origin of the surface
* @param y Y coordinate at which to place the origin of the surface
*/
maskSurface(surface: Surface, x: number, y: number): void;
/**
* Begins a new subpath at the given point
* @param x X coordinate of the new position
* @param y Y coordinate of the new position
*/
moveTo(x: number, y: number): void;
/**
* Clears the current path and begins a new path
*/
newPath(): void;
/**
* Begins a new subpath without changing the current point
*/
newSubPath(): void;
/**
* Paints the current source everywhere within the current clip region
*/
paint(): void;
/**
* Paints the current source everywhere within the current clip region
* using the given alpha value
* @param alpha Alpha value to use, between 0 and 1
*/
paintWithAlpha(alpha: number): void;
/**
* Returns the current path extents as [x1, y1, x2, y2]
* @returns An array with [x1, y1, x2, y2] path extents
*/
pathExtents(): [number, number, number, number];
/**
* Terminates the current pattern group and returns a new pattern
* representing everything drawn to the group
* @returns A new pattern representing the group
*/
popGroup(): Pattern;
/**
* Terminates the current pattern group and makes it the current source pattern
*/
popGroupToSource(): void;
/**
* Temporarily redirects drawing to an intermediate surface
*/
pushGroup(): void;
/**
* Temporarily redirects drawing to an intermediate surface with the given content
* @param content The content type for the group
*/
pushGroupWithContent(content: Content): void;
/**
* Adds a rectangle to the current path
* @param x X coordinate of the top-left corner
* @param y Y coordinate of the top-left corner
* @param width Width of the rectangle
* @param height Height of the rectangle
*/
rectangle(x: number, y: number, width: number, height: number): void;
/**
* Adds a cubic Bézier spline to the current path using relative coordinates
* @param dx1 X offset to the first control point from current point
* @param dy1 Y offset to the first control point from current point
* @param dx2 X offset to the second control point from current point
* @param dy2 Y offset to the second control point from current point
* @param dx3 X offset to the end point from current point
* @param dy3 Y offset to the end point from current point
*/
relCurveTo(dx1: number, dy1: number, dx2: number, dy2: number, dx3: number, dy3: number): void;
/**
* Adds a line to the current path relative to the current point
* @param dx X offset from the current point
* @param dy Y offset from the current point
*/
relLineTo(dx: number, dy: number): void;
/**
* Begins a new subpath relative to the current point
* @param dx X offset from the current point
* @param dy Y offset from the current point
*/
relMoveTo(dx: number, dy: number): void;
/**
* Resets the current clip region to its original, unrestricted state
*/
resetClip(): void;
/**
* Restores the context state from the stack
*/
restore(): void;
/**
* Rotates the current transformation matrix
* @param angle Angle of rotation in radians
*/
rotate(angle: number): void;
/**
* Saves the current context state to the stack
*/
save(): void;
/**
* Scales the current transformation matrix
* @param sx Scale factor for the X dimension
* @param sy Scale factor for the Y dimension
*/
scale(sx: number, sy: number): void;
/**
* Selects a font face
* @param family A font family name
* @param slant A font slant
* @param weight A font weight
*/
selectFontFace(family: string, slant: number, weight: number): void;
/**
* Sets the antialiasing mode
* @param antialias The new antialiasing mode
*/
setAntialias(antialias: Antialias): void;
/**
* Sets the dash pattern to be used by stroke()
* @param dashes Array of dash lengths
* @param offset Offset into the dash pattern
*/
setDash(dashes: number[], offset: number): void;
/**
* Sets the current font size in user space units
* @param size Font size in user space units
*/
setFontSize(size: number): void;
/**
* Sets the current fill rule
* @param fillRule The new fill rule
*/
setFillRule(fillRule: FillRule): void;
/**
* Sets the current line cap style
* @param lineCap The new line cap style
*/
setLineCap(lineCap: LineCap): void;
/**
* Sets the current line join style
* @param lineJoin The new line join style
*/
setLineJoin(lineJoin: LineJoin): void;
/**
* Sets the current line width
* @param width The new line width
*/
setLineWidth(width: number): void;
/**
* Sets the current miter limit
* @param limit The new miter limit
*/
setMiterLimit(limit: number): void;
/**
* Sets the current compositing operator
* @param op The new compositing operator
*/
setOperator(op: Operator): void;
/**
* Sets the current source pattern
* @param pattern The new source pattern
*/
setSource(pattern: Pattern): void;
/**
* Sets the source pattern to an RGB opaque color
* @param red Red component, between 0 and 1
* @param green Green component, between 0 and 1
* @param blue Blue component, between 0 and 1
*/
setSourceRGB(red: number, green: number, blue: number): void;
/**
* Sets the source pattern to an RGBA color
* @param red Red component, between 0 and 1
* @param green Green component, between 0 and 1
* @param blue Blue component, between 0 and 1
* @param alpha Alpha component, between 0 and 1
*/
setSourceRGBA(red: number, green: number, blue: number, alpha: number): void;
/**
* Sets the source pattern to the given surface
* @param surface The new source surface
* @param x X coordinate where to place the surface origin
* @param y Y coordinate where to place the surface origin
*/
setSourceSurface(surface: Surface, x: number, y: number): void;
/**
* Sets the tolerance used when converting paths to trapezoids
* @param tolerance The new tolerance value
*/
setTolerance(tolerance: number): void;
/**
* Emits the current page and clears it
*/
showPage(): void;
/**
* Draws text at the current position
* @param utf8 A string of text encoded in UTF-8
*/
showText(utf8: string): void;
/**
* Strokes the current path using the current line width, line join,
* line cap, and dash settings, then clears the path
*/
stroke(): void;
/**
* Like stroke() but preserves the current path
*/
strokePreserve(): void;
/**
* Returns the current stroke extents as [x1, y1, x2, y2]
* @returns An array with [x1, y1, x2, y2] stroke extents
*/
strokeExtents(): [number, number, number, number];
/**
* Gets the extents of the given text if it were drawn at the current point
* @param utf8 A string of text encoded in UTF-8
* @returns Text extents information
*/
textExtents(utf8: string): TextExtents;
/**
* Translates the current transformation matrix
* @param tx Translation in the X direction
* @param ty Translation in the Y direction
*/
translate(tx: number, ty: number): void;
/**
* Transforms a coordinate from user space to device space
* @param x X coordinate
* @param y Y coordinate
* @returns An array with [x, y] transformed coordinates
*/
userToDevice(x: number, y: number): [number, number];
/**
* Transforms a distance vector from user space to device space
* @param x X component of the distance vector
* @param y Y component of the distance vector
* @returns An array with [x, y] transformed distance vector
*/
userToDeviceDistance(x: number, y: number): [number, number];
/**
* Creates a copy of the current path and returns it
* @returns A copy of the current path
*/
copyPath(): Path;
/**
* Appends a path to the current path
* @param path A path to append
*/
appendPath(path: Path): void;
}
/**
* Base class for all Cairo surfaces
*/
export abstract class Surface extends Cairo.Surface {
/**
* Gets the device scale of the surface
* @returns An array with [x, y] device scale
*/
getDeviceScale(): [number, number];
/**
* Sets the device scale of the surface
* @param x X scale factor
* @param y Y scale factor
*/
setDeviceScale(x: number, y: number): void;
/**
* Gets the device offset of the surface
* @returns An array with [x, y] device offset
*/
getDeviceOffset(): [number, number];
/**
* Sets the device offset of the surface
* @param x X offset
* @param y Y offset
*/
setDeviceOffset(x: number, y: number): void;
/**
* Performs all pending drawing operations
*/
flush(): void;
/**
* Finishes the surface and drops all references to external resources
*/
finish(): void;
}
/**
* A surface that uses in-memory image data buffers
*/
export class ImageSurface extends Surface {
/**
* Creates a new image surface
* @param format The format of pixels in the surface
* @param width Width of the surface in pixels
* @param height Height of the surface in pixels
*/
constructor(format: Format, width: number, height: number);
/**
* Creates a new image surface from a PNG file
* @param filename Path to a PNG file
* @returns A new image surface
*/
static createFromPNG(filename: string): ImageSurface;
/**
* Gets the format of the surface
* @returns The format of the surface
*/
getFormat(): Format;
/**
* Gets the width of the surface in pixels
* @returns The width of the surface
*/
getWidth(): number;
/**
* Gets the height of the surface in pixels
* @returns The height of the surface
*/
getHeight(): number;
/**
* Writes the contents of the surface to a PNG file
* @param filename Path to the PNG file to write
*/
writeToPNG(filename: string): void;
}
/**
* A surface that produces output in the PDF format
*/
export class PDFSurface extends Surface {
/**
* Creates a new PDF surface
* @param filename Path to the PDF file to write to
* @param width Width of the surface in points (1 point = 1/72 inch)
* @param height Height of the surface in points (1 point = 1/72 inch)
*/
constructor(filename: string, width: number, height: number);
}
/**
* A surface that produces output in the PostScript format
*/
export class PSSurface extends Surface {
/**
* Creates a new PostScript surface
* @param filename Path to the PostScript file to write to
* @param width Width of the surface in points (1 point = 1/72 inch)
* @param height Height of the surface in points (1 point = 1/72 inch)
*/
constructor(filename: string, width: number, height: number);
}
/**
* A surface that produces output in the SVG format
*/
export class SVGSurface extends Surface {
/**
* Creates a new SVG surface
* @param filename Path to the SVG file to write to
* @param width Width of the surface in points (1 point = 1/72 inch)
* @param height Height of the surface in points (1 point = 1/72 inch)
*/
constructor(filename: string, width: number, height: number);
}
/**
* Base class for all Cairo patterns
*/
export class Pattern extends Cairo.Pattern {}
/**
* Base class for all gradient patterns
*/
export class Gradient extends Pattern {
/**
* Adds a color stop to the gradient at the given offset
* @param offset Offset position of the stop, between 0 and 1
* @param red Red component, between 0 and 1
* @param green Green component, between 0 and 1
* @param blue Blue component, between 0 and 1
* @param alpha Alpha component, between 0 and 1
*/
addColorStopRGBA(offset: number, red: number, green: number, blue: number, alpha: number): void;
/**
* Adds an opaque color stop to the gradient at the given offset
* @param offset Offset position of the stop, between 0 and 1
* @param red Red component, between 0 and 1
* @param green Green component, between 0 and 1
* @param blue Blue component, between 0 and 1
*/
addColorStopRGB(offset: number, red: number, green: number, blue: number): void;
}
/**
* A pattern for linear gradients
*/
export class LinearGradient extends Gradient {
/**
* Creates a new linear gradient pattern
* @param x0 X coordinate of the start point
* @param y0 Y coordinate of the start point
* @param x1 X coordinate of the end point
* @param y1 Y coordinate of the end point
*/
constructor(x0: number, y0: number, x1: number, y1: number);
}
/**
* A pattern for radial gradients
*/
export class RadialGradient extends Gradient {
/**
* Creates a new radial gradient pattern
* @param cx0 X coordinate of the start circle
* @param cy0 Y coordinate of the start circle
* @param radius0 Radius of the start circle
* @param cx1 X coordinate of the end circle
* @param cy1 Y coordinate of the end circle
* @param radius1 Radius of the end circle
*/
constructor(cx0: number, cy0: number, radius0: number, cx1: number, cy1: number, radius1: number);
}
/**
* A pattern that uses a surface as its source
*/
export class SurfacePattern extends Pattern {
/**
* Creates a new pattern for the given surface
* @param surface The surface to use
*/
constructor(surface: Surface);
}
/**
* A pattern for solid colors
*/
export class SolidPattern extends Pattern {
/**
* Creates a new solid pattern with an opaque color
* @param red Red component, between 0 and 1
* @param green Green component, between 0 and 1
* @param blue Blue component, between 0 and 1
* @returns A new solid pattern
*/
static createRGB(red: number, green: number, blue: number): SolidPattern;
/**
* Creates a new solid pattern with a transparent color
* @param red Red component, between 0 and 1
* @param green Green component, between 0 and 1
* @param blue Blue component, between 0 and 1
* @param alpha Alpha component, between 0 and 1
* @returns A new solid pattern
*/
static createRGBA(red: number, green: number, blue: number, alpha: number): SolidPattern;
}
export class Path extends Cairo.Path {}
/**
* A rectangle
*/
export class Rectangle extends Cairo.Rectangle {}
/**
* A rectangle integer
*/
export class RectangleInt extends Cairo.RectangleInt {}
/**
* A region object used for representing a set of pixels
*/
export class Region extends Cairo.Region {}
/**
* A matrix object used for transforming coordinates
*/
export class Matrix extends Cairo.Matrix {}
/**
* A font face object used for storing and manipulating font faces
*/
export class FontFace extends Cairo.FontFace {}
/**
* A scaled font object used for storing and manipulating scaled fonts
*/
export class ScaledFont extends Cairo.ScaledFont {}
/**
* A glyph object used for storing and manipulating glyphs
*/
export class Glyph extends Cairo.Glyph {}
/**
* A text cluster object used for storing and manipulating text clusters
*/
export class TextCluster extends Cairo.TextCluster {}
/**
* A font options object used for storing and manipulating font options
*/
export class FontOptions extends Cairo.FontOptions {}
/**
* A device object used for storing and manipulating devices
*/
export class Device extends Cairo.Device {}
}
export default giCairo;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,135 +0,0 @@
/// <reference path="./gdk-3.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./cairo.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./gdkpixbuf-2.0.d.ts" />
/// <reference path="./clutter-1.0.d.ts" />
/// <reference path="./json-1.0.d.ts" />
/// <reference path="./gl-1.0.d.ts" />
/// <reference path="./coglpango-1.0.d.ts" />
/// <reference path="./pangocairo-1.0.d.ts" />
/// <reference path="./cogl-1.0.d.ts" />
/// <reference path="./atk-1.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://ClutterGdk?version=1.0' {
// Module dependencies
import type Gdk from 'gi://Gdk?version=3.0';
import type cairo from 'cairo';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type Clutter from 'gi://Clutter?version=1.0';
import type Json from 'gi://Json?version=1.0';
import type GL from 'gi://GL?version=1.0';
import type CoglPango from 'gi://CoglPango?version=1.0';
import type PangoCairo from 'gi://PangoCairo?version=1.0';
import type Cogl from 'gi://Cogl?version=1.0';
import type Atk from 'gi://Atk?version=1.0';
export namespace ClutterGdk {
/**
* ClutterGdk-1.0
*/
/**
* Disable the event retrieval in Clutter.
*
* Callers of this function have to set up an event filter using the
* GDK API, and call clutter_gdk_handle_event().
*
* This function should only be used when embedding Clutter into
* a GDK based toolkit.
*/
function disable_event_retrieval(): void;
/**
* Retrieves the pointer to the default display.
* @returns the default display
*/
function get_default_display(): Gdk.Display;
/**
* Gets the stage for a particular X window.
* @param window a #GtkWindow
* @returns A #ClutterStage, or% NULL if a stage does not exist for the window
*/
function get_stage_from_window(window: Gdk.Window): Clutter.Stage;
/**
* Gets the stages GdkWindow.
* @param stage a #ClutterStage
* @returns A GdkWindow* for the stage window.
*/
function get_stage_window(stage: Clutter.Stage): Gdk.Window;
/**
* Retrieves the #GdkVisual used by Clutter.
*
* This function should be used when embedding Clutter inside GDK-based
* foreign toolkits, to ensure that the visual applied to the #GdkWindow
* used to render the #ClutterStage is the correct one.
* @returns a #GdkVisual instance
*/
function get_visual(): Gdk.Visual;
/**
* This function processes a single GDK event; it can be used to hook
* into external event processing
* @param event a #GdkEvent
* @returns #GdkFilterReturn. %GDK_FILTER_REMOVE indicates that Clutter has internally handled the event and the caller should do no further processing. %GDK_FILTER_CONTINUE indicates that Clutter is either not interested in the event, or has used the event to update internal state without taking any exclusive action. %GDK_FILTER_TRANSLATE will not occur.
*/
function handle_event(event: Gdk.Event): Gdk.FilterReturn;
/**
* Sets the display connection Clutter should use; must be called
* before clutter_init(), clutter_init_with_args() or other functions
* pertaining Clutter's initialization process.
*
* If you are parsing the command line arguments by retrieving Clutter's
* #GOptionGroup with clutter_get_option_group() and calling
* g_option_context_parse() yourself, you should also call
* clutter_gdk_set_display() before g_option_context_parse().
* @param display pointer to a GDK display connection.
*/
function set_display(display: Gdk.Display): void;
/**
* Target the #ClutterStage to use an existing external #GdkWindow
* @param stage a #ClutterStage
* @param window an existing #GdkWindow
* @returns %TRUE if foreign window is valid
*/
function set_stage_foreign(stage: Clutter.Stage, window: Gdk.Window): boolean;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default ClutterGdk;
}
declare module 'gi://ClutterGdk' {
import ClutterGdk10 from 'gi://ClutterGdk?version=1.0';
export default ClutterGdk10;
}
// END

File diff suppressed because it is too large Load Diff

View File

@ -1,899 +0,0 @@
/// <reference path="./xlib-2.0.d.ts" />
/// <reference path="./clutter-1.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./cairo.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./json-1.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./gl-1.0.d.ts" />
/// <reference path="./coglpango-1.0.d.ts" />
/// <reference path="./pangocairo-1.0.d.ts" />
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/// <reference path="./cogl-1.0.d.ts" />
/// <reference path="./atk-1.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://ClutterX11?version=1.0' {
// Module dependencies
import type xlib from 'gi://xlib?version=2.0';
import type Clutter from 'gi://Clutter?version=1.0';
import type cairo from 'cairo';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type Json from 'gi://Json?version=1.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GL from 'gi://GL?version=1.0';
import type CoglPango from 'gi://CoglPango?version=1.0';
import type PangoCairo from 'gi://PangoCairo?version=1.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Cogl from 'gi://Cogl?version=1.0';
import type Atk from 'gi://Atk?version=1.0';
export namespace ClutterX11 {
/**
* ClutterX11-1.0
*/
/**
* Return values for the #ClutterX11FilterFunc function.
*/
/**
* Return values for the #ClutterX11FilterFunc function.
*/
export namespace FilterReturn {
export const $gtype: GObject.GType<FilterReturn>;
}
enum FilterReturn {
/**
* The event was not handled, continues the
* processing
*/
CONTINUE,
/**
* Native event translated into a Clutter
* event, stops the processing
*/
TRANSLATE,
/**
* Remove the event, stops the processing
*/
REMOVE,
}
/**
* Disables the internal polling of X11 events in the main loop.
*
* Libraries or applications calling this function will be responsible of
* polling all X11 events.
*
* You also must call clutter_x11_handle_event() to let Clutter process
* events and maintain its internal state.
*
* This function can only be called before calling clutter_init().
*
* Even with event handling disabled, Clutter will still select
* all the events required to maintain its internal state on the stage
* Window; compositors using Clutter and input regions to pass events
* through to application windows should not rely on an empty input
* region, and should instead clear it themselves explicitly using the
* XFixes extension.
*
* This function should not be normally used by applications.
*/
function disable_event_retrieval(): void;
/**
* Enables the use of the XInput extension if present on connected
* XServer and support built into Clutter. XInput allows for multiple
* pointing devices to be used.
*
* This function must be called before clutter_init().
*
* Since XInput might not be supported by the X server, you might
* want to use clutter_x11_has_xinput() to see if support was enabled.
*/
function enable_xinput(): void;
/**
* Retrieves the group for the modifiers set in `event`
* @param event a #ClutterEvent of type %CLUTTER_KEY_PRESS or %CLUTTER_KEY_RELEASE
* @returns the group id
*/
function event_get_key_group(event: Clutter.Event): number;
/**
* Retrieves the touch detail froma #ClutterEventSequence.
* @param sequence a #ClutterEventSequence
* @returns the touch detail
*/
function event_sequence_get_touch_detail(sequence: Clutter.EventSequence): number;
/**
* Retrieves the pointer to the default display.
* @returns the default display
*/
function get_default_display(): xlib.Display;
/**
* Gets the number of the default X Screen object.
* @returns the number of the default screen
*/
function get_default_screen(): number;
/**
* Retrieves a pointer to the list of input devices
* @returns a pointer to the internal list of input devices; the returned list is owned by Clutter and should not be modified or freed
*/
function get_input_devices(): Clutter.InputDevice[];
/**
* Gets the stage for a particular X window.
* @param win an X Window ID
* @returns A #ClutterStage, or% NULL if a stage does not exist for the window
*/
function get_stage_from_window(win: xlib.Window): Clutter.Stage;
/**
* Retrieves whether the Clutter X11 backend is using ARGB visuals by default
* @returns %TRUE if ARGB visuals are queried by default
*/
function get_use_argb_visual(): boolean;
/**
* Retrieves whether the Clutter X11 backend will create stereo
* stages if possible.
* @returns %TRUE if stereo stages are used if possible
*/
function get_use_stereo_stage(): boolean;
/**
* This function processes a single X event; it can be used to hook
* into external X11 event processing (for example, a GDK filter
* function).
*
* If clutter_x11_disable_event_retrieval() has been called, you must
* let this function process events to update Clutter's internal state.
* @param xevent pointer to XEvent structure
* @returns #ClutterX11FilterReturn. %CLUTTER_X11_FILTER_REMOVE indicates that Clutter has internally handled the event and the caller should do no further processing. %CLUTTER_X11_FILTER_CONTINUE indicates that Clutter is either not interested in the event, or has used the event to update internal state without taking any exclusive action. %CLUTTER_X11_FILTER_TRANSLATE will not occur.
*/
function handle_event(xevent: xlib.XEvent): FilterReturn;
/**
* Retrieves whether Clutter is running on an X11 server with the
* XComposite extension
* @returns %TRUE if the XComposite extension is available
*/
function has_composite_extension(): boolean;
/**
* Queries the X11 backend to check if event collection has been disabled.
* @returns TRUE if event retrival has been disabled. FALSE otherwise.
*/
function has_event_retrieval(): boolean;
/**
* Gets whether Clutter has XInput support.
* @returns %TRUE if Clutter was compiled with XInput support and XInput support is available at run time.
*/
function has_xinput(): boolean;
/**
* Sets the display connection Clutter should use; must be called
* before clutter_init(), clutter_init_with_args() or other functions
* pertaining Clutter's initialization process.
*
* If you are parsing the command line arguments by retrieving Clutter's
* #GOptionGroup with clutter_get_option_group() and calling
* g_option_context_parse() yourself, you should also call
* clutter_x11_set_display() before g_option_context_parse().
* @param xdpy pointer to a X display connection.
*/
function set_display(xdpy: xlib.Display): void;
/**
* Target the #ClutterStage to use an existing external X Window
* @param stage a #ClutterStage
* @param xwindow an existing X Window id
* @returns %TRUE if foreign window is valid
*/
function set_stage_foreign(stage: Clutter.Stage, xwindow: xlib.Window): boolean;
/**
* Sets whether the Clutter X11 backend should request ARGB visuals by default
* or not.
*
* By default, Clutter requests RGB visuals.
*
* If no ARGB visuals are found, the X11 backend will fall back to
* requesting a RGB visual instead.
*
* ARGB visuals are required for the #ClutterStage:use-alpha property to work.
*
* This function can only be called once, and before clutter_init() is
* called.
* @param use_argb %TRUE if ARGB visuals should be requested by default
*/
function set_use_argb_visual(use_argb: boolean): void;
/**
* Sets whether the backend object for Clutter stages, will,
* if possible, be created with the ability to support stereo drawing
* (drawing separate images for the left and right eyes).
*
* This function must be called before clutter_init() is called.
* During paint callbacks, cogl_framebuffer_is_stereo() can be called
* on the framebuffer retrieved by cogl_get_draw_framebuffer() to
* determine if stereo support was successfully enabled, and
* cogl_framebuffer_set_stereo_mode() to determine which buffers
* will be drawn to.
*
* Note that this function *does not* cause the stage to be drawn
* multiple times with different perspective transformations and thus
* appear in 3D, it simply enables individual ClutterActors to paint
* different images for the left and and right eye.
* @param use_stereo %TRUE if the stereo stages should be used if possible.
*/
function set_use_stereo_stage(use_stereo: boolean): void;
/**
* Traps every X error until clutter_x11_untrap_x_errors() is called.
*/
function trap_x_errors(): void;
/**
* Removes the X error trap and returns the current status.
* @returns the trapped error code, or 0 for success
*/
function untrap_x_errors(): number;
interface FilterFunc {
(xev: xlib.XEvent, cev: Clutter.Event): FilterReturn;
}
namespace TexturePixmap {
// Signal callback interfaces
interface QueueDamageRedraw {
(x: number, y: number, width: number, height: number): void;
}
interface UpdateArea {
(x: number, y: number, width: number, height: number): void;
}
// Constructor properties interface
interface ConstructorProps
extends Clutter.Texture.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Clutter.Animatable.ConstructorProps,
Clutter.Container.ConstructorProps,
Clutter.Scriptable.ConstructorProps {
automatic_updates: boolean;
automaticUpdates: boolean;
destroyed: boolean;
pixmap: number;
pixmap_depth: number;
pixmapDepth: number;
pixmap_height: number;
pixmapHeight: number;
pixmap_width: number;
pixmapWidth: number;
window: number;
window_mapped: boolean;
windowMapped: boolean;
window_override_redirect: boolean;
windowOverrideRedirect: boolean;
window_redirect_automatic: boolean;
windowRedirectAutomatic: boolean;
window_x: number;
windowX: number;
window_y: number;
windowY: number;
}
}
/**
* The #ClutterX11TexturePixmap structure contains only private data
*/
class TexturePixmap
extends Clutter.Texture
implements Atk.ImplementorIface, Clutter.Animatable, Clutter.Container, Clutter.Scriptable
{
static $gtype: GObject.GType<TexturePixmap>;
// Properties
get automatic_updates(): boolean;
set automatic_updates(val: boolean);
get automaticUpdates(): boolean;
set automaticUpdates(val: boolean);
get destroyed(): boolean;
get pixmap(): number;
set pixmap(val: number);
get pixmap_depth(): number;
get pixmapDepth(): number;
get pixmap_height(): number;
get pixmapHeight(): number;
get pixmap_width(): number;
get pixmapWidth(): number;
get window(): number;
set window(val: number);
get window_mapped(): boolean;
get windowMapped(): boolean;
get window_override_redirect(): boolean;
get windowOverrideRedirect(): boolean;
get window_redirect_automatic(): boolean;
set window_redirect_automatic(val: boolean);
get windowRedirectAutomatic(): boolean;
set windowRedirectAutomatic(val: boolean);
get window_x(): number;
get windowX(): number;
get window_y(): number;
get windowY(): number;
// Constructors
constructor(properties?: Partial<TexturePixmap.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): TexturePixmap;
static new_with_pixmap(pixmap: xlib.Pixmap): TexturePixmap;
static new_with_window(window: xlib.Window): TexturePixmap;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(
signal: 'queue-damage-redraw',
callback: (_source: this, x: number, y: number, width: number, height: number) => void,
): number;
connect_after(
signal: 'queue-damage-redraw',
callback: (_source: this, x: number, y: number, width: number, height: number) => void,
): number;
emit(signal: 'queue-damage-redraw', x: number, y: number, width: number, height: number): void;
connect(
signal: 'update-area',
callback: (_source: this, x: number, y: number, width: number, height: number) => void,
): number;
connect_after(
signal: 'update-area',
callback: (_source: this, x: number, y: number, width: number, height: number) => void,
): number;
emit(signal: 'update-area', x: number, y: number, width: number, height: number): void;
// Virtual methods
/**
* Performs the actual binding of texture to the current content of
* the pixmap. Can be called to update the texture if the pixmap
* content has changed.
* @param x the X coordinate of the area to update
* @param y the Y coordinate of the area to update
* @param width the width of the area to update
* @param height the height of the area to update
*/
vfunc_update_area(x: number, y: number, width: number, height: number): void;
// Methods
/**
* Enables or disables the automatic updates ot `texture` in case the backing
* pixmap or window is damaged
* @param setting %TRUE to enable automatic updates
*/
set_automatic(setting: boolean): void;
/**
* Sets the X Pixmap to which the texture should be bound.
* @param pixmap the X Pixmap to which the texture should be bound
*/
set_pixmap(pixmap: xlib.Pixmap): void;
/**
* Sets up a suitable pixmap for the window, using the composite and damage
* extensions if possible, and then calls
* clutter_x11_texture_pixmap_set_pixmap().
*
* If you want to display a window in a #ClutterTexture, you probably want
* this function, or its older sister, clutter_glx_texture_pixmap_set_window().
*
* This function has no effect unless the XComposite extension is available.
* @param window the X window to which the texture should be bound
* @param automatic %TRUE for automatic window updates, %FALSE for manual.
*/
set_window(window: xlib.Window, automatic: boolean): void;
/**
* Resets the texture's pixmap from its window, perhaps in response to the
* pixmap's invalidation as the window changed size.
*/
sync_window(): void;
/**
* Performs the actual binding of texture to the current content of
* the pixmap. Can be called to update the texture if the pixmap
* content has changed.
* @param x the X coordinate of the area to update
* @param y the Y coordinate of the area to update
* @param width the width of the area to update
* @param height the height of the area to update
*/
update_area(x: number, y: number, width: number, height: number): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
type TexturePixmapClass = typeof TexturePixmap;
abstract class TexturePixmapPrivate {
static $gtype: GObject.GType<TexturePixmapPrivate>;
// Constructors
_init(...args: any[]): void;
}
abstract class XInputDevice {
static $gtype: GObject.GType<XInputDevice>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default ClutterX11;
}
declare module 'gi://ClutterX11' {
import ClutterX1110 from 'gi://ClutterX11?version=1.0';
export default ClutterX1110;
}
// END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,175 +0,0 @@
/// <reference path="./pangocairo-1.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./cairo.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./cogl-1.0.d.ts" />
/// <reference path="./gl-1.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://CoglPango?version=1.0' {
// Module dependencies
import type PangoCairo from 'gi://PangoCairo?version=1.0';
import type cairo from 'cairo';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type Cogl from 'gi://Cogl?version=1.0';
import type GL from 'gi://GL?version=1.0';
export namespace CoglPango {
/**
* CoglPango-1.0
*/
/**
* This updates any internal glyph cache textures as necessary to be
* able to render the given `layout`.
*
* This api should be used to avoid mid-scene modifications of
* glyph-cache textures which can lead to undefined rendering results.
* @param layout A #PangoLayout
*/
function ensure_glyph_cache_for_layout(layout: Pango.Layout): void;
/**
* Clears the glyph cache for `font_map`.
* @param font_map a #CoglPangoFontMap
*/
function font_map_clear_glyph_cache(font_map: FontMap): void;
/**
* Create a #PangoContext for the given `font_map`.
* @param font_map a #CoglPangoFontMap
* @returns the newly created context: free with g_object_unref().
*/
function font_map_create_context(font_map: FontMap): Pango.Context;
/**
* Retrieves the #CoglPangoRenderer for the passed `font_map`.
* @param font_map a #CoglPangoFontMap
* @returns a #PangoRenderer
*/
function font_map_get_renderer(font_map: FontMap): Pango.Renderer;
/**
* Retrieves whether the #CoglPangoRenderer used by `font_map` will use
* mipmapping when rendering the glyphs.
* @param font_map a #CoglPangoFontMap
* @returns %TRUE if mipmapping is used, %FALSE otherwise.
*/
function font_map_get_use_mipmapping(font_map: FontMap): Cogl.Bool;
/**
* Creates a new font map.
* @returns the newly created #PangoFontMap
*/
function font_map_new(): Pango.FontMap;
/**
* Sets the resolution for the `font_map`. This is a scale factor
* between points specified in a #PangoFontDescription and Cogl units.
* The default value is %96, meaning that a 10 point font will be 13
* units high. (10 * 96. / 72. = 13.3).
* @param font_map a #CoglPangoFontMap
* @param dpi The resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.)
*/
function font_map_set_resolution(font_map: FontMap, dpi: number): void;
/**
* Sets whether the renderer for the passed font map should use
* mipmapping when rendering a #PangoLayout.
* @param font_map a #CoglPangoFontMap
* @param value %TRUE to enable the use of mipmapping
*/
function font_map_set_use_mipmapping(font_map: FontMap, value: Cogl.Bool): void;
/**
* Draws a solidly coloured `layout` on the given `framebuffer` at (`x,`
* `y)` within the `framebuffer<`!-- -->'s current model-view coordinate
* space.
* @param layout a #PangoLayout
* @param x X coordinate to render the layout at
* @param y Y coordinate to render the layout at
* @param color color to use when rendering the layout
* @param flags
*/
function render_layout(layout: Pango.Layout, x: number, y: number, color: Cogl.Color, flags: number): void;
/**
* Renders `line` at the given coordinates using the given color.
* @param line a #PangoLayoutLine
* @param x X coordinate to render the line at
* @param y Y coordinate to render the line at
* @param color color to use when rendering the line
*/
function render_layout_line(line: Pango.LayoutLine, x: number, y: number, color: Cogl.Color): void;
/**
* Draws a solidly coloured `layout` on the given `framebuffer` at (`x,`
* `y)` within the `framebuffer<`!-- -->'s current model-view coordinate
* space.
* @param layout a #PangoLayout
* @param x X coordinate (in Pango units) to render the layout at
* @param y Y coordinate (in Pango units) to render the layout at
* @param color color to use when rendering the layout
* @param flags
*/
function render_layout_subpixel(
layout: Pango.Layout,
x: number,
y: number,
color: Cogl.Color,
flags: number,
): void;
namespace Renderer {
// Constructor properties interface
interface ConstructorProps extends Pango.Renderer.ConstructorProps {
context: any;
}
}
class Renderer extends Pango.Renderer {
static $gtype: GObject.GType<Renderer>;
// Properties
set context(val: any);
// Constructors
constructor(properties?: Partial<Renderer.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
type RendererClass = typeof Renderer;
type FontMap = PangoCairo.FontMap;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default CoglPango;
}
declare module 'gi://CoglPango' {
import CoglPango10 from 'gi://CoglPango?version=1.0';
export default CoglPango10;
}
// END

View File

@ -1,209 +0,0 @@
/// <reference path="./pangocairo-1.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./cairo.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./cogl-2.0.d.ts" />
/// <reference path="./gl-1.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://CoglPango?version=2.0' {
// Module dependencies
import type PangoCairo from 'gi://PangoCairo?version=1.0';
import type cairo from 'cairo';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type Cogl from 'gi://Cogl?version=2.0';
import type GL from 'gi://GL?version=1.0';
export namespace CoglPango {
/**
* CoglPango-2.0
*/
/**
* This updates any internal glyph cache textures as necessary to be
* able to render the given `layout`.
*
* This api should be used to avoid mid-scene modifications of
* glyph-cache textures which can lead to undefined rendering results.
* @param layout A #PangoLayout
*/
function ensure_glyph_cache_for_layout(layout: Pango.Layout): void;
/**
* Clears the glyph cache for `font_map`.
* @param font_map a #CoglPangoFontMap
*/
function font_map_clear_glyph_cache(font_map: FontMap): void;
/**
* Create a #PangoContext for the given `font_map`.
* @param font_map a #CoglPangoFontMap
* @returns the newly created context: free with g_object_unref().
*/
function font_map_create_context(font_map: FontMap): Pango.Context;
/**
* Retrieves the #CoglPangoRenderer for the passed `font_map`.
* @param font_map a #CoglPangoFontMap
* @returns a #PangoRenderer
*/
function font_map_get_renderer(font_map: FontMap): Pango.Renderer;
/**
* Retrieves whether the #CoglPangoRenderer used by `font_map` will use
* mipmapping when rendering the glyphs.
* @param font_map a #CoglPangoFontMap
* @returns %TRUE if mipmapping is used, %FALSE otherwise.
*/
function font_map_get_use_mipmapping(font_map: FontMap): Cogl.Bool;
/**
* Creates a new font map.
* @returns the newly created #PangoFontMap
*/
function font_map_new(): Pango.FontMap;
/**
* Sets the resolution for the `font_map`. This is a scale factor
* between points specified in a #PangoFontDescription and Cogl units.
* The default value is %96, meaning that a 10 point font will be 13
* units high. (10 * 96. / 72. = 13.3).
* @param font_map a #CoglPangoFontMap
* @param dpi The resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.)
*/
function font_map_set_resolution(font_map: FontMap, dpi: number): void;
/**
* Sets whether the renderer for the passed font map should use
* mipmapping when rendering a #PangoLayout.
* @param font_map a #CoglPangoFontMap
* @param value %TRUE to enable the use of mipmapping
*/
function font_map_set_use_mipmapping(font_map: FontMap, value: Cogl.Bool): void;
/**
* Draws a solidly coloured `layout` on the given `framebuffer` at (`x,`
* `y)` within the `framebuffer<`!-- -->'s current model-view coordinate
* space.
* @param layout a #PangoLayout
* @param x X coordinate to render the layout at
* @param y Y coordinate to render the layout at
* @param color color to use when rendering the layout
* @param flags
*/
function render_layout(layout: Pango.Layout, x: number, y: number, color: Cogl.Color, flags: number): void;
/**
* Renders `line` at the given coordinates using the given color.
* @param line a #PangoLayoutLine
* @param x X coordinate to render the line at
* @param y Y coordinate to render the line at
* @param color color to use when rendering the line
*/
function render_layout_line(line: Pango.LayoutLine, x: number, y: number, color: Cogl.Color): void;
/**
* Draws a solidly coloured `layout` on the given `framebuffer` at (`x,`
* `y)` within the `framebuffer<`!-- -->'s current model-view coordinate
* space.
* @param layout a #PangoLayout
* @param x X coordinate (in Pango units) to render the layout at
* @param y Y coordinate (in Pango units) to render the layout at
* @param color color to use when rendering the layout
* @param flags
*/
function render_layout_subpixel(
layout: Pango.Layout,
x: number,
y: number,
color: Cogl.Color,
flags: number,
): void;
/**
* Draws a solidly coloured `layout` on the given `framebuffer` at (`x,`
* `y)` within the `framebuffer<`!-- -->'s current model-view coordinate
* space.
* @param framebuffer A #CoglFramebuffer to draw too.
* @param layout a #PangoLayout
* @param x X coordinate to render the layout at
* @param y Y coordinate to render the layout at
* @param color color to use when rendering the layout
*/
function show_layout(
framebuffer: Cogl.Framebuffer,
layout: Pango.Layout,
x: number,
y: number,
color: Cogl.Color,
): void;
/**
* Draws a solidly coloured `line` on the given `framebuffer` at (`x,`
* `y)` within the `framebuffer<`!-- -->'s current model-view coordinate
* space.
* @param framebuffer A #CoglFramebuffer to draw too.
* @param line a #PangoLayoutLine
* @param x X coordinate to render the line at
* @param y Y coordinate to render the line at
* @param color color to use when rendering the line
*/
function show_layout_line(
framebuffer: Cogl.Framebuffer,
line: Pango.LayoutLine,
x: number,
y: number,
color: Cogl.Color,
): void;
namespace Renderer {
// Constructor properties interface
interface ConstructorProps extends Pango.Renderer.ConstructorProps {
context: any;
}
}
class Renderer extends Pango.Renderer {
static $gtype: GObject.GType<Renderer>;
// Properties
set context(val: any);
// Constructors
constructor(properties?: Partial<Renderer.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
type RendererClass = typeof Renderer;
type FontMap = PangoCairo.FontMap;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default CoglPango;
}
declare module 'gi://CoglPango' {
import CoglPango20 from 'gi://CoglPango?version=2.0';
export default CoglPango20;
}
// END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +0,0 @@
declare module 'console' {
/**
* @param logDomain the GLib log domain this Console should print
* with. Defaults to 'Gjs-Console'.
*/
export function setConsoleLogDomain(logDomain: string): void;
/**
* @param logDomain the GLib log domain this Console should print
* with. Defaults to 'Gjs-Console'.
*/
export function getConsoleLogDomain(): string;
export const DEFAULT_LOG_DOMAIN: string;
const Console: {
setConsoleLogDomain: typeof setConsoleLogDomain;
getConsoleLogDomain: typeof getConsoleLogDomain;
DEFAULT_LOG_DOMAIN: typeof DEFAULT_LOG_DOMAIN;
};
export default Console;
}

View File

@ -1,561 +0,0 @@
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://CudaGst?version=1.0' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
export namespace CudaGst {
/**
* CudaGst-1.0
*/
export namespace GLDeviceList {
export const $gtype: GObject.GType<GLDeviceList>;
}
enum GLDeviceList {
GL_DEVICE_LIST_ALL,
}
export namespace address_mode {
export const $gtype: GObject.GType<address_mode>;
}
enum address_mode {
WRAP,
CLAMP,
MIRROR,
BORDER,
}
export namespace array_format {
export const $gtype: GObject.GType<array_format>;
}
enum array_format {
INT8,
INT16,
}
export namespace device_attribute {
export const $gtype: GObject.GType<device_attribute>;
}
enum device_attribute {
TEXTURE_ALIGNMENT,
UNIFIED_ADDRESSING,
COMPUTE_CAPABILITY_MAJOR,
COMPUTE_CAPABILITY_MINOR,
VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED,
HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED,
HANDLE_TYPE_WIN32_HANDLE_SUPPORTED,
HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED,
MEMORY_POOLS_SUPPORTED,
}
export namespace event_flags {
export const $gtype: GObject.GType<event_flags>;
}
enum event_flags {
DEFAULT,
BLOCKING_SYNC,
DISABLE_TIMING,
INTERPROCESS,
}
export namespace externalMemoryHandleType {
export const $gtype: GObject.GType<externalMemoryHandleType>;
}
enum externalMemoryHandleType {
OPAQUE_FD,
OPAQUE_WIN32,
OPAQUE_WIN32_KMT,
D3D12_HEAP,
D3D12_RESOURCE,
D3D11_RESOURCE,
D3D11_RESOURCE_KMT,
NVSCIBUF,
}
export namespace externalSemaphoreHandleType {
export const $gtype: GObject.GType<externalSemaphoreHandleType>;
}
enum externalSemaphoreHandleType {
OPAQUE_FD,
OPAQUE_WIN32,
OPAQUE_WIN32_KMT,
D3D12_FENCE,
D3D11_FENCE,
NVSCISYNC,
D3D11_KEYED_MUTEX,
D3D11_KEYED_MUTEX_KMT,
TIMELINE_SEMAPHORE_FD,
TIMELINE_SEMAPHORE_WIN32,
}
export namespace filter_mode {
export const $gtype: GObject.GType<filter_mode>;
}
enum filter_mode {
POINT,
LINEAR,
}
export namespace graphicsMapResourceFlags {
export const $gtype: GObject.GType<graphicsMapResourceFlags>;
}
enum graphicsMapResourceFlags {
NONE,
READ_ONLY,
WRITE_DISCARD,
}
export namespace graphicsRegisterFlags {
export const $gtype: GObject.GType<graphicsRegisterFlags>;
}
enum graphicsRegisterFlags {
NONE,
READ_ONLY,
WRITE_DISCARD,
SURFACE_LOAD_STORE,
TEXTURE_GATHER,
}
export namespace ipcMem_flags {
export const $gtype: GObject.GType<ipcMem_flags>;
}
enum ipcMem_flags {
IPC_MEM_LAZY_ENABLE_PEER_ACCESS,
}
export namespace limit {
export const $gtype: GObject.GType<limit>;
}
enum limit {
STACK_SIZE,
PRINTF_FIFO_SIZE,
MALLOC_HEAP_SIZE,
DEV_RUNTIME_SYNC_DEPTH,
DEV_RUNTIME_PENDING_LAUNCH_COUNT,
MAX_L2_FETCH_GRANULARITY,
PERSISTING_L2_CACHE_SIZE,
SHMEM_SIZE,
CIG_ENABLED,
CIG_SHMEM_FALLBACK_ENABLED,
}
export namespace memAccess_flags {
export const $gtype: GObject.GType<memAccess_flags>;
}
enum memAccess_flags {
NONE,
READ,
READWRITE,
MAX,
}
export namespace memAllocationGranularity_flags {
export const $gtype: GObject.GType<memAllocationGranularity_flags>;
}
enum memAllocationGranularity_flags {
MINIMUM,
RECOMMENDED,
}
export namespace memAllocationHandleType {
export const $gtype: GObject.GType<memAllocationHandleType>;
}
enum memAllocationHandleType {
NONE,
POSIX_FILE_DESCRIPTOR,
WIN32,
WIN32_KMT,
MAX,
}
export namespace memAllocationType {
export const $gtype: GObject.GType<memAllocationType>;
}
enum memAllocationType {
INVALID,
PINNED,
MAX,
}
export namespace memLocationType {
export const $gtype: GObject.GType<memLocationType>;
}
enum memLocationType {
INVALID,
DEVICE,
MAX,
}
export namespace memPool_attribute {
export const $gtype: GObject.GType<memPool_attribute>;
}
enum memPool_attribute {
REUSE_FOLLOW_EVENT_DEPENDENCIES,
REUSE_ALLOW_OPPORTUNISTIC,
REUSE_ALLOW_INTERNAL_DEPENDENCIES,
RELEASE_THRESHOLD,
RESERVED_MEM_CURRENT,
RESERVED_MEM_HIGH,
USED_MEM_CURRENT,
USED_MEM_HIGH,
}
export namespace memorytype {
export const $gtype: GObject.GType<memorytype>;
}
enum memorytype {
HOST,
DEVICE,
ARRAY,
UNIFIED,
}
export namespace resourceViewFormat {
export const $gtype: GObject.GType<resourceViewFormat>;
}
enum resourceViewFormat {
RES_VIEW_FORMAT_NONE,
}
export namespace resourcetype {
export const $gtype: GObject.GType<resourcetype>;
}
enum resourcetype {
ARRAY,
MIPMAPPED_ARRAY,
LINEAR,
PITCH2D,
}
export namespace result {
export const $gtype: GObject.GType<result>;
}
enum result {
SUCCESS,
ERROR_NO_DEVICE,
ERROR_ALREADY_MAPPED,
ERROR_NOT_SUPPORTED,
}
export namespace stream_flags {
export const $gtype: GObject.GType<stream_flags>;
}
enum stream_flags {
DEFAULT,
NON_BLOCKING,
}
const IPC_HANDLE_SIZE: number;
const TRSF_READ_AS_INTEGER: number;
const VERSION: number;
class DA_ARRAY3D_DESCRIPTOR {
static $gtype: GObject.GType<DA_ARRAY3D_DESCRIPTOR>;
// Fields
Width: number;
Height: number;
Depth: number;
Format: array_format;
NumChannels: number;
Flags: number;
// Constructors
_init(...args: any[]): void;
}
class DA_EXTERNAL_MEMORY_BUFFER_DESC {
static $gtype: GObject.GType<DA_EXTERNAL_MEMORY_BUFFER_DESC>;
// Fields
flags: number;
reserved: number[];
// Constructors
constructor(
properties?: Partial<{
offset: number;
size: number;
flags: number;
reserved: number[];
}>,
);
_init(...args: any[]): void;
}
class DA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC {
static $gtype: GObject.GType<DA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC>;
// Fields
numLevels: number;
reserved: number[];
// Constructors
_init(...args: any[]): void;
}
class DA_MEMCPY2D {
static $gtype: GObject.GType<DA_MEMCPY2D>;
// Fields
srcXInBytes: number;
srcY: number;
srcMemoryType: memorytype;
srcHost: any;
srcDevice: deviceptr;
srcArray: array;
srcPitch: number;
dstXInBytes: number;
dstY: number;
dstMemoryType: memorytype;
dstHost: any;
dstDevice: deviceptr;
dstArray: array;
dstPitch: number;
WidthInBytes: number;
Height: number;
// Constructors
_init(...args: any[]): void;
}
class DA_RESOURCE_DESC {
static $gtype: GObject.GType<DA_RESOURCE_DESC>;
// Fields
resType: resourcetype;
flags: number;
// Constructors
_init(...args: any[]): void;
}
class DA_RESOURCE_VIEW_DESC {
static $gtype: GObject.GType<DA_RESOURCE_VIEW_DESC>;
// Fields
format: resourceViewFormat;
width: number;
height: number;
depth: number;
firstMipmapLevel: number;
lastMipmapLevel: number;
firstLayer: number;
lastLayer: number;
reserved: number[];
// Constructors
_init(...args: any[]): void;
}
class DA_TEXTURE_DESC {
static $gtype: GObject.GType<DA_TEXTURE_DESC>;
// Fields
addressMode: address_mode[];
filterMode: filter_mode;
flags: number;
maxAnisotropy: number;
mipmapFilterMode: filter_mode;
mipmapLevelBias: number;
minMipmapLevelClamp: number;
maxMipmapLevelClamp: number;
borderColor: number[];
reserved: number[];
// Constructors
_init(...args: any[]): void;
}
class ipcEventHandle {
static $gtype: GObject.GType<ipcEventHandle>;
// Fields
reserved: number[];
// Constructors
constructor(
properties?: Partial<{
reserved: number[];
}>,
);
_init(...args: any[]): void;
}
class ipcMemHandle {
static $gtype: GObject.GType<ipcMemHandle>;
// Fields
reserved: number[];
// Constructors
constructor(
properties?: Partial<{
reserved: number[];
}>,
);
_init(...args: any[]): void;
}
class memAccessDesc {
static $gtype: GObject.GType<memAccessDesc>;
// Fields
flags: memAccess_flags;
// Constructors
_init(...args: any[]): void;
}
class memAllocationProp {
static $gtype: GObject.GType<memAllocationProp>;
// Fields
type: memAllocationType;
requestedHandleTypes: memAllocationHandleType;
win32HandleMetaData: any;
allocFlags: memAllocationPropAllocFlags;
// Constructors
_init(...args: any[]): void;
}
class memAllocationPropAllocFlags {
static $gtype: GObject.GType<memAllocationPropAllocFlags>;
// Fields
compressionType: number;
gpuDirectRDMACapable: number;
usage: number;
reserved: Uint8Array;
// Constructors
constructor(
properties?: Partial<{
compressionType: number;
gpuDirectRDMACapable: number;
usage: number;
reserved: Uint8Array;
}>,
);
_init(...args: any[]): void;
}
class memLocation {
static $gtype: GObject.GType<memLocation>;
// Fields
type: memLocationType;
id: number;
// Constructors
_init(...args: any[]): void;
}
class memPoolProps {
static $gtype: GObject.GType<memPoolProps>;
// Fields
allocType: memAllocationType;
handleTypes: memAllocationHandleType;
win32SecurityAttributes: any;
maxSize: number;
reserved: Uint8Array;
// Constructors
_init(...args: any[]): void;
}
type array = any;
type context = any;
type device = number;
type deviceptr = never;
type event = any;
type externalMemory = any;
type externalSemaphore = any;
type __function = any;
type graphicsResource = any;
type memoryPool = any;
type mipmappedArray = any;
type module = any;
type stream = any;
type texObject = number;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default CudaGst;
}
declare module 'gi://CudaGst' {
import CudaGst10 from 'gi://CudaGst?version=1.0';
export default CudaGst10;
}
// END

View File

@ -1,89 +0,0 @@
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://DBus?version=1.0' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
export namespace DBus {
/**
* DBus-1.0
*/
export namespace BusType {
export const $gtype: GObject.GType<BusType>;
}
enum BusType {
SESSION,
SYSTEM,
STARTER,
}
class Connection {
static $gtype: GObject.GType<Connection>;
// Constructors
_init(...args: any[]): void;
}
class Error {
static $gtype: GObject.GType<Error>;
// Constructors
_init(...args: any[]): void;
}
class Message {
static $gtype: GObject.GType<Message>;
// Constructors
_init(...args: any[]): void;
}
class MessageIter {
static $gtype: GObject.GType<MessageIter>;
// Constructors
_init(...args: any[]): void;
}
class PendingCall {
static $gtype: GObject.GType<PendingCall>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default DBus;
}
declare module 'gi://DBus' {
import DBus10 from 'gi://DBus?version=1.0';
export default DBus10;
}
// END

View File

@ -1,82 +0,0 @@
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://DBusGLib?version=1.0' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
export namespace DBusGLib {
/**
* DBusGLib-1.0
*/
namespace Proxy {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class Proxy extends GObject.Object {
static $gtype: GObject.GType<Proxy>;
// Constructors
constructor(properties?: Partial<Proxy.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
class Connection {
static $gtype: GObject.GType<Connection>;
// Constructors
_init(...args: any[]): void;
}
class MethodInvocation {
static $gtype: GObject.GType<MethodInvocation>;
// Constructors
_init(...args: any[]): void;
}
class ProxyClass {
static $gtype: GObject.GType<ProxyClass>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default DBusGLib;
}
declare module 'gi://DBusGLib' {
import DBusGLib10 from 'gi://DBusGLib?version=1.0';
export default DBusGLib10;
}
// END

File diff suppressed because it is too large Load Diff

View File

@ -1,718 +0,0 @@
/// <reference path="./gtk-3.0.d.ts" />
/// <reference path="./xlib-2.0.d.ts" />
/// <reference path="./gdk-3.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./cairo.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./gdkpixbuf-2.0.d.ts" />
/// <reference path="./atk-1.0.d.ts" />
/// <reference path="./dbusmenu-0.4.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://DbusmenuGtk3?version=0.4' {
// Module dependencies
import type Gtk from 'gi://Gtk?version=3.0';
import type xlib from 'gi://xlib?version=2.0';
import type Gdk from 'gi://Gdk?version=3.0';
import type cairo from 'cairo';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type Atk from 'gi://Atk?version=1.0';
import type Dbusmenu from 'gi://Dbusmenu?version=0.4';
export namespace DbusmenuGtk3 {
/**
* DbusmenuGtk3-0.4
*/
const GTK_MENUITEM_H__: number;
/**
* The Dbusmenu GTK parser adds cached items on the various
* menu items throughout the tree. Sometimes it can be useful
* to get that cached item to use directly. This function
* will retrieve it for you.
* @param widget A #GtkMenuItem that may have a cached #DbusmenuMenuitem from the parser
* @returns A pointer to the cached item or NULL if it isn't there.
*/
function gtk_parse_get_cached_item(widget: Gtk.Widget): Dbusmenu.Menuitem;
/**
* Goes through the GTK structures and turns them into the appropraite
* Dbusmenu structures along with setting up all the relationships
* between the objects. It also stores the dbusmenu items as a cache
* on the GTK items so that they'll be reused if necissary.
* @param widget A #GtkMenuItem or #GtkMenuShell to turn into a #DbusmenuMenuitem
* @returns A dbusmenu item representing the menu structure
*/
function gtk_parse_menu_structure(widget: Gtk.Widget): Dbusmenu.Menuitem;
/**
* This function looks on the menu item for a property by the
* name of `property`. If one exists it tries to turn it into
* a #GdkPixbuf. It assumes that the property is a base64 encoded
* PNG file like the one created by #dbusmenu_menuite_property_set_image.
* @param menuitem The #DbusmenuMenuitem to look for the property on
* @param property The name of the property to look for.
* @returns A pixbuf or #NULL to signal error.
*/
function menuitem_property_get_image(menuitem: Dbusmenu.Menuitem, property: string): GdkPixbuf.Pixbuf;
/**
* This function gets a GTK shortcut as a key and a mask
* for use to set the accelerators.
* @param menuitem The #DbusmenuMenuitem to get the shortcut off
*/
function menuitem_property_get_shortcut(menuitem: Dbusmenu.Menuitem): [number, Gdk.ModifierType];
/**
* This function takes the pixbuf that is stored in `data` and
* turns it into a base64 encoded PNG so that it can be placed
* onto a standard #DbusmenuMenuitem property.
* @param menuitem The #DbusmenuMenuitem to set the property on.
* @param property Name of the property to set.
* @param data The image to place on the property.
* @returns Whether the function was able to set the property or not.
*/
function menuitem_property_set_image(
menuitem: Dbusmenu.Menuitem,
property: string,
data: GdkPixbuf.Pixbuf,
): boolean;
/**
* Takes the modifer described by `key` and `modifier` and places that into
* the format sending across Dbus for shortcuts.
* @param menuitem The #DbusmenuMenuitem to set the shortcut on
* @param key The keycode of the key to send
* @param modifier A bitmask of modifiers used to activate the item
* @returns Whether it was successful at setting the property.
*/
function menuitem_property_set_shortcut(
menuitem: Dbusmenu.Menuitem,
key: number,
modifier: Gdk.ModifierType | null,
): boolean;
/**
* Takes the shortcut that is installed on a menu item and calls
* #dbusmenu_menuitem_property_set_shortcut with it. It also sets
* up listeners to watch it change.
* @param menuitem The #DbusmenuMenuitem to set the shortcut on
* @param gmi A menu item to steal the shortcut off of
* @returns Whether it was successful at setting the property.
*/
function menuitem_property_set_shortcut_menuitem(menuitem: Dbusmenu.Menuitem, gmi: Gtk.MenuItem): boolean;
/**
* This function takes a GTK shortcut string as defined in
* #gtk_accelerator_parse and turns that into the information
* required to send it over DBusmenu.
* @param menuitem The #DbusmenuMenuitem to set the shortcut on
* @param shortcut String describing the shortcut
* @returns Whether it was successful at setting the property.
*/
function menuitem_property_set_shortcut_string(menuitem: Dbusmenu.Menuitem, shortcut: string): boolean;
namespace Client {
// Constructor properties interface
interface ConstructorProps extends Dbusmenu.Client.ConstructorProps {}
}
/**
* A subclass of #DbusmenuClient to add functionality with regarding
* building GTK items out of the abstract tree.
*/
class Client extends Dbusmenu.Client {
static $gtype: GObject.GType<Client>;
// Constructors
constructor(properties?: Partial<Client.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](dbus_name: string, dbus_object: string): Client;
// Methods
/**
* Gets the accel group for this client.
* @returns Either a valid group or #NULL on error or none set.
*/
get_accel_group(): Gtk.AccelGroup;
/**
* This grabs the #GtkMenuItem that is associated with the
* #DbusmenuMenuitem.
* @param item #DbusmenuMenuitem to get associated #GtkMenuItem on.
* @returns The #GtkMenuItem that can be played with.
*/
menuitem_get(item: Dbusmenu.Menuitem): Gtk.MenuItem;
/**
* This grabs the submenu associated with the menuitem.
* @param item #DbusmenuMenuitem to get associated #GtkMenu on.
* @returns The #GtkMenu if there is one.
*/
menuitem_get_submenu(item: Dbusmenu.Menuitem): Gtk.Menu;
/**
* This function provides some of the basic connectivity for being in
* the GTK world. Things like visibility and sensitivity of the item are
* handled here so that the subclasses don't have to. If you're building
* your on GTK menu item you can use this function to apply those basic
* attributes so that you don't have to deal with them either.
*
* This also handles passing the "activate" signal back to the
* #DbusmenuMenuitem side of thing.
* @param item The #DbusmenuMenuitem to attach the GTK-isms to
* @param gmi A #GtkMenuItem representing the GTK world's view of this menuitem
* @param parent The parent #DbusmenuMenuitem
*/
newitem_base(item: Dbusmenu.Menuitem, gmi: Gtk.MenuItem, parent: Dbusmenu.Menuitem): void;
/**
* Sets the acceleration group for the menu items with accelerators
* on this client.
* @param agroup The new acceleration group
*/
set_accel_group(agroup: Gtk.AccelGroup): void;
}
namespace Menu {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Menu.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
dbus_name: string;
dbusName: string;
dbus_object: string;
dbusObject: string;
}
}
/**
* A #GtkMenu that is built using an abstract tree built from
* a #DbusmenuGtkClient.
*/
class Menu extends Gtk.Menu implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType<Menu>;
// Properties
get dbus_name(): string;
get dbusName(): string;
get dbus_object(): string;
get dbusObject(): string;
// Constructors
constructor(properties?: Partial<Menu.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](dbus_name: string, dbus_object: string): Menu;
// Conflicted with Gtk.Menu.new
static ['new'](...args: never[]): any;
// Methods
/**
* An accessor for the client that this menu is using to
* communicate with the server.
* @returns A valid #DbusmenuGtkClient or NULL on error.
*/
get_client(): Client;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
type ClientClass = typeof Client;
abstract class ClientPrivate {
static $gtype: GObject.GType<ClientPrivate>;
// Constructors
_init(...args: any[]): void;
}
type MenuClass = typeof Menu;
abstract class MenuPrivate {
static $gtype: GObject.GType<MenuPrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default DbusmenuGtk3;
}
declare module 'gi://DbusmenuGtk3' {
import DbusmenuGtk304 from 'gi://DbusmenuGtk3?version=0.4';
export default DbusmenuGtk304;
}
// END

View File

@ -1,306 +0,0 @@
/// <reference path="./glib-2.0.d.ts" />
/**
* Gjs has implemented some functionality from the DOM API,
* this leads to a conflict when all DOM (`lib.dom.d.ts`) should be used.
* This should normally not be the case, since the other - not yet reimplemented - API's cannot be used in GJS anyway.
*
* If for some reason the entire DOM types should still be used,
* this file can be ignored and `lib.dom.d.ts` used instead, otherwise this file should be imported in your project.
*
* See also https://github.com/microsoft/TypeScript/blob/main/lib/lib.dom.d.ts
*/
import type GLib from 'gi://GLib?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
declare global {
interface ImportMeta {
/**
* The absolute file: or resource: URL of the module.
*
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/doc/ESModules.md#importmetaurl
*/
url: string; // with readonly this type is incompatible with e.g. https://github.com/vitejs/vite/blob/main/packages/vite/types/importMeta.d.ts
}
// Timers
// See https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/esm/_timers.js
/**
* @version Gjs 1.71.1
* @param callback a callback function
* @param delay the duration in milliseconds to wait before running callback
* @param args arguments to pass to callback
*/
function setTimeout(callback: (...args: any[]) => any, delay?: number, ...args: any[]): GLib.Source;
/**
* @version Gjs 1.71.1
* @param callback a callback function
* @param delay the duration in milliseconds to wait between calling callback
* @param args arguments to pass to callback
*/
function setInterval(callback: (...args: any[]) => any, delay?: number, ...args: any[]): GLib.Source;
/**
* @version Gjs 1.71.1
* @param timeout the timeout to clear
*/
function clearTimeout(timeout: GLib.Source): void;
/**
* @version Gjs 1.71.1
* @param timeout the timeout to clear
*/
function clearInterval(timeout: GLib.Source): void;
interface Console {
/**
* Logs a critical message if the condition is not truthy.
* {@link console.error()} for additional information.
*
* @param condition a boolean condition which, if false, causes
* the log to print
* @param data formatting substitutions, if applicable
* @returns
*/
assert(condition: boolean, ...data: any[]): void;
/**
* Resets grouping and clears the terminal on systems supporting ANSI
* terminal control sequences.
*
* In file-based stdout or systems which do not support clearing,
* console.clear() has no visual effect.
*
*/
clear(): void;
/**
* Logs a message with severity equal to {@link GLib.LogLevelFlags.DEBUG}.
*
* @param {...any} data formatting substitutions, if applicable
*/
debug(...data: any[]): void;
/**
* Logs a message with severity equal to {@link GLib.LogLevelFlags.CRITICAL}.
* Does not use {@link GLib.LogLevelFlags.ERROR} to avoid asserting and
* forcibly shutting down the application.
*
* @param data formatting substitutions, if applicable
*/
error(...data: any[]): void;
/**
* Logs a message with severity equal to {@link GLib.LogLevelFlags.INFO}.
*
* @param data formatting substitutions, if applicable
*/
info(...data: any[]): void;
/**
* Logs a message with severity equal to {@link GLib.LogLevelFlags.MESSAGE}.
*
* @param data formatting substitutions, if applicable
*/
log(...data: any[]): void;
// 1.1.7 table(tabularData, properties)
table(tabularData: any, _properties: never): void;
/**
* @param data formatting substitutions, if applicable
*/
trace(...data: any[]): void;
/**
* @param data formatting substitutions, if applicable
*/
warn(...data: any[]): void;
/**
* @param item an item to format generically
* @param [options] any additional options for the formatter. Unused
* in our implementation.
*/
dir(item: object, options: never): void;
/**
* @param data formatting substitutions, if applicable
*/
dirxml(...data: any[]): void;
// 1.2 Counting functions
// https://console.spec.whatwg.org/#counting
/**
* Logs how many times console.count(label) has been called with a given
* label.
* {@link console.countReset()} for resetting a count.
*
* @param label unique identifier for this action
*/
count(label: string): void;
/**
* @param label the unique label to reset the count for
*/
countReset(label: string): void;
// 1.3 Grouping functions
// https://console.spec.whatwg.org/#grouping
/**
* @param data formatting substitutions, if applicable
*/
group(...data: any[]): void;
/**
* Alias for console.group()
*
* @param {...any} data formatting substitutions, if applicable
*/
groupCollapsed(...data: any[]): void;
/**
*/
groupEnd(): void;
// 1.4 Timing functions
// https://console.spec.whatwg.org/#timing
/**
* @param label unique identifier for this action, pass to
* console.timeEnd() to complete
*/
time(label: string): void;
/**
* Logs the time since the last call to console.time(label) where label is
* the same.
*
* @param label unique identifier for this action, pass to
* console.timeEnd() to complete
* @param data string substitutions, if applicable
*/
timeLog(label: string, ...data: any[]): void;
/**
* Logs the time since the last call to console.time(label) and completes
* the action.
* Call console.time(label) again to re-measure.
*
* @param label unique identifier for this action
*/
timeEnd(label: string): void;
// Non-standard functions which are de-facto standards.
// Similar to Node, we define these as no-ops for now.
/**
* @deprecated Not implemented in GJS
*
* @param _label unique identifier for this action, pass to
* console.profileEnd to complete
*/
profile(_label: string): void;
/**
* @deprecated Not implemented in GJS
*
* @param _label unique identifier for this action
*/
profileEnd(_label: string): void;
/**
* @deprecated Not implemented in GJS
*
* @param _label unique identifier for this action
*/
timeStamp(_label: string): void;
}
interface TextDecodeOptions {
// As of Gjs 1.73.2 stream mode is not supported yet.
// stream?: boolean
}
interface TextDecoderOptions {
/** Indicates whether the error mode is fatal. */
fatal?: boolean;
/** Indicates whether whether the byte order mark is ignored. */
ignoreBOM?: boolean;
}
/**
* The TextDecoder interface represents a decoder for a specific text encoding.
* It takes a stream of bytes as input and emits a stream of code points.
*
* @version Gjs 1.69.2
*/
interface TextDecoder {
/** A string containing the name of the decoder, that is a string describing the method the TextDecoder will use. */
readonly encoding: TextDecoderEncoding;
/** A Boolean indicating whether the error mode is fatal. */
readonly fatal: boolean;
/** A Boolean indicating whether the byte order mark is ignored. */
readonly ignoreBOM: boolean;
/**
* Returns a string containing the text decoded with the method of the specific TextDecoder object.
*
* If the error mode is "fatal" and the encoder method encounter an error it WILL THROW a TypeError.
*
* @param input Buffer containing the text to decode
* @param options Object defining the decode options
*/
decode(input?: ArrayBufferView | ArrayBuffer, options?: TextDecodeOptions): string;
}
interface TextEncoderEncodeIntoResult {
read?: number;
written?: number;
}
/**
* TextEncoder takes a stream of code points as input and emits a stream of bytes.
*
* @version Gjs 1.69.2
*/
interface TextEncoder {
readonly encoding: 'utf-8';
/**
* Takes a string as input, and returns a buffer containing the text given in parameters encoded with the UTF-8 method.
*
* @param input Text to encode.
*/
encode(input?: string): Uint8Array;
/**
* Takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into,
* and returns a dictionary object indicating the progress of the encoding.
*
* This is potentially more performant than the older encode() method.
*
* @param source Text to encode.
* @param destination Buffer where to place the resulting UTF-8 encoded text into.
*/
encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult;
}
const console: Console;
const TextDecoder: {
prototype: TextDecoder;
new (label?: TextDecoderEncoding, options?: TextDecoderOptions): TextDecoder;
};
const TextEncoder: {
prototype: TextEncoder;
new (): TextEncoder;
};
}
export {};

View File

@ -1,65 +0,0 @@
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://fontconfig?version=2.0' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
export namespace fontconfig {
/**
* fontconfig-2.0
*/
function init(): void;
class Pattern {
static $gtype: GObject.GType<Pattern>;
// Constructors
_init(...args: any[]): void;
}
class CharSet {
static $gtype: GObject.GType<CharSet>;
// Constructors
_init(...args: any[]): void;
}
class Config {
static $gtype: GObject.GType<Config>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default fontconfig;
}
declare module 'gi://fontconfig' {
import Fontconfig20 from 'gi://fontconfig?version=2.0';
export default Fontconfig20;
}
// END

View File

@ -1,65 +0,0 @@
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://freetype2?version=2.0' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
export namespace freetype2 {
/**
* freetype2-2.0
*/
class Bitmap {
static $gtype: GObject.GType<Bitmap>;
// Constructors
_init(...args: any[]): void;
}
class Face {
static $gtype: GObject.GType<Face>;
// Constructors
_init(...args: any[]): void;
}
class Library {
static $gtype: GObject.GType<Library>;
// Constructors
_init(...args: any[]): void;
}
type Int32 = number;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default freetype2;
}
declare module 'gi://freetype2' {
import Freetype220 from 'gi://freetype2?version=2.0';
export default Freetype220;
}
// END

File diff suppressed because it is too large Load Diff

View File

@ -1,612 +0,0 @@
/// <reference path="./libxfce4util-1.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./libxfce4ui-2.0.d.ts" />
/// <reference path="./gtk-3.0.d.ts" />
/// <reference path="./xlib-2.0.d.ts" />
/// <reference path="./gdk-3.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./cairo.d.ts" />
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/// <reference path="./gdkpixbuf-2.0.d.ts" />
/// <reference path="./atk-1.0.d.ts" />
/// <reference path="./garcon-1.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://GarconGtk?version=1.0' {
// Module dependencies
import type Libxfce4util from 'gi://Libxfce4util?version=1.0';
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type Libxfce4ui from 'gi://Libxfce4ui?version=2.0';
import type Gtk from 'gi://Gtk?version=3.0';
import type xlib from 'gi://xlib?version=2.0';
import type Gdk from 'gi://Gdk?version=3.0';
import type cairo from 'cairo';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type Atk from 'gi://Atk?version=1.0';
import type Garcon from 'gi://Garcon?version=1.0';
export namespace GarconGtk {
/**
* GarconGtk-1.0
*/
namespace Menu {
// Constructor properties interface
interface ConstructorProps
extends Gtk.Menu.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Gtk.Buildable.ConstructorProps {
menu: Garcon.Menu;
right_click_edits: boolean;
rightClickEdits: boolean;
show_desktop_actions: boolean;
showDesktopActions: boolean;
show_generic_names: boolean;
showGenericNames: boolean;
show_menu_icons: boolean;
showMenuIcons: boolean;
show_tooltips: boolean;
showTooltips: boolean;
}
}
class Menu extends Gtk.Menu implements Atk.ImplementorIface, Gtk.Buildable {
static $gtype: GObject.GType<Menu>;
// Properties
get menu(): Garcon.Menu;
set menu(val: Garcon.Menu);
get right_click_edits(): boolean;
set right_click_edits(val: boolean);
get rightClickEdits(): boolean;
set rightClickEdits(val: boolean);
get show_desktop_actions(): boolean;
set show_desktop_actions(val: boolean);
get showDesktopActions(): boolean;
set showDesktopActions(val: boolean);
get show_generic_names(): boolean;
set show_generic_names(val: boolean);
get showGenericNames(): boolean;
set showGenericNames(val: boolean);
get show_menu_icons(): boolean;
set show_menu_icons(val: boolean);
get showMenuIcons(): boolean;
set showMenuIcons(val: boolean);
get show_tooltips(): boolean;
set show_tooltips(val: boolean);
get showTooltips(): boolean;
set showTooltips(val: boolean);
// Constructors
constructor(properties?: Partial<Menu.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](garcon_menu?: Garcon.Menu | null): Menu;
// Conflicted with Gtk.Menu.new
static ['new'](...args: never[]): any;
// Static methods
/**
* Application icons are never shown on the action menu items.
* @param item A #GarconMenuItem
*/
static get_desktop_actions_menu(item: Garcon.MenuItem): Gtk.Menu;
// Methods
/**
* The #GarconMenu used to create the #GtkMenu.
*
* The caller is responsible to releasing the returned #GarconMenu
* using g_object_unref().
* @returns the #GarconMenu for @menu.
*/
get_menu(): Garcon.Menu;
get_right_click_edits(): boolean;
get_show_desktop_actions(): boolean;
get_show_generic_names(): boolean;
get_show_menu_icons(): boolean;
get_show_tooltips(): boolean;
set_menu(garcon_menu: Garcon.Menu): void;
set_right_click_edits(enable_right_click_edits: boolean): void;
set_show_desktop_actions(show_desktop_actions: boolean): void;
set_show_generic_names(show_generic_names: boolean): void;
set_show_menu_icons(show_menu_icons: boolean): void;
set_show_tooltips(show_tooltips: boolean): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
type MenuClass = typeof Menu;
abstract class MenuPrivate {
static $gtype: GObject.GType<MenuPrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default GarconGtk;
}
declare module 'gi://GarconGtk' {
import GarconGtk10 from 'gi://GarconGtk?version=1.0';
export default GarconGtk10;
}
// END

View File

@ -1,169 +0,0 @@
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./cairo.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://Gc?version=1.0' {
// Module dependencies
import type Pango from 'gi://Pango?version=1.0';
import type cairo from 'cairo';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace Gc {
/**
* Gc-1.0
*/
export namespace Category {
export const $gtype: GObject.GType<Category>;
}
enum Category {
NONE,
LETTER,
LETTER_PUNCTUATION,
LETTER_ARROW,
LETTER_BULLET,
LETTER_PICTURE,
LETTER_CURRENCY,
LETTER_MATH,
LETTER_LATIN,
EMOJI,
EMOJI_SMILEYS,
EMOJI_PEOPLE,
EMOJI_ANIMALS,
EMOJI_FOOD,
EMOJI_ACTIVITIES,
EMOJI_TRAVEL,
EMOJI_OBJECTS,
EMOJI_SYMBOLS,
EMOJI_FLAGS,
}
export namespace SearchError {
export const $gtype: GObject.GType<SearchError>;
}
enum SearchError {
FAILED,
INVALID_STATE,
}
function character_is_composite(chars: number[]): boolean;
function character_is_invisible(chars: number[]): boolean;
function character_name(chars: number[]): string | null;
function get_current_language(): string;
function get_scripts_for_language(language: string): GLib.UnicodeScript[];
function search_result_get(result: SearchResult, index: number): string;
function search_result_get_type(): GObject.GType;
interface SearchFunc {
(uc: number): boolean;
}
export namespace SearchFlag {
export const $gtype: GObject.GType<SearchFlag>;
}
enum SearchFlag {
NONE,
WORD,
}
namespace SearchContext {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
criteria: SearchCriteria;
flags: SearchFlag;
}
}
class SearchContext extends GObject.Object {
static $gtype: GObject.GType<SearchContext>;
// Properties
set criteria(val: SearchCriteria);
set flags(val: SearchFlag);
// Constructors
constructor(properties?: Partial<SearchContext.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](criteria: SearchCriteria, flags: SearchFlag): SearchContext;
// Methods
is_finished(): boolean;
search(max_matches: number, cancellable?: Gio.Cancellable | null): Promise<SearchResult>;
search(
max_matches: number,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback<this> | null,
): void;
search(
max_matches: number,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback<this> | null,
): Promise<SearchResult> | void;
search_finish(result: Gio.AsyncResult): SearchResult;
}
type SearchContextClass = typeof SearchContext;
class SearchCriteria {
static $gtype: GObject.GType<SearchCriteria>;
// Constructors
constructor(category: Category);
_init(...args: any[]): void;
static new_category(category: Category): SearchCriteria;
static new_keywords(keywords: string[]): SearchCriteria;
static new_related(character: string): SearchCriteria;
static new_scripts(scripts: GLib.UnicodeScript[]): SearchCriteria;
}
type SearchResult = GLib.PtrArray;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default Gc;
}
declare module 'gi://Gc' {
import Gc10 from 'gi://Gc?version=1.0';
export default Gc10;
}
// END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,405 +0,0 @@
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://GDesktopEnums?version=3.0' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
export namespace GDesktopEnums {
/**
* GDesktopEnums-3.0
*/
export namespace AccentColor {
export const $gtype: GObject.GType<AccentColor>;
}
enum AccentColor {
BLUE,
TEAL,
GREEN,
YELLOW,
ORANGE,
RED,
PINK,
PURPLE,
SLATE,
}
export namespace BackgroundShading {
export const $gtype: GObject.GType<BackgroundShading>;
}
enum BackgroundShading {
SOLID,
VERTICAL,
HORIZONTAL,
}
export namespace BackgroundStyle {
export const $gtype: GObject.GType<BackgroundStyle>;
}
enum BackgroundStyle {
NONE,
WALLPAPER,
CENTERED,
SCALED,
STRETCHED,
ZOOM,
SPANNED,
}
export namespace ClockFormat {
export const $gtype: GObject.GType<ClockFormat>;
}
enum ClockFormat {
'24H',
'12H',
}
export namespace ColorScheme {
export const $gtype: GObject.GType<ColorScheme>;
}
enum ColorScheme {
DEFAULT,
PREFER_DARK,
PREFER_LIGHT,
}
export namespace DeviceSendEvents {
export const $gtype: GObject.GType<DeviceSendEvents>;
}
enum DeviceSendEvents {
ENABLED,
DISABLED,
DISABLED_ON_EXTERNAL_MOUSE,
}
export namespace FocusMode {
export const $gtype: GObject.GType<FocusMode>;
}
enum FocusMode {
CLICK,
SLOPPY,
MOUSE,
}
export namespace FocusNewWindows {
export const $gtype: GObject.GType<FocusNewWindows>;
}
enum FocusNewWindows {
SMART,
STRICT,
}
export namespace FontAntialiasingMode {
export const $gtype: GObject.GType<FontAntialiasingMode>;
}
enum FontAntialiasingMode {
NONE,
GRAYSCALE,
RGBA,
}
export namespace FontHinting {
export const $gtype: GObject.GType<FontHinting>;
}
enum FontHinting {
NONE,
SLIGHT,
MEDIUM,
FULL,
}
export namespace FontRendering {
export const $gtype: GObject.GType<FontRendering>;
}
enum FontRendering {
AUTOMATIC,
MANUAL,
}
export namespace FontRgbaOrder {
export const $gtype: GObject.GType<FontRgbaOrder>;
}
enum FontRgbaOrder {
RGBA,
RGB,
BGR,
VRGB,
VBGR,
}
export namespace LocationAccuracyLevel {
export const $gtype: GObject.GType<LocationAccuracyLevel>;
}
enum LocationAccuracyLevel {
COUNTRY,
CITY,
NEIGHBORHOOD,
STREET,
EXACT,
}
export namespace MagnifierCaretTrackingMode {
export const $gtype: GObject.GType<MagnifierCaretTrackingMode>;
}
enum MagnifierCaretTrackingMode {
NONE,
CENTERED,
PROPORTIONAL,
PUSH,
}
export namespace MagnifierFocusTrackingMode {
export const $gtype: GObject.GType<MagnifierFocusTrackingMode>;
}
enum MagnifierFocusTrackingMode {
NONE,
CENTERED,
PROPORTIONAL,
PUSH,
}
export namespace MagnifierMouseTrackingMode {
export const $gtype: GObject.GType<MagnifierMouseTrackingMode>;
}
enum MagnifierMouseTrackingMode {
NONE,
CENTERED,
PROPORTIONAL,
PUSH,
}
export namespace MagnifierScreenPosition {
export const $gtype: GObject.GType<MagnifierScreenPosition>;
}
enum MagnifierScreenPosition {
NONE,
FULL_SCREEN,
TOP_HALF,
BOTTOM_HALF,
LEFT_HALF,
RIGHT_HALF,
}
export namespace MouseDwellDirection {
export const $gtype: GObject.GType<MouseDwellDirection>;
}
enum MouseDwellDirection {
LEFT,
RIGHT,
UP,
DOWN,
}
export namespace MouseDwellMode {
export const $gtype: GObject.GType<MouseDwellMode>;
}
enum MouseDwellMode {
WINDOW,
GESTURE,
}
export namespace PadButtonAction {
export const $gtype: GObject.GType<PadButtonAction>;
}
enum PadButtonAction {
NONE,
HELP,
SWITCH_MONITOR,
KEYBINDING,
}
export namespace PointerAccelProfile {
export const $gtype: GObject.GType<PointerAccelProfile>;
}
enum PointerAccelProfile {
DEFAULT,
FLAT,
ADAPTIVE,
}
export namespace PointingStickScrollMethod {
export const $gtype: GObject.GType<PointingStickScrollMethod>;
}
enum PointingStickScrollMethod {
DEFAULT,
NONE,
ON_BUTTON_DOWN,
}
export namespace ProxyMode {
export const $gtype: GObject.GType<ProxyMode>;
}
enum ProxyMode {
NONE,
MANUAL,
AUTO,
}
export namespace ScreensaverMode {
export const $gtype: GObject.GType<ScreensaverMode>;
}
enum ScreensaverMode {
BLANK_ONLY,
RANDOM,
SINGLE,
}
export namespace StylusButtonAction {
export const $gtype: GObject.GType<StylusButtonAction>;
}
enum StylusButtonAction {
DEFAULT,
MIDDLE,
RIGHT,
BACK,
FORWARD,
SWITCH_MONITOR,
KEYBINDING,
}
export namespace TabletMapping {
export const $gtype: GObject.GType<TabletMapping>;
}
enum TabletMapping {
ABSOLUTE,
RELATIVE,
}
export namespace TitlebarAction {
export const $gtype: GObject.GType<TitlebarAction>;
}
enum TitlebarAction {
TOGGLE_SHADE,
TOGGLE_MAXIMIZE,
TOGGLE_MAXIMIZE_HORIZONTALLY,
TOGGLE_MAXIMIZE_VERTICALLY,
MINIMIZE,
NONE,
LOWER,
MENU,
}
export namespace ToolbarIconSize {
export const $gtype: GObject.GType<ToolbarIconSize>;
}
enum ToolbarIconSize {
SMALL,
LARGE,
}
export namespace ToolbarStyle {
export const $gtype: GObject.GType<ToolbarStyle>;
}
enum ToolbarStyle {
BOTH,
BOTH_HORIZ,
ICONS,
TEXT,
}
export namespace TouchpadClickMethod {
export const $gtype: GObject.GType<TouchpadClickMethod>;
}
enum TouchpadClickMethod {
DEFAULT,
NONE,
AREAS,
FINGERS,
}
export namespace TouchpadHandedness {
export const $gtype: GObject.GType<TouchpadHandedness>;
}
enum TouchpadHandedness {
RIGHT,
LEFT,
MOUSE,
}
export namespace TouchpadTapButtonMap {
export const $gtype: GObject.GType<TouchpadTapButtonMap>;
}
enum TouchpadTapButtonMap {
DEFAULT,
LRM,
LMR,
}
export namespace UsbProtection {
export const $gtype: GObject.GType<UsbProtection>;
}
enum UsbProtection {
LOCKSCREEN,
ALWAYS,
}
export namespace VisualBellType {
export const $gtype: GObject.GType<VisualBellType>;
}
enum VisualBellType {
FULLSCREEN_FLASH,
FRAME_FLASH,
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default GDesktopEnums;
}
declare module 'gi://GDesktopEnums' {
import GDesktopEnums30 from 'gi://GDesktopEnums?version=3.0';
export default GDesktopEnums30;
}
// END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,264 +0,0 @@
/// <reference path="./gdkpixbuf-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://GdkPixdata?version=2.0' {
// Module dependencies
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace GdkPixdata {
/**
* GdkPixdata-2.0
*/
/**
* Magic number for #GdkPixdata structures.
*/
const PIXBUF_MAGIC_NUMBER: number;
/**
* The length of a #GdkPixdata structure without the `pixel_data` pointer.
*/
const PIXDATA_HEADER_LENGTH: number;
/**
* Converts a `GdkPixdata` to a `GdkPixbuf`.
*
* If `copy_pixels` is `TRUE` or if the pixel data is run-length-encoded,
* the pixel data is copied into newly-allocated memory; otherwise it is
* reused.
* @param pixdata a #GdkPixdata to convert into a `GdkPixbuf`.
* @param copy_pixels whether to copy raw pixel data; run-length encoded pixel data is always copied.
* @returns a new pixbuf
*/
function pixbuf_from_pixdata(pixdata: Pixdata, copy_pixels: boolean): GdkPixbuf.Pixbuf;
/**
* An enumeration which is used by gdk_pixdata_to_csource() to
* determine the form of C source to be generated. The three values
* `GDK_PIXDATA_DUMP_PIXDATA_STREAM,` `GDK_PIXDATA_DUMP_PIXDATA_STRUCT`
* and `GDK_PIXDATA_DUMP_MACROS` are mutually exclusive, as are
* `GDK_PIXBUF_DUMP_GTYPES` and `GDK_PIXBUF_DUMP_CTYPES`. The remaining
* elements are optional flags that can be freely added.
*/
/**
* An enumeration which is used by gdk_pixdata_to_csource() to
* determine the form of C source to be generated. The three values
* `GDK_PIXDATA_DUMP_PIXDATA_STREAM,` `GDK_PIXDATA_DUMP_PIXDATA_STRUCT`
* and `GDK_PIXDATA_DUMP_MACROS` are mutually exclusive, as are
* `GDK_PIXBUF_DUMP_GTYPES` and `GDK_PIXBUF_DUMP_CTYPES`. The remaining
* elements are optional flags that can be freely added.
*/
export namespace PixdataDumpType {
export const $gtype: GObject.GType<PixdataDumpType>;
}
enum PixdataDumpType {
/**
* Generate pixbuf data stream (a single
* string containing a serialized #GdkPixdata structure in network byte
* order).
*/
PIXDATA_STREAM,
/**
* Generate #GdkPixdata structure (needs
* the #GdkPixdata structure definition from gdk-pixdata.h).
*/
PIXDATA_STRUCT,
/**
* Generate <function>*_ROWSTRIDE</function>,
* <function>*_WIDTH</function>, <function>*_HEIGHT</function>,
* <function>*_BYTES_PER_PIXEL</function> and
* <function>*_RLE_PIXEL_DATA</function> or <function>*_PIXEL_DATA</function>
* macro definitions for the image.
*/
MACROS,
/**
* Generate GLib data types instead of
* standard C data types.
*/
GTYPES,
/**
* Generate standard C data types instead of
* GLib data types.
*/
CTYPES,
/**
* Generate static symbols.
*/
STATIC,
/**
* Generate const symbols.
*/
CONST,
/**
* Provide a <function>*_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp)</function>
* macro definition to decode run-length encoded image data.
*/
RLE_DECODER,
}
/**
* An enumeration containing three sets of flags for a #GdkPixdata struct:
* one for the used colorspace, one for the width of the samples and one
* for the encoding of the pixel data.
*/
/**
* An enumeration containing three sets of flags for a #GdkPixdata struct:
* one for the used colorspace, one for the width of the samples and one
* for the encoding of the pixel data.
*/
export namespace PixdataType {
export const $gtype: GObject.GType<PixdataType>;
}
enum PixdataType {
/**
* each pixel has red, green and blue samples.
*/
COLOR_TYPE_RGB,
/**
* each pixel has red, green and blue samples
* and an alpha value.
*/
COLOR_TYPE_RGBA,
/**
* mask for the colortype flags of the enum.
*/
COLOR_TYPE_MASK,
/**
* each sample has 8 bits.
*/
SAMPLE_WIDTH_8,
/**
* mask for the sample width flags of the enum.
*/
SAMPLE_WIDTH_MASK,
/**
* the pixel data is in raw form.
*/
ENCODING_RAW,
/**
* the pixel data is run-length encoded. Runs may
* be up to 127 bytes long; their length is stored in a single byte
* preceding the pixel data for the run. If a run is constant, its length
* byte has the high bit set and the pixel data consists of a single pixel
* which must be repeated.
*/
ENCODING_RLE,
/**
* mask for the encoding flags of the enum.
*/
ENCODING_MASK,
}
/**
* A pixel buffer suitable for serialization and streaming.
*
* Using `GdkPixdata`, images can be compiled into an application,
* making it unnecessary to refer to external image files at runtime.
*
* `GdkPixbuf` includes a utility named `gdk-pixbuf-csource`, which
* can be used to convert image files into `GdkPixdata` structures suitable
* for inclusion in C sources. To convert the `GdkPixdata` structures back
* into a `GdkPixbuf`, use `gdk_pixbuf_from_pixdata()`.
*/
class Pixdata {
static $gtype: GObject.GType<Pixdata>;
// Fields
magic: number;
length: number;
pixdata_type: number;
rowstride: number;
width: number;
height: number;
pixel_data: Uint8Array;
// Constructors
constructor(
properties?: Partial<{
magic: number;
length: number;
pixdata_type: number;
rowstride: number;
width: number;
height: number;
pixel_data: Uint8Array;
}>,
);
_init(...args: any[]): void;
// Methods
/**
* Deserializes (reconstruct) a #GdkPixdata structure from a byte stream.
*
* The byte stream consists of a straightforward writeout of the
* `GdkPixdata` fields in network byte order, plus the `pixel_data`
* bytes the structure points to.
*
* The `pixdata` contents are reconstructed byte by byte and are checked
* for validity.
*
* This function may fail with `GDK_PIXBUF_ERROR_CORRUPT_IMAGE`
* or `GDK_PIXBUF_ERROR_UNKNOWN_TYPE`.
* @param stream stream of bytes containing a serialized #GdkPixdata structure.
* @returns Upon successful deserialization `TRUE` is returned, `FALSE` otherwise.
*/
deserialize(stream: Uint8Array | string): boolean;
/**
* Serializes a #GdkPixdata structure into a byte stream.
* The byte stream consists of a straightforward writeout of the
* #GdkPixdata fields in network byte order, plus the `pixel_data`
* bytes the structure points to.
* @returns A newly-allocated string containing the serialized #GdkPixdata structure.
*/
serialize(): Uint8Array;
/**
* Generates C source code suitable for compiling images directly
* into programs.
*
* GdkPixbuf ships with a program called `gdk-pixbuf-csource`, which offers
* a command line interface to this function.
* @param name used for naming generated data structures or macros
* @param dump_type the kind of C source to be generated
* @returns a newly-allocated string buffer containing the C source form of `pixdata`.
*/
to_csource(name: string, dump_type: PixdataDumpType | null): GLib.String;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default GdkPixdata;
}
declare module 'gi://GdkPixdata' {
import GdkPixdata20 from 'gi://GdkPixdata?version=2.0';
export default GdkPixdata20;
}
// END

File diff suppressed because it is too large Load Diff

View File

@ -1,312 +0,0 @@
/// <reference path="./xlib-2.0.d.ts" />
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./cairo.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./gdkpixbuf-2.0.d.ts" />
/// <reference path="./gdk-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://GdkX11?version=2.0' {
// Module dependencies
import type xlib from 'gi://xlib?version=2.0';
import type Pango from 'gi://Pango?version=1.0';
import type cairo from 'cairo';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type Gdk from 'gi://Gdk?version=2.0';
export namespace GdkX11 {
/**
* GdkX11-2.0
*/
function net_wm_supports(property: Gdk.Atom): boolean;
/**
* Converts from a #GdkAtom to the X atom for the default GDK display
* with the same string value.
* @param atom A #GdkAtom
* @returns the X atom corresponding to @atom.
*/
function x11_atom_to_xatom(atom: Gdk.Atom): xlib.Atom;
/**
* Converts from a #GdkAtom to the X atom for a #GdkDisplay
* with the same string value. The special value %GDK_NONE
* is converted to %None.
* @param display A #GdkDisplay
* @param atom A #GdkAtom, or %GDK_NONE
* @returns the X atom corresponding to @atom, or %None
*/
function x11_atom_to_xatom_for_display(display: Gdk.Display, atom: Gdk.Atom): xlib.Atom;
/**
* Returns the X colormap belonging to a #GdkColormap.
* @param colormap a #GdkColormap.
* @returns an Xlib <type>Colormap</type>.
*/
function x11_colormap_get_xcolormap(colormap: Gdk.Colormap): xlib.Colormap;
/**
* Returns the X cursor belonging to a #GdkCursor.
* @param cursor a #GdkCursor.
* @returns an Xlib <type>Cursor</type>.
*/
function x11_cursor_get_xcursor(cursor: Gdk.Cursor): xlib.Cursor;
/**
* Gets the startup notification ID for a display.
* @param display a #GdkDisplay
* @returns the startup notification ID for @display
*/
function x11_display_get_startup_notification_id(display: Gdk.Display): string;
/**
* Returns the timestamp of the last user interaction on
* `display`. The timestamp is taken from events caused
* by user interaction such as key presses or pointer
* movements. See gdk_x11_window_set_user_time().
* @param display a #GdkDisplay
* @returns the timestamp of the last user interaction
*/
function x11_display_get_user_time(display: Gdk.Display): number;
/**
* Call XGrabServer() on `display`.
* To ungrab the display again, use gdk_x11_display_ungrab().
*
* gdk_x11_display_grab()/gdk_x11_display_ungrab() calls can be nested.
* @param display a #GdkDisplay
*/
function x11_display_grab(display: Gdk.Display): void;
/**
* Sets the cursor theme from which the images for cursor
* should be taken.
*
* If the windowing system supports it, existing cursors created
* with gdk_cursor_new(), gdk_cursor_new_for_display() and
* gdk_cursor_new_for_name() are updated to reflect the theme
* change. Custom cursors constructed with gdk_cursor_new_from_pixmap()
* or gdk_cursor_new_from_pixbuf() will have to be handled
* by the application (GTK+ applications can learn about
* cursor theme changes by listening for change notification
* for the corresponding #GtkSetting).
* @param display a #GdkDisplay
* @param theme the name of the cursor theme to use, or %NULL to unset a previously set value
* @param size the cursor size to use, or 0 to keep the previous size
*/
function x11_display_set_cursor_theme(display: Gdk.Display, theme: string, size: number): void;
function x11_display_string_to_compound_text(
display: Gdk.Display,
str: string,
encoding: Gdk.Atom,
format: number,
ctext: number,
length: number,
): number;
function x11_display_text_property_to_text_list(
display: Gdk.Display,
encoding: Gdk.Atom,
format: number,
text: number,
length: number,
list: string,
): number;
/**
* Ungrab `display` after it has been grabbed with
* gdk_x11_display_grab().
* @param display a #GdkDisplay
*/
function x11_display_ungrab(display: Gdk.Display): void;
function x11_display_utf8_to_compound_text(
display: Gdk.Display,
str: string,
encoding: Gdk.Atom,
format: number,
ctext: number,
length: number,
): boolean;
/**
* Returns the X resource (window or pixmap) belonging to a #GdkDrawable.
* @param drawable a #GdkDrawable.
* @returns the ID of @drawable's X resource.
*/
function x11_drawable_get_xid(drawable: Gdk.Drawable): xlib.XID;
function x11_font_get_name(font: Gdk.Font): string;
function x11_font_get_xfont(font: Gdk.Font): any | null;
function x11_free_compound_text(ctext: number): void;
function x11_free_text_list(list: string): void;
/**
* Gets the root window of the default screen
* (see gdk_x11_get_default_screen()).
* @returns an Xlib <type>Window</type>.
*/
function x11_get_default_root_xwindow(): xlib.Window;
/**
* Gets the default GTK+ screen number.
* @returns returns the screen number specified by the --display command line option or the DISPLAY environment variable when gdk_init() calls XOpenDisplay().
*/
function x11_get_default_screen(): number;
function x11_get_server_time(window: Gdk.Window): number;
/**
* Returns the X atom for GDK's default display corresponding to `atom_name`.
* This function caches the result, so if called repeatedly it is much
* faster than XInternAtom(), which is a round trip to the server each time.
* @param atom_name a string
* @returns a X atom for GDK's default display.
*/
function x11_get_xatom_by_name(atom_name: string): xlib.Atom;
/**
* Returns the X atom for a #GdkDisplay corresponding to `atom_name`.
* This function caches the result, so if called repeatedly it is much
* faster than XInternAtom(), which is a round trip to the server each time.
* @param display a #GdkDisplay
* @param atom_name a string
* @returns a X atom for a #GdkDisplay
*/
function x11_get_xatom_by_name_for_display(display: Gdk.Display, atom_name: string): xlib.Atom;
/**
* Returns the name of an X atom for GDK's default display. This
* function is meant mainly for debugging, so for convenience, unlike
* <function>XAtomName()</function> and gdk_atom_name(), the result
* doesn't need to be freed. Also, this function will never return %NULL,
* even if `xatom` is invalid.
* @param xatom an X atom for GDK's default display
* @returns name of the X atom; this string is owned by GTK+, so it shouldn't be modifed or freed.
*/
function x11_get_xatom_name(xatom: xlib.Atom): string;
/**
* Returns the name of an X atom for its display. This
* function is meant mainly for debugging, so for convenience, unlike
* XAtomName() and gdk_atom_name(), the result doesn't need to
* be freed.
* @param display the #GdkDisplay where @xatom is defined
* @param xatom an X atom
* @returns name of the X atom; this string is owned by GDK, so it shouldn't be modifed or freed.
*/
function x11_get_xatom_name_for_display(display: Gdk.Display, xatom: xlib.Atom): string;
/**
* Call gdk_x11_display_grab() on the default display.
* To ungrab the server again, use gdk_x11_ungrab_server().
*
* gdk_x11_grab_server()/gdk_x11_ungrab_server() calls can be nested.
*/
function x11_grab_server(): void;
function x11_register_standard_event_type(display: Gdk.Display, event_base: number, n_events: number): void;
/**
* Gets the XID of the specified output/monitor.
* If the X server does not support version 1.2 of the RANDR
* extension, 0 is returned.
* @param screen a #GdkScreen
* @param monitor_num number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
* @returns the XID of the monitor
*/
function x11_screen_get_monitor_output(screen: Gdk.Screen, monitor_num: number): xlib.XID;
/**
* Returns the index of a #GdkScreen.
* @param screen a #GdkScreen.
* @returns the position of @screen among the screens of its display.
*/
function x11_screen_get_screen_number(screen: Gdk.Screen): number;
function x11_screen_get_window_manager_name(screen: Gdk.Screen): string;
/**
* Returns the screen of a #GdkScreen.
* @param screen a #GdkScreen.
* @returns an Xlib <type>Screen*</type>
*/
function x11_screen_get_xscreen(screen: Gdk.Screen): xlib.Screen;
/**
* Looks up the #GdkVisual for a particular screen and X Visual ID.
* @param screen a #GdkScreen.
* @param xvisualid an X Visual ID.
* @returns the #GdkVisual (owned by the screen object), or %NULL if the visual ID wasn't found.
*/
function x11_screen_lookup_visual(screen: Gdk.Screen, xvisualid: xlib.VisualID): Gdk.Visual;
function x11_screen_supports_net_wm_hint(screen: Gdk.Screen, property: Gdk.Atom): boolean;
/**
* Sets the <literal>SM_CLIENT_ID</literal> property on the application's leader window so that
* the window manager can save the application's state using the X11R6 ICCCM
* session management protocol.
*
* See the X Session Management Library documentation for more information on
* session management and the Inter-Client Communication Conventions Manual
* @param sm_client_id the client id assigned by the session manager when the connection was opened, or %NULL to remove the property.
*/
function x11_set_sm_client_id(sm_client_id: string): void;
/**
* Ungrab the default display after it has been grabbed with
* gdk_x11_grab_server().
*/
function x11_ungrab_server(): void;
/**
* Moves the window to the correct workspace when running under a
* window manager that supports multiple workspaces, as described
* in the <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended
* Window Manager Hints</ulink>. Will not do anything if the
* window is already on all workspaces.
* @param window a #GdkWindow
*/
function x11_window_move_to_current_desktop(window: Gdk.Window): void;
/**
* The application can use this call to update the _NET_WM_USER_TIME
* property on a toplevel window. This property stores an Xserver
* time which represents the time of the last user input event
* received for this window. This property may be used by the window
* manager to alter the focus, stacking, and/or placement behavior of
* windows when they are mapped depending on whether the new window
* was created by a user action or is a "pop-up" window activated by a
* timer or some other event.
*
* Note that this property is automatically updated by GDK, so this
* function should only be used by applications which handle input
* events bypassing GDK.
* @param window A toplevel #GdkWindow
* @param timestamp An XServer timestamp to which the property should be set
*/
function x11_window_set_user_time(window: Gdk.Window, timestamp: number): void;
/**
* Returns the Gdk object associated with the given X id for the default
* display.
* @param xid an X id.
* @returns the associated Gdk object, which may be a #GdkPixmap, a #GdkWindow or a #GdkFont or %NULL if no object is associated with the X id.
*/
function xid_table_lookup(xid: xlib.XID): any | null;
/**
* Returns the GDK object associated with the given X id.
* @param display the #GdkDisplay.
* @param xid an X id.
* @returns the associated Gdk object, which may be a #GdkPixmap, a #GdkWindow or a #GdkFont or %NULL if no object is associated with the X id.
*/
function xid_table_lookup_for_display(display: Gdk.Display, xid: xlib.XID): any | null;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default GdkX11;
}
declare module 'gi://GdkX11' {
import GdkX1120 from 'gi://GdkX11?version=2.0';
export default GdkX1120;
}
// END

View File

@ -1,892 +0,0 @@
/// <reference path="./xlib-2.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./cairo.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./gdkpixbuf-2.0.d.ts" />
/// <reference path="./gdk-3.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://GdkX11?version=3.0' {
// Module dependencies
import type xlib from 'gi://xlib?version=2.0';
import type cairo from 'cairo';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type Gdk from 'gi://Gdk?version=3.0';
export namespace GdkX11 {
/**
* GdkX11-3.0
*/
/**
* Converts from a #GdkAtom to the X atom for the default GDK display
* with the same string value.
* @param atom A #GdkAtom
* @returns the X atom corresponding to @atom.
*/
function x11_atom_to_xatom(atom: Gdk.Atom): xlib.Atom;
/**
* Converts from a #GdkAtom to the X atom for a #GdkDisplay
* with the same string value. The special value %GDK_NONE
* is converted to %None.
* @param display A #GdkDisplay
* @param atom A #GdkAtom, or %GDK_NONE
* @returns the X atom corresponding to @atom, or %None
*/
function x11_atom_to_xatom_for_display(display: X11Display, atom: Gdk.Atom): xlib.Atom;
/**
* Returns the device ID as seen by XInput2.
*
* > If gdk_disable_multidevice() has been called, this function
* > will respectively return 2/3 for the core pointer and keyboard,
* > (matching the IDs for the Virtual Core Pointer and Keyboard in
* > XInput 2), but calling this function on any slave devices (i.e.
* > those managed via XInput 1.x), will return 0.
* @param device a #GdkDevice
* @returns the XInput2 device ID.
*/
function x11_device_get_id(device: X11DeviceCore): number;
/**
* Returns the #GdkDevice that wraps the given device ID.
* @param device_manager a #GdkDeviceManager
* @param device_id a device ID, as understood by the XInput2 protocol
* @returns The #GdkDevice wrapping the device ID, or %NULL if the given ID doesnt currently represent a device.
*/
function x11_device_manager_lookup(
device_manager: X11DeviceManagerCore,
device_id: number,
): X11DeviceCore | null;
/**
* Frees the data returned from gdk_x11_display_string_to_compound_text().
* @param ctext The pointer stored in @ctext from a call to gdk_x11_display_string_to_compound_text().
*/
function x11_free_compound_text(ctext: number): void;
/**
* Frees the array of strings created by
* gdk_x11_display_text_property_to_text_list().
* @param list the value stored in the @list parameter by a call to gdk_x11_display_text_property_to_text_list().
*/
function x11_free_text_list(list: string): void;
/**
* Gets the root window of the default screen
* (see gdk_x11_get_default_screen()).
* @returns an Xlib Window.
*/
function x11_get_default_root_xwindow(): xlib.Window;
/**
* Gets the default GTK+ screen number.
* @returns returns the screen number specified by the --display command line option or the DISPLAY environment variable when gdk_init() calls XOpenDisplay().
*/
function x11_get_default_screen(): number;
/**
* Gets the default GTK+ display.
* @returns the Xlib Display* for the display specified in the `--display` command line option or the `DISPLAY` environment variable.
*/
function x11_get_default_xdisplay(): xlib.Display;
/**
* Used with gdk_window_set_background_pattern() to inherit background from
* parent window. Useful for imitating transparency when compositing is not
* available. Otherwise behaves like a transparent pattern.
*/
function x11_get_parent_relative_pattern(): cairo.Pattern;
/**
* Routine to get the current X server time stamp.
* @param window a #GdkWindow, used for communication with the server. The window must have GDK_PROPERTY_CHANGE_MASK in its events mask or a hang will result.
* @returns the time stamp.
*/
function x11_get_server_time(window: X11Window): number;
/**
* Returns the X atom for GDKs default display corresponding to `atom_name`.
* This function caches the result, so if called repeatedly it is much
* faster than XInternAtom(), which is a round trip to the server each time.
* @param atom_name a string
* @returns a X atom for GDKs default display.
*/
function x11_get_xatom_by_name(atom_name: string): xlib.Atom;
/**
* Returns the X atom for a #GdkDisplay corresponding to `atom_name`.
* This function caches the result, so if called repeatedly it is much
* faster than XInternAtom(), which is a round trip to the server each time.
* @param display a #GdkDisplay
* @param atom_name a string
* @returns a X atom for a #GdkDisplay
*/
function x11_get_xatom_by_name_for_display(display: X11Display, atom_name: string): xlib.Atom;
/**
* Returns the name of an X atom for GDKs default display. This
* function is meant mainly for debugging, so for convenience, unlike
* XAtomName() and gdk_atom_name(), the result
* doesnt need to be freed. Also, this function will never return %NULL,
* even if `xatom` is invalid.
* @param xatom an X atom for GDKs default display
* @returns name of the X atom; this string is owned by GTK+, so it shouldnt be modifed or freed.
*/
function x11_get_xatom_name(xatom: xlib.Atom): string;
/**
* Returns the name of an X atom for its display. This
* function is meant mainly for debugging, so for convenience, unlike
* XAtomName() and gdk_atom_name(), the result doesnt need to
* be freed.
* @param display the #GdkDisplay where @xatom is defined
* @param xatom an X atom
* @returns name of the X atom; this string is owned by GDK, so it shouldnt be modifed or freed.
*/
function x11_get_xatom_name_for_display(display: X11Display, xatom: xlib.Atom): string;
/**
* Call gdk_x11_display_grab() on the default display.
* To ungrab the server again, use gdk_x11_ungrab_server().
*
* gdk_x11_grab_server()/gdk_x11_ungrab_server() calls can be nested.
*/
function x11_grab_server(): void;
/**
* Find the #GdkDisplay corresponding to `xdisplay,` if any exists.
* @param xdisplay a pointer to an X Display
* @returns the #GdkDisplay, if found, otherwise %NULL.
*/
function x11_lookup_xdisplay(xdisplay: xlib.Display): X11Display;
/**
* Registers interest in receiving extension events with type codes
* between `event_base` and `event_base + n_events - 1`.
* The registered events must have the window field in the same place
* as core X events (this is not the case for e.g. XKB extension events).
*
* If an event type is registered, events of this type will go through
* global and window-specific filters (see gdk_window_add_filter()).
* Unregistered events will only go through global filters.
* GDK may register the events of some X extensions on its own.
*
* This function should only be needed in unusual circumstances, e.g.
* when filtering XInput extension events on the root window.
* @param display a #GdkDisplay
* @param event_base first event type code to register
* @param n_events number of event type codes to register
*/
function x11_register_standard_event_type(display: X11Display, event_base: number, n_events: number): void;
/**
* Sets the `SM_CLIENT_ID` property on the applications leader window so that
* the window manager can save the applications state using the X11R6 ICCCM
* session management protocol.
*
* See the X Session Management Library documentation for more information on
* session management and the Inter-Client Communication Conventions Manual
* @param sm_client_id the client id assigned by the session manager when the connection was opened, or %NULL to remove the property.
*/
function x11_set_sm_client_id(sm_client_id?: string | null): void;
/**
* Ungrab the default display after it has been grabbed with
* gdk_x11_grab_server().
*/
function x11_ungrab_server(): void;
/**
* Convert from an X atom for the default display to the corresponding
* #GdkAtom.
* @param xatom an X atom for the default GDK display
* @returns the corresponding G#dkAtom.
*/
function x11_xatom_to_atom(xatom: xlib.Atom): Gdk.Atom;
/**
* Convert from an X atom for a #GdkDisplay to the corresponding
* #GdkAtom.
* @param display A #GdkDisplay
* @param xatom an X atom
* @returns the corresponding #GdkAtom.
*/
function x11_xatom_to_atom_for_display(display: X11Display, xatom: xlib.Atom): Gdk.Atom;
namespace X11AppLaunchContext {
// Constructor properties interface
interface ConstructorProps extends Gdk.AppLaunchContext.ConstructorProps {}
}
class X11AppLaunchContext extends Gdk.AppLaunchContext {
static $gtype: GObject.GType<X11AppLaunchContext>;
// Constructors
constructor(properties?: Partial<X11AppLaunchContext.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace X11Cursor {
// Constructor properties interface
interface ConstructorProps extends Gdk.Cursor.ConstructorProps {}
}
class X11Cursor extends Gdk.Cursor {
static $gtype: GObject.GType<X11Cursor>;
// Constructors
constructor(properties?: Partial<X11Cursor.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Returns the X cursor belonging to a #GdkCursor.
* @returns an Xlib Cursor.
*/
get_xcursor(): xlib.Cursor;
/**
* Returns the display of a #GdkCursor.
* @returns an Xlib Display*.
*/
get_xdisplay(): xlib.Display;
}
namespace X11DeviceCore {
// Constructor properties interface
interface ConstructorProps extends Gdk.Device.ConstructorProps {}
}
class X11DeviceCore extends Gdk.Device {
static $gtype: GObject.GType<X11DeviceCore>;
// Constructors
constructor(properties?: Partial<X11DeviceCore.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace X11DeviceManagerCore {
// Constructor properties interface
interface ConstructorProps extends Gdk.DeviceManager.ConstructorProps {}
}
class X11DeviceManagerCore extends Gdk.DeviceManager {
static $gtype: GObject.GType<X11DeviceManagerCore>;
// Constructors
constructor(properties?: Partial<X11DeviceManagerCore.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace X11DeviceManagerXI2 {
// Constructor properties interface
interface ConstructorProps extends X11DeviceManagerCore.ConstructorProps {
major: number;
minor: number;
opcode: number;
}
}
class X11DeviceManagerXI2 extends X11DeviceManagerCore {
static $gtype: GObject.GType<X11DeviceManagerXI2>;
// Properties
get major(): number;
get minor(): number;
get opcode(): number;
// Constructors
constructor(properties?: Partial<X11DeviceManagerXI2.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace X11DeviceXI2 {
// Constructor properties interface
interface ConstructorProps extends Gdk.Device.ConstructorProps {
device_id: number;
deviceId: number;
}
}
class X11DeviceXI2 extends Gdk.Device {
static $gtype: GObject.GType<X11DeviceXI2>;
// Properties
get device_id(): number;
get deviceId(): number;
// Constructors
constructor(properties?: Partial<X11DeviceXI2.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace X11Display {
// Constructor properties interface
interface ConstructorProps extends Gdk.Display.ConstructorProps {}
}
class X11Display extends Gdk.Display {
static $gtype: GObject.GType<X11Display>;
// Constructors
constructor(properties?: Partial<X11Display.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Static methods
/**
* Retrieves the version of the GLX implementation.
* @param display a #GdkDisplay
*/
static get_glx_version(display: Gdk.Display): [boolean, number, number];
// Methods
/**
* Pops the error trap pushed by gdk_x11_display_error_trap_push().
* Will XSync() if necessary and will always block until
* the error is known to have occurred or not occurred,
* so the error code can be returned.
*
* If you dont need to use the return value,
* gdk_x11_display_error_trap_pop_ignored() would be more efficient.
*
* See gdk_error_trap_pop() for the all-displays-at-once
* equivalent.
* @returns X error code or 0 on success
*/
error_trap_pop(): number;
/**
* Pops the error trap pushed by gdk_x11_display_error_trap_push().
* Does not block to see if an error occurred; merely records the
* range of requests to ignore errors for, and ignores those errors
* if they arrive asynchronously.
*
* See gdk_error_trap_pop_ignored() for the all-displays-at-once
* equivalent.
*/
error_trap_pop_ignored(): void;
/**
* Begins a range of X requests on `display` for which X error events
* will be ignored. Unignored errors (when no trap is pushed) will abort
* the application. Use gdk_x11_display_error_trap_pop() or
* gdk_x11_display_error_trap_pop_ignored()to lift a trap pushed
* with this function.
*
* See also gdk_error_trap_push() to push a trap on all displays.
*/
error_trap_push(): void;
/**
* Gets the startup notification ID for a display.
* @returns the startup notification ID for @display
*/
get_startup_notification_id(): string;
/**
* Returns the timestamp of the last user interaction on
* `display`. The timestamp is taken from events caused
* by user interaction such as key presses or pointer
* movements. See gdk_x11_window_set_user_time().
* @returns the timestamp of the last user interaction
*/
get_user_time(): number;
/**
* Returns the X display of a #GdkDisplay.
* @returns an X display
*/
get_xdisplay(): xlib.Display;
/**
* Call XGrabServer() on `display`.
* To ungrab the display again, use gdk_x11_display_ungrab().
*
* gdk_x11_display_grab()/gdk_x11_display_ungrab() calls can be nested.
*/
grab(): void;
/**
* Sets the cursor theme from which the images for cursor
* should be taken.
*
* If the windowing system supports it, existing cursors created
* with gdk_cursor_new(), gdk_cursor_new_for_display() and
* gdk_cursor_new_from_name() are updated to reflect the theme
* change. Custom cursors constructed with
* gdk_cursor_new_from_pixbuf() will have to be handled
* by the application (GTK+ applications can learn about
* cursor theme changes by listening for change notification
* for the corresponding #GtkSetting).
* @param theme the name of the cursor theme to use, or %NULL to unset a previously set value
* @param size the cursor size to use, or 0 to keep the previous size
*/
set_cursor_theme(theme: string | null, size: number): void;
/**
* Sets the startup notification ID for a display.
*
* This is usually taken from the value of the DESKTOP_STARTUP_ID
* environment variable, but in some cases (such as the application not
* being launched using exec()) it can come from other sources.
*
* If the ID contains the string "_TIME" then the portion following that
* string is taken to be the X11 timestamp of the event that triggered
* the application to be launched and the GDK current event time is set
* accordingly.
*
* The startup ID is also what is used to signal that the startup is
* complete (for example, when opening a window or when calling
* gdk_notify_startup_complete()).
* @param startup_id the startup notification ID (must be valid utf8)
*/
set_startup_notification_id(startup_id: string): void;
/**
* Forces a specific window scale for all windows on this display,
* instead of using the default or user configured scale. This
* is can be used to disable scaling support by setting `scale` to
* 1, or to programmatically set the window scale.
*
* Once the scale is set by this call it will not change in response
* to later user configuration changes.
* @param scale The new scale value
*/
set_window_scale(scale: number): void;
/**
* Convert a string from the encoding of the current
* locale into a form suitable for storing in a window property.
* @param str a nul-terminated string
* @returns 0 upon success, non-zero upon failure
*/
string_to_compound_text(str: string): [number, Gdk.Atom, number, Uint8Array];
/**
* Convert a text string from the encoding as it is stored
* in a property into an array of strings in the encoding of
* the current locale. (The elements of the array represent the
* nul-separated elements of the original text string.)
* @param encoding an atom representing the encoding. The most common values for this are STRING, or COMPOUND_TEXT. This is value used as the type for the property
* @param format the format of the property
* @param text The text data
* @param length The number of items to transform
* @param list location to store an array of strings in the encoding of the current locale. This array should be freed using gdk_free_text_list().
* @returns the number of strings stored in list, or 0, if the conversion failed
*/
text_property_to_text_list(
encoding: Gdk.Atom,
format: number,
text: number,
length: number,
list: string,
): number;
/**
* Ungrab `display` after it has been grabbed with
* gdk_x11_display_grab().
*/
ungrab(): void;
/**
* Converts from UTF-8 to compound text.
* @param str a UTF-8 string
* @returns %TRUE if the conversion succeeded, otherwise %FALSE
*/
utf8_to_compound_text(str: string): [boolean, Gdk.Atom, number, Uint8Array];
}
namespace X11DisplayManager {
// Constructor properties interface
interface ConstructorProps extends Gdk.DisplayManager.ConstructorProps {}
}
class X11DisplayManager extends Gdk.DisplayManager {
static $gtype: GObject.GType<X11DisplayManager>;
// Constructors
constructor(properties?: Partial<X11DisplayManager.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace X11DragContext {
// Constructor properties interface
interface ConstructorProps extends Gdk.DragContext.ConstructorProps {}
}
class X11DragContext extends Gdk.DragContext {
static $gtype: GObject.GType<X11DragContext>;
// Constructors
constructor(properties?: Partial<X11DragContext.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace X11GLContext {
// Constructor properties interface
interface ConstructorProps extends Gdk.GLContext.ConstructorProps {}
}
class X11GLContext extends Gdk.GLContext {
static $gtype: GObject.GType<X11GLContext>;
// Constructors
constructor(properties?: Partial<X11GLContext.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace X11Keymap {
// Constructor properties interface
interface ConstructorProps extends Gdk.Keymap.ConstructorProps {}
}
class X11Keymap extends Gdk.Keymap {
static $gtype: GObject.GType<X11Keymap>;
// Constructors
constructor(properties?: Partial<X11Keymap.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Extracts the group from the state field sent in an X Key event.
* This is only needed for code processing raw X events, since #GdkEventKey
* directly includes an is_modifier field.
* @param state raw state returned from X
* @returns the index of the active keyboard group for the event
*/
get_group_for_state(state: number): number;
/**
* Determines whether a particular key code represents a key that
* is a modifier. That is, its a key that normally just affects
* the keyboard state and the behavior of other keys rather than
* producing a direct effect itself. This is only needed for code
* processing raw X events, since #GdkEventKey directly includes
* an is_modifier field.
* @param keycode the hardware keycode from a key event
* @returns %TRUE if the hardware keycode is a modifier key
*/
key_is_modifier(keycode: number): boolean;
}
namespace X11Monitor {
// Constructor properties interface
interface ConstructorProps extends Gdk.Monitor.ConstructorProps {}
}
class X11Monitor extends Gdk.Monitor {
static $gtype: GObject.GType<X11Monitor>;
// Constructors
constructor(properties?: Partial<X11Monitor.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Static methods
static get_output(monitor: Gdk.Monitor): xlib.XID;
}
namespace X11Screen {
// Signal callback interfaces
interface WindowManagerChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends Gdk.Screen.ConstructorProps {}
}
class X11Screen extends Gdk.Screen {
static $gtype: GObject.GType<X11Screen>;
// Constructors
constructor(properties?: Partial<X11Screen.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'window-manager-changed', callback: (_source: this) => void): number;
connect_after(signal: 'window-manager-changed', callback: (_source: this) => void): number;
emit(signal: 'window-manager-changed'): void;
// Methods
/**
* Returns the current workspace for `screen` when running under a
* window manager that supports multiple workspaces, as described
* in the
* [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
* @returns the current workspace, or 0 if workspaces are not supported
*/
get_current_desktop(): number;
/**
* Gets the XID of the specified output/monitor.
* If the X server does not support version 1.2 of the RANDR
* extension, 0 is returned.
* @param monitor_num number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
* @returns the XID of the monitor
*/
get_monitor_output(monitor_num: number): xlib.XID;
/**
* Returns the number of workspaces for `screen` when running under a
* window manager that supports multiple workspaces, as described
* in the
* [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
* @returns the number of workspaces, or 0 if workspaces are not supported
*/
get_number_of_desktops(): number;
/**
* Returns the index of a #GdkScreen.
* @returns the position of @screen among the screens of its display
*/
get_screen_number(): number;
/**
* Returns the name of the window manager for `screen`.
* @returns the name of the window manager screen @screen, or "unknown" if the window manager is unknown. The string is owned by GDK and should not be freed.
*/
get_window_manager_name(): string;
/**
* Returns the screen of a #GdkScreen.
* @returns an Xlib Screen*
*/
get_xscreen(): xlib.Screen;
/**
* Looks up the #GdkVisual for a particular screen and X Visual ID.
* @param xvisualid an X Visual ID.
* @returns the #GdkVisual (owned by the screen object), or %NULL if the visual ID wasnt found.
*/
lookup_visual(xvisualid: xlib.VisualID): X11Visual;
/**
* This function is specific to the X11 backend of GDK, and indicates
* whether the window manager supports a certain hint from the
* [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
*
* When using this function, keep in mind that the window manager
* can change over time; so you shouldnt use this function in
* a way that impacts persistent application state. A common bug
* is that your application can start up before the window manager
* does when the user logs in, and before the window manager starts
* gdk_x11_screen_supports_net_wm_hint() will return %FALSE for every property.
* You can monitor the window_manager_changed signal on #GdkScreen to detect
* a window manager change.
* @param property a property atom.
* @returns %TRUE if the window manager supports @property
*/
supports_net_wm_hint(property: Gdk.Atom): boolean;
}
namespace X11Visual {
// Constructor properties interface
interface ConstructorProps extends Gdk.Visual.ConstructorProps {}
}
class X11Visual extends Gdk.Visual {
static $gtype: GObject.GType<X11Visual>;
// Constructors
constructor(properties?: Partial<X11Visual.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Returns the X visual belonging to a #GdkVisual.
* @returns an Xlib Visual*.
*/
get_xvisual(): xlib.Visual;
}
namespace X11Window {
// Constructor properties interface
interface ConstructorProps extends Gdk.Window.ConstructorProps {}
}
class X11Window extends Gdk.Window {
static $gtype: GObject.GType<X11Window>;
// Constructors
constructor(properties?: Partial<X11Window.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static foreign_new_for_display(display: X11Display, window: xlib.Window): X11Window;
// Static methods
/**
* Looks up the #GdkWindow that wraps the given native window handle.
* @param display the #GdkDisplay corresponding to the window handle
* @param window an Xlib Window
*/
static lookup_for_display(display: X11Display, window: xlib.Window): X11Window;
// Methods
/**
* Gets the number of the workspace `window` is on.
* @returns the current workspace of @window
*/
get_desktop(): number;
/**
* Returns the X resource (window) belonging to a #GdkWindow.
* @returns the ID of @drawables X resource.
*/
get_xid(): xlib.Window;
/**
* Moves the window to the correct workspace when running under a
* window manager that supports multiple workspaces, as described
* in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
* Will not do anything if the window is already on all workspaces.
*/
move_to_current_desktop(): void;
/**
* Moves the window to the given workspace when running unde a
* window manager that supports multiple workspaces, as described
* in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
* @param desktop the number of the workspace to move the window to
*/
move_to_desktop(desktop: number): void;
/**
* This is the same as gdk_window_set_shadow_width() but it only works
* on GdkX11Window.
* @param left The left extent
* @param right The right extent
* @param top The top extent
* @param bottom The bottom extent
*/
set_frame_extents(left: number, right: number, top: number, bottom: number): void;
/**
* This function can be used to disable frame synchronization for a window.
* Normally frame synchronziation will be enabled or disabled based on whether
* the system has a compositor that supports frame synchronization, but if
* the window is not directly managed by the window manager, then frame
* synchronziation may need to be disabled. This is the case for a window
* embedded via the XEMBED protocol.
* @param frame_sync_enabled whether frame-synchronization should be enabled
*/
set_frame_sync_enabled(frame_sync_enabled: boolean): void;
/**
* Set a hint for the window manager, requesting that the titlebar
* should be hidden when the window is maximized.
*
* Note that this property is automatically updated by GTK+, so this
* function should only be used by applications which do not use GTK+
* to create toplevel windows.
* @param hide_titlebar_when_maximized whether to hide the titlebar when maximized
*/
set_hide_titlebar_when_maximized(hide_titlebar_when_maximized: boolean): void;
/**
* GTK+ applications can request a dark theme variant. In order to
* make other applications - namely window managers using GTK+ for
* themeing - aware of this choice, GTK+ uses this function to
* export the requested theme variant as _GTK_THEME_VARIANT property
* on toplevel windows.
*
* Note that this property is automatically updated by GTK+, so this
* function should only be used by applications which do not use GTK+
* to create toplevel windows.
* @param variant the theme variant to export
*/
set_theme_variant(variant: string): void;
/**
* The application can use this call to update the _NET_WM_USER_TIME
* property on a toplevel window. This property stores an Xserver
* time which represents the time of the last user input event
* received for this window. This property may be used by the window
* manager to alter the focus, stacking, and/or placement behavior of
* windows when they are mapped depending on whether the new window
* was created by a user action or is a "pop-up" window activated by a
* timer or some other event.
*
* Note that this property is automatically updated by GDK, so this
* function should only be used by applications which handle input
* events bypassing GDK.
* @param timestamp An XServer timestamp to which the property should be set
*/
set_user_time(timestamp: number): void;
/**
* This function modifies or removes an arbitrary X11 window
* property of type UTF8_STRING. If the given `window` is
* not a toplevel window, it is ignored.
* @param name Property name, will be interned as an X atom
* @param value Property value, or %NULL to delete
*/
set_utf8_property(name: string, value?: string | null): void;
}
type X11AppLaunchContextClass = typeof X11AppLaunchContext;
type X11CursorClass = typeof X11Cursor;
type X11DeviceCoreClass = typeof X11DeviceCore;
type X11DeviceManagerCoreClass = typeof X11DeviceManagerCore;
type X11DeviceManagerXI2Class = typeof X11DeviceManagerXI2;
type X11DeviceXI2Class = typeof X11DeviceXI2;
type X11DisplayClass = typeof X11Display;
type X11DisplayManagerClass = typeof X11DisplayManager;
type X11DragContextClass = typeof X11DragContext;
type X11GLContextClass = typeof X11GLContext;
type X11KeymapClass = typeof X11Keymap;
type X11MonitorClass = typeof X11Monitor;
type X11ScreenClass = typeof X11Screen;
type X11VisualClass = typeof X11Visual;
type X11WindowClass = typeof X11Window;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default GdkX11;
}
declare module 'gi://GdkX11' {
import GdkX1130 from 'gi://GdkX11?version=3.0';
export default GdkX1130;
}
// END

View File

@ -1,746 +0,0 @@
/// <reference path="./xlib-2.0.d.ts" />
/// <reference path="./gdk-4.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./cairo.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./pangocairo-1.0.d.ts" />
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./gdkpixbuf-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://GdkX11?version=4.0' {
// Module dependencies
import type xlib from 'gi://xlib?version=2.0';
import type Gdk from 'gi://Gdk?version=4.0';
import type cairo from 'cairo';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type PangoCairo from 'gi://PangoCairo?version=1.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
export namespace GdkX11 {
/**
* GdkX11-4.0
*/
export namespace X11DeviceType {
export const $gtype: GObject.GType<X11DeviceType>;
}
enum X11DeviceType {
LOGICAL,
PHYSICAL,
FLOATING,
}
/**
* Returns the device ID as seen by XInput2.
* @param device a `GdkDevice`
* @returns the XInput2 device ID
*/
function x11_device_get_id(device: X11DeviceXI2): number;
/**
* Returns the `GdkDevice` that wraps the given device ID.
* @param device_manager a `GdkDeviceManager`
* @param device_id a device ID, as understood by the XInput2 protocol
* @returns The `GdkDevice` wrapping the device ID, or %NULL if the given ID doesnt currently represent a device.
*/
function x11_device_manager_lookup(device_manager: X11DeviceManagerXI2, device_id: number): X11DeviceXI2 | null;
/**
* Frees the data returned from gdk_x11_display_string_to_compound_text().
* @param ctext The pointer stored in @ctext from a call to gdk_x11_display_string_to_compound_text().
*/
function x11_free_compound_text(ctext: number): void;
/**
* Frees the array of strings created by
* gdk_x11_display_text_property_to_text_list().
* @param list the value stored in the @list parameter by a call to gdk_x11_display_text_property_to_text_list().
*/
function x11_free_text_list(list: string): void;
/**
* Routine to get the current X server time stamp.
* @param surface a `GdkSurface`, used for communication with the server. The surface must have `GDK_PROPERTY_CHANGE_MASK` in its events mask or a hang will result.
* @returns the time stamp
*/
function x11_get_server_time(surface: X11Surface): number;
/**
* Returns the X atom for a `GdkDisplay` corresponding to `atom_name`.
* This function caches the result, so if called repeatedly it is much
* faster than XInternAtom(), which is a round trip to the server each time.
* @param display a `GdkDisplay`
* @param atom_name a string
* @returns a X atom for a `GdkDisplay`
*/
function x11_get_xatom_by_name_for_display(display: X11Display, atom_name: string): xlib.Atom;
/**
* Returns the name of an X atom for its display. This
* function is meant mainly for debugging, so for convenience, unlike
* XAtomName() and the result doesnt need to
* be freed.
* @param display the `GdkDisplay` where @xatom is defined
* @param xatom an X atom
* @returns name of the X atom; this string is owned by GDK, so it shouldnt be modified or freed.
*/
function x11_get_xatom_name_for_display(display: X11Display, xatom: xlib.Atom): string;
/**
* Find the `GdkDisplay` corresponding to `xdisplay,` if any exists.
* @param xdisplay a pointer to an X Display
* @returns the `GdkDisplay`, if found, otherwise %NULL.
*/
function x11_lookup_xdisplay(xdisplay: xlib.Display): X11Display;
/**
* Sets the `SM_CLIENT_ID` property on the applications leader window so that
* the window manager can save the applications state using the X11R6 ICCCM
* session management protocol.
*
* See the X Session Management Library documentation for more information on
* session management and the Inter-Client Communication Conventions Manual
* @param sm_client_id the client id assigned by the session manager when the connection was opened, or %NULL to remove the property.
*/
function x11_set_sm_client_id(sm_client_id?: string | null): void;
namespace X11AppLaunchContext {
// Constructor properties interface
interface ConstructorProps extends Gdk.AppLaunchContext.ConstructorProps {}
}
class X11AppLaunchContext extends Gdk.AppLaunchContext {
static $gtype: GObject.GType<X11AppLaunchContext>;
// Constructors
constructor(properties?: Partial<X11AppLaunchContext.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace X11DeviceManagerXI2 {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
display: Gdk.Display;
major: number;
minor: number;
opcode: number;
}
}
class X11DeviceManagerXI2 extends GObject.Object {
static $gtype: GObject.GType<X11DeviceManagerXI2>;
// Properties
get display(): Gdk.Display;
get major(): number;
get minor(): number;
get opcode(): number;
// Constructors
constructor(properties?: Partial<X11DeviceManagerXI2.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace X11DeviceXI2 {
// Constructor properties interface
interface ConstructorProps extends Gdk.Device.ConstructorProps {
device_id: number;
deviceId: number;
}
}
class X11DeviceXI2 extends Gdk.Device {
static $gtype: GObject.GType<X11DeviceXI2>;
// Properties
get device_id(): number;
get deviceId(): number;
// Constructors
constructor(properties?: Partial<X11DeviceXI2.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace X11Display {
// Signal callback interfaces
interface Xevent {
(xevent?: any | null): boolean;
}
// Constructor properties interface
interface ConstructorProps extends Gdk.Display.ConstructorProps {}
}
class X11Display extends Gdk.Display {
static $gtype: GObject.GType<X11Display>;
// Constructors
constructor(properties?: Partial<X11Display.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'xevent', callback: (_source: this, xevent: any | null) => boolean): number;
connect_after(signal: 'xevent', callback: (_source: this, xevent: any | null) => boolean): number;
emit(signal: 'xevent', xevent?: any | null): void;
// Static methods
/**
* Tries to open a new display to the X server given by
* `display_name`. If opening the display fails, %NULL is
* returned.
* @param display_name name of the X display. See the XOpenDisplay() for details.
*/
static open(display_name?: string | null): Gdk.Display | null;
/**
* Sets the program class.
*
* The X11 backend uses the program class to set the class name part
* of the `WM_CLASS` property on toplevel windows; see the ICCCM.
* @param display a `GdkDisplay`
* @param program_class a string
*/
static set_program_class(display: Gdk.Display, program_class: string): void;
// Methods
/**
* Pops the error trap pushed by gdk_x11_display_error_trap_push().
* Will XSync() if necessary and will always block until
* the error is known to have occurred or not occurred,
* so the error code can be returned.
*
* If you dont need to use the return value,
* gdk_x11_display_error_trap_pop_ignored() would be more efficient.
* @returns X error code or 0 on success
*/
error_trap_pop(): number;
/**
* Pops the error trap pushed by gdk_x11_display_error_trap_push().
* Does not block to see if an error occurred; merely records the
* range of requests to ignore errors for, and ignores those errors
* if they arrive asynchronously.
*/
error_trap_pop_ignored(): void;
/**
* Begins a range of X requests on `display` for which X error events
* will be ignored. Unignored errors (when no trap is pushed) will abort
* the application. Use gdk_x11_display_error_trap_pop() or
* gdk_x11_display_error_trap_pop_ignored()to lift a trap pushed
* with this function.
*/
error_trap_push(): void;
/**
* Returns the default group leader surface for all toplevel surfaces
* on `display`. This surface is implicitly created by GDK.
* See gdk_x11_surface_set_group().
* @returns The default group leader surface for @display
*/
get_default_group(): Gdk.Surface;
/**
* Retrieves the EGL display connection object for the given GDK display.
*
* This function returns `NULL` if GDK is using GLX.
* @returns the EGL display object
*/
get_egl_display(): any | null;
/**
* Retrieves the version of the EGL implementation.
* @returns %TRUE if EGL is available
*/
get_egl_version(): [boolean, number, number];
/**
* Retrieves the version of the GLX implementation.
* @returns %TRUE if GLX is available
*/
get_glx_version(): [boolean, number, number];
/**
* Gets the primary monitor for the display.
*
* The primary monitor is considered the monitor where the main desktop
* lives. While normal application surfaces typically allow the window
* manager to place the surfaces, specialized desktop applications
* such as panels should place themselves on the primary monitor.
*
* If no monitor is the designated primary monitor, any monitor
* (usually the first) may be returned.
* @returns the primary monitor, or any monitor if no primary monitor is configured by the user
*/
get_primary_monitor(): Gdk.Monitor;
/**
* Retrieves the `GdkX11Screen` of the `display`.
* @returns the `GdkX11Screen`
*/
get_screen(): X11Screen;
/**
* Gets the startup notification ID for a display.
* @returns the startup notification ID for @display
*/
get_startup_notification_id(): string;
// Conflicted with Gdk.Display.get_startup_notification_id
get_startup_notification_id(...args: never[]): any;
/**
* Returns the timestamp of the last user interaction on
* `display`. The timestamp is taken from events caused
* by user interaction such as key presses or pointer
* movements. See gdk_x11_surface_set_user_time().
* @returns the timestamp of the last user interaction
*/
get_user_time(): number;
/**
* Returns the X cursor belonging to a `GdkCursor`, potentially
* creating the cursor.
*
* Be aware that the returned cursor may not be unique to `cursor`.
* It may for example be shared with its fallback cursor. On old
* X servers that don't support the XCursor extension, all cursors
* may even fall back to a few default cursors.
* @param cursor a `GdkCursor`
* @returns an Xlib Cursor.
*/
get_xcursor(cursor: Gdk.Cursor): xlib.Cursor;
/**
* Returns the X display of a `GdkDisplay`.
* @returns an X display
*/
get_xdisplay(): xlib.Display;
/**
* Returns the root X window used by `GdkDisplay`.
* @returns an X Window
*/
get_xrootwindow(): xlib.Window;
/**
* Returns the X Screen used by `GdkDisplay`.
* @returns an X Screen
*/
get_xscreen(): xlib.Screen;
/**
* Call XGrabServer() on `display`.
* To ungrab the display again, use gdk_x11_display_ungrab().
*
* gdk_x11_display_grab()/gdk_x11_display_ungrab() calls can be nested.
*/
grab(): void;
/**
* Sets the cursor theme from which the images for cursor
* should be taken.
*
* If the windowing system supports it, existing cursors created
* with [ctor`Gdk`.Cursor.new_from_name] are updated to reflect the theme
* change. Custom cursors constructed with [ctor`Gdk`.Cursor.new_from_texture]
* will have to be handled by the application (GTK applications can learn
* about cursor theme changes by listening for change notification
* for the corresponding `GtkSetting`).
* @param theme the name of the cursor theme to use, or %NULL to unset a previously set value
* @param size the cursor size to use, or 0 to keep the previous size
*/
set_cursor_theme(theme: string | null, size: number): void;
/**
* Sets the startup notification ID for a display.
*
* This is usually taken from the value of the DESKTOP_STARTUP_ID
* environment variable, but in some cases (such as the application not
* being launched using exec()) it can come from other sources.
*
* If the ID contains the string "_TIME" then the portion following that
* string is taken to be the X11 timestamp of the event that triggered
* the application to be launched and the GDK current event time is set
* accordingly.
*
* The startup ID is also what is used to signal that the startup is
* complete (for example, when opening a window or when calling
* gdk_display_notify_startup_complete()).
* @param startup_id the startup notification ID (must be valid utf8)
*/
set_startup_notification_id(startup_id: string): void;
/**
* Forces a specific window scale for all windows on this display,
* instead of using the default or user configured scale. This
* is can be used to disable scaling support by setting `scale` to
* 1, or to programmatically set the window scale.
*
* Once the scale is set by this call it will not change in response
* to later user configuration changes.
* @param scale The new scale value
*/
set_surface_scale(scale: number): void;
/**
* Convert a string from the encoding of the current
* locale into a form suitable for storing in a window property.
* @param str a nul-terminated string
* @returns 0 upon success, non-zero upon failure
*/
string_to_compound_text(str: string): [number, string, number, Uint8Array];
/**
* Convert a text string from the encoding as it is stored
* in a property into an array of strings in the encoding of
* the current locale. (The elements of the array represent the
* nul-separated elements of the original text string.)
* @param encoding a string representing the encoding. The most common values for this are "STRING", or "COMPOUND_TEXT". This is value used as the type for the property
* @param format the format of the property
* @param text The text data
* @param length The number of items to transform
* @param list location to store an array of strings in the encoding of the current locale. This array should be freed using gdk_x11_free_text_list().
* @returns the number of strings stored in list, or 0, if the conversion failed
*/
text_property_to_text_list(
encoding: string,
format: number,
text: number,
length: number,
list: string,
): number;
/**
* Ungrab `display` after it has been grabbed with
* gdk_x11_display_grab().
*/
ungrab(): void;
/**
* Converts from UTF-8 to compound text.
* @param str a UTF-8 string
* @returns %TRUE if the conversion succeeded, otherwise %FALSE
*/
utf8_to_compound_text(str: string): [boolean, string, number, Uint8Array];
}
namespace X11Drag {
// Constructor properties interface
interface ConstructorProps extends Gdk.Drag.ConstructorProps {}
}
class X11Drag extends Gdk.Drag {
static $gtype: GObject.GType<X11Drag>;
// Constructors
constructor(properties?: Partial<X11Drag.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace X11GLContext {
// Constructor properties interface
interface ConstructorProps extends Gdk.GLContext.ConstructorProps {}
}
abstract class X11GLContext extends Gdk.GLContext {
static $gtype: GObject.GType<X11GLContext>;
// Constructors
constructor(properties?: Partial<X11GLContext.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
namespace X11Monitor {
// Constructor properties interface
interface ConstructorProps extends Gdk.Monitor.ConstructorProps {}
}
class X11Monitor extends Gdk.Monitor {
static $gtype: GObject.GType<X11Monitor>;
// Constructors
constructor(properties?: Partial<X11Monitor.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Returns the XID of the Output corresponding to `monitor`.
* @returns the XID of @monitor
*/
get_output(): xlib.XID;
/**
* Retrieves the size and position of the work area on a monitor
* within the display coordinate space.
*
* The returned geometry is in application pixels, not in device pixels
* (see [method`Gdk`.Monitor.get_scale_factor]).
*/
get_workarea(): Gdk.Rectangle;
}
namespace X11Screen {
// Signal callback interfaces
interface WindowManagerChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class X11Screen extends GObject.Object {
static $gtype: GObject.GType<X11Screen>;
// Constructors
constructor(properties?: Partial<X11Screen.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'window-manager-changed', callback: (_source: this) => void): number;
connect_after(signal: 'window-manager-changed', callback: (_source: this) => void): number;
emit(signal: 'window-manager-changed'): void;
// Methods
/**
* Returns the current workspace for `screen` when running under a
* window manager that supports multiple workspaces, as described
* in the
* [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
* @returns the current workspace, or 0 if workspaces are not supported
*/
get_current_desktop(): number;
/**
* Gets the XID of the specified output/monitor.
* If the X server does not support version 1.2 of the RANDR
* extension, 0 is returned.
* @param monitor_num number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
* @returns the XID of the monitor
*/
get_monitor_output(monitor_num: number): xlib.XID;
/**
* Returns the number of workspaces for `screen` when running under a
* window manager that supports multiple workspaces, as described
* in the
* [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
* @returns the number of workspaces, or 0 if workspaces are not supported
*/
get_number_of_desktops(): number;
/**
* Returns the index of a `GdkX11Screen`.
* @returns the position of @screen among the screens of its display
*/
get_screen_number(): number;
/**
* Returns the name of the window manager for `screen`.
* @returns the name of the window manager screen @screen, or "unknown" if the window manager is unknown. The string is owned by GDK and should not be freed.
*/
get_window_manager_name(): string;
/**
* Returns the screen of a `GdkX11Screen`.
* @returns an Xlib Screen*
*/
get_xscreen(): xlib.Screen;
/**
* This function is specific to the X11 backend of GDK, and indicates
* whether the window manager supports a certain hint from the
* [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
*
* When using this function, keep in mind that the window manager
* can change over time; so you shouldnt use this function in
* a way that impacts persistent application state. A common bug
* is that your application can start up before the window manager
* does when the user logs in, and before the window manager starts
* gdk_x11_screen_supports_net_wm_hint() will return %FALSE for every property.
* You can monitor the window_manager_changed signal on `GdkX11Screen` to detect
* a window manager change.
* @param property_name name of the WM property
* @returns %TRUE if the window manager supports @property
*/
supports_net_wm_hint(property_name: string): boolean;
}
namespace X11Surface {
// Constructor properties interface
interface ConstructorProps extends Gdk.Surface.ConstructorProps {}
}
class X11Surface extends Gdk.Surface {
static $gtype: GObject.GType<X11Surface>;
// Constructors
constructor(properties?: Partial<X11Surface.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Static methods
/**
* Looks up the `GdkSurface` that wraps the given native window handle.
* @param display the `GdkDisplay` corresponding to the window handle
* @param window an Xlib Window
*/
static lookup_for_display(display: X11Display, window: xlib.Window): X11Surface;
// Methods
/**
* Gets the number of the workspace `surface` is on.
* @returns the current workspace of @surface
*/
get_desktop(): number;
/**
* Returns the group this surface belongs to.
* @returns The group of this surface;
*/
get_group(): Gdk.Surface | null;
/**
* Returns the X resource (surface) belonging to a `GdkSurface`.
* @returns the ID of @drawables X resource.
*/
get_xid(): xlib.Window;
/**
* Moves the surface to the correct workspace when running under a
* window manager that supports multiple workspaces, as described
* in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
* Will not do anything if the surface is already on all workspaces.
*/
move_to_current_desktop(): void;
/**
* Moves the surface to the given workspace when running unde a
* window manager that supports multiple workspaces, as described
* in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification.
* @param desktop the number of the workspace to move the surface to
*/
move_to_desktop(desktop: number): void;
/**
* This function can be used to disable frame synchronization for a surface.
* Normally frame synchronziation will be enabled or disabled based on whether
* the system has a compositor that supports frame synchronization, but if
* the surface is not directly managed by the window manager, then frame
* synchronziation may need to be disabled. This is the case for a surface
* embedded via the XEMBED protocol.
* @param frame_sync_enabled whether frame-synchronization should be enabled
*/
set_frame_sync_enabled(frame_sync_enabled: boolean): void;
/**
* Sets the group leader of `surface` to be `leader`.
* See the ICCCM for details.
* @param leader a `GdkSurface`
*/
set_group(leader: Gdk.Surface): void;
/**
* Sets a hint on `surface` that pagers should not
* display it. See the EWMH for details.
* @param skips_pager %TRUE to skip pagers
*/
set_skip_pager_hint(skips_pager: boolean): void;
/**
* Sets a hint on `surface` that taskbars should not
* display it. See the EWMH for details.
* @param skips_taskbar %TRUE to skip taskbars
*/
set_skip_taskbar_hint(skips_taskbar: boolean): void;
/**
* GTK applications can request a dark theme variant. In order to
* make other applications - namely window managers using GTK for
* themeing - aware of this choice, GTK uses this function to
* export the requested theme variant as _GTK_THEME_VARIANT property
* on toplevel surfaces.
*
* Note that this property is automatically updated by GTK, so this
* function should only be used by applications which do not use GTK
* to create toplevel surfaces.
* @param variant the theme variant to export
*/
set_theme_variant(variant: string): void;
/**
* Sets a hint on `surface` that it needs user attention.
* See the ICCCM for details.
* @param urgent %TRUE to indicate urgenct attention needed
*/
set_urgency_hint(urgent: boolean): void;
/**
* The application can use this call to update the _NET_WM_USER_TIME
* property on a toplevel surface. This property stores an Xserver
* time which represents the time of the last user input event
* received for this surface. This property may be used by the window
* manager to alter the focus, stacking, and/or placement behavior of
* surfaces when they are mapped depending on whether the new surface
* was created by a user action or is a "pop-up" surface activated by a
* timer or some other event.
*
* Note that this property is automatically updated by GDK, so this
* function should only be used by applications which handle input
* events bypassing GDK.
* @param timestamp An XServer timestamp to which the property should be set
*/
set_user_time(timestamp: number): void;
/**
* This function modifies or removes an arbitrary X11 window
* property of type UTF8_STRING. If the given `surface` is
* not a toplevel surface, it is ignored.
* @param name Property name, will be interned as an X atom
* @param value Property value, or %NULL to delete
*/
set_utf8_property(name: string, value?: string | null): void;
}
type X11AppLaunchContextClass = typeof X11AppLaunchContext;
type X11DeviceManagerXI2Class = typeof X11DeviceManagerXI2;
type X11DeviceXI2Class = typeof X11DeviceXI2;
type X11DisplayClass = typeof X11Display;
type X11DragClass = typeof X11Drag;
type X11GLContextClass = typeof X11GLContext;
type X11MonitorClass = typeof X11Monitor;
type X11ScreenClass = typeof X11Screen;
type X11SurfaceClass = typeof X11Surface;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default GdkX11;
}
declare module 'gi://GdkX11' {
import GdkX1140 from 'gi://GdkX11?version=4.0';
export default GdkX1140;
}
// END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,43 +0,0 @@
declare module 'gettext' {
export enum LocaleCategory {
ALL,
COLLATE,
CTYPE,
MESSAGES,
MONETARY,
NUMERIC,
TIME,
}
export function setlocale(category: number, locale: string | null): string;
export function textdomain(domainname: string | null): string;
export function bindtextdomain(domainname: string, dirname: string | null): string;
export function gettext(msgid: string): string;
export function dgettext(domainname: string | null, msgid: string): string;
export function dcgettext(domainname: string | null, msgid: string, category: number): string;
export function ngettext(msgid: string, msgid_plural: string, n: number): string;
export function dngettext(domainname: string, msgid: string, msgid_plural: string, n: number): string;
export function pgettext(context: string, msgid: string): string;
export function dpgettext(dom: string | null, context: string, msgid: string): string;
export function domain(domainName: string): {
gettext: (msgid: string) => string;
ngettext: (msgid: string, msgid_plural: string, n: number) => string;
pgettext: (context: string, msgid: string) => string;
};
const Gettext: {
LocaleCategory: typeof LocaleCategory;
setlocale: typeof setlocale;
textdomain: typeof textdomain;
bindtextdomain: typeof bindtextdomain;
gettext: typeof gettext;
dgettext: typeof dgettext;
dcgettext: typeof dcgettext;
ngettext: typeof ngettext;
dngettext: typeof dngettext;
pgettext: typeof pgettext;
dpgettext: typeof dpgettext;
domain: typeof domain;
};
export default Gettext;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,193 +0,0 @@
/**
* This file exports all GIR module type definitions.
*/
import './glib-2.0.d.ts';
import './gio-2.0.d.ts';
import './gobject-2.0.d.ts';
import './xrandr-1.3.d.ts';
import './xlib-2.0.d.ts';
import './xft-2.0.d.ts';
import './xfixes-4.0.d.ts';
import './win32-1.0.d.ts';
import './libxml2-2.0.d.ts';
import './freetype2-2.0.d.ts';
import './fontconfig-2.0.d.ts';
import './cairo-1.0.d.ts';
import './zbar-1.0.d.ts';
import './xmlb-2.0.d.ts';
import './xkl-1.0.d.ts';
import './xfconf-0.d.ts';
import './wp-0.5.d.ts';
import './wnck-3.0.d.ts';
import './vulkan-1.0.d.ts';
import './vte-2.91.d.ts';
import './upowerglib-1.0.d.ts';
import './udisks-2.0.d.ts';
import './tsparql-3.0.d.ts';
import './tracker-3.0.d.ts';
import './thunarx-3.0.d.ts';
import './soup-3.0.d.ts';
import './secret-1.d.ts';
import './rsvg-2.0.d.ts';
import './poppler-0.18.d.ts';
import './polkitagent-1.0.d.ts';
import './polkit-1.0.d.ts';
import './playerctl-2.0.d.ts';
import './pangoxft-1.0.d.ts';
import './pangoot-1.0.d.ts';
import './pangofc-1.0.d.ts';
import './pangoft2-1.0.d.ts';
import './pangocairo-1.0.d.ts';
import './pango-1.0.d.ts';
import './notify-0.7.d.ts';
import './nice-0.1.d.ts';
import './nma-1.0.d.ts';
import './nm-1.0.d.ts';
import './mypaintgegl-1.6.d.ts';
import './mypaint-1.6.d.ts';
import './modemmanager-1.0.d.ts';
import './libxfce4windowingui-0.0.d.ts';
import './libxfce4windowing-0.0.d.ts';
import './libxfce4util-1.0.d.ts';
import './libxfce4ui-2.0.d.ts';
import './libxfce4panel-2.0.d.ts';
import './libproxy-1.0.d.ts';
import './keybinder-3.0.d.ts';
import './json-1.0.d.ts';
import './ibus-1.0.d.ts';
import './hex-4.d.ts';
import './harfbuzz-0.0.d.ts';
import './handy-1.d.ts';
import './gtksource-4.d.ts';
import './gtklayershell-0.1.d.ts';
import './gtkclutter-1.0.d.ts';
import './gtk4sessionlock-1.0.d.ts';
import './gtk4layershell-1.0.d.ts';
import './gtk-4.0.d.ts';
import './gtk-3.0.d.ts';
import './gtk-2.0.d.ts';
import './gstwebrtc-1.0.d.ts';
import './gstvulkanxcb-1.0.d.ts';
import './gstvulkanwayland-1.0.d.ts';
import './gstvulkan-1.0.d.ts';
import './gstvideo-1.0.d.ts';
import './gstva-1.0.d.ts';
import './gsttranscoder-1.0.d.ts';
import './gsttag-1.0.d.ts';
import './gstsdp-1.0.d.ts';
import './gstrtsp-1.0.d.ts';
import './gstrtp-1.0.d.ts';
import './gstplayer-1.0.d.ts';
import './gstplay-1.0.d.ts';
import './gstpbutils-1.0.d.ts';
import './gstnet-1.0.d.ts';
import './gstmse-1.0.d.ts';
import './gstmpegts-1.0.d.ts';
import './gstinsertbin-1.0.d.ts';
import './gstglx11-1.0.d.ts';
import './gstglwayland-1.0.d.ts';
import './gstglegl-1.0.d.ts';
import './gstgl-1.0.d.ts';
import './gstdxva-1.0.d.ts';
import './gstcuda-1.0.d.ts';
import './gstcontroller-1.0.d.ts';
import './gstcodecs-1.0.d.ts';
import './gstcheck-1.0.d.ts';
import './gstbase-1.0.d.ts';
import './gstbadaudio-1.0.d.ts';
import './gstaudio-1.0.d.ts';
import './gstapp-1.0.d.ts';
import './gstanalytics-1.0.d.ts';
import './gstallocators-1.0.d.ts';
import './gst-1.0.d.ts';
import './gsk-4.0.d.ts';
import './graphene-1.0.d.ts';
import './gnomerr-4.0.d.ts';
import './gnomedesktop-4.0.d.ts';
import './gnomedesktop-3.0.d.ts';
import './gnomebg-4.0.d.ts';
import './giounix-2.0.d.ts';
import './gimpui-3.0.d.ts';
import './gimp-3.0.d.ts';
import './geoclue-2.0.d.ts';
import './gegl-0.4.d.ts';
import './gdkx11-4.0.d.ts';
import './gdkx11-3.0.d.ts';
import './gdkx11-2.0.d.ts';
import './gdkwayland-4.0.d.ts';
import './gdkpixdata-2.0.d.ts';
import './gdkpixbuf-2.0.d.ts';
import './gdk-4.0.d.ts';
import './gdk-3.0.d.ts';
import './gdk-2.0.d.ts';
import './gcrui-3.d.ts';
import './gcr-4.d.ts';
import './gcr-3.d.ts';
import './gck-2.d.ts';
import './gck-1.d.ts';
import './garcongtk-1.0.d.ts';
import './garcon-1.0.d.ts';
import './gusb-1.0.d.ts';
import './gudev-1.0.d.ts';
import './gupnpigd-1.6.d.ts';
import './gupnp-1.6.d.ts';
import './gtop-2.0.d.ts';
import './gssdp-1.6.d.ts';
import './gmodule-2.0.d.ts';
import './glibunix-2.0.d.ts';
import './gl-1.0.d.ts';
import './girepository-3.0.d.ts';
import './girepository-2.0.d.ts';
import './gexiv2-0.10.d.ts';
import './gdesktopenums-3.0.d.ts';
import './dbusmenugtk3-0.4.d.ts';
import './dbusmenu-0.4.d.ts';
import './dbusglib-1.0.d.ts';
import './dbus-1.0.d.ts';
import './cudagst-1.0.d.ts';
import './colorhug-1.0.d.ts';
import './colord-1.0.d.ts';
import './coglpango-2.0.d.ts';
import './coglpango-1.0.d.ts';
import './cogl-2.0.d.ts';
import './cogl-1.0.d.ts';
import './clutterx11-1.0.d.ts';
import './cluttergst-3.0.d.ts';
import './cluttergdk-1.0.d.ts';
import './clutter-1.0.d.ts';
import './cloudproviders-0.3.d.ts';
import './cheese-3.0.d.ts';
import './cally-1.0.d.ts';
import './blockdev-3.0.d.ts';
import './babl-0.1.d.ts';
import './avahicore-0.6.d.ts';
import './avahi-0.6.d.ts';
import './atspi-2.0.d.ts';
import './atk-1.0.d.ts';
import './astalwp-0.1.d.ts';
import './astaltray-0.1.d.ts';
import './astalriver-0.1.d.ts';
import './astalpowerprofiles-0.1.d.ts';
import './astalnotifd-0.1.d.ts';
import './astalnetwork-0.1.d.ts';
import './astalmpris-0.1.d.ts';
import './astalio-0.1.d.ts';
import './astalhyprland-0.1.d.ts';
import './astalgreet-0.1.d.ts';
import './astalcava-0.1.d.ts';
import './astalbluetooth-0.1.d.ts';
import './astalbattery-0.1.d.ts';
import './astalauth-0.1.d.ts';
import './astalapps-0.1.d.ts';
import './astal-4.0.d.ts';
import './astal-3.0.d.ts';
import './appmenuglibtranslator-24.02.d.ts';
import './appstreamglib-1.0.d.ts';
import './appstreamcompose-1.0.d.ts';
import './appstream-1.0.d.ts';
import './appindicator3-0.1.d.ts';
import './adw-1.d.ts';
import './accountsservice-1.0.d.ts';
import './accounts-1.0.d.ts';
import './gc-1.0.d.ts';

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,738 +0,0 @@
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gettext.d.ts" />
/// <reference path="./system.d.ts" />
/// <reference path="./cairo.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in ts-for-gir itself or create a bug report on https://github.com/gjsify/ts-for-gir
*/
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import gettext from 'gettext';
import system from 'system';
import cairo from 'cairo';
// https://gitlab.gnome.org/GNOME/gjs/-/blob/1.72.0/modules/script/package.js
declare namespace package {
/**
* Although there are references in the documentation of more properties that
* this object should accepts, only the following are actually used in the init code,
* and all the other have their values derived from them.
*/
interface PackageInitParams {
/** The base name of the entry point (eg. org.foo.Bar.App) */
name: string;
/** The version of the package */
version: string;
/** The prefix of the package */
prefix: string;
/**
* The final datadir and libdir when installed;
* usually, these would be prefix + '/share' and
* and prefix + '/lib' (or '/lib64')
*/
libdir: string;
/**
* The final datadir and libdir when installed;
* usually, these would be prefix + '/share' and
* and prefix + '/lib' (or '/lib64')
*/
datadir?: string;
}
/**
* The base name of the entry point (eg. org.foo.Bar.App)
*
* Note: Run `pkg.init()` before accessing this property.
*/
export const name: string;
/**
* The version of the package
*
* Note: Run `pkg.init()` before accessing this property.
*/
export const version: string;
/**
* The prefix of the package
*
* Note: Run `pkg.init()` before accessing this property.
*/
export const prefix: string;
/**
* The final datadir when installed; usually, these would be prefix + '/share'
*
* Note: Run `pkg.init()` before accessing this property.
*/
export const datadir: string;
/**
* The final libdir when installed; usually, these would be prefix + '/lib' (or '/lib64')
*
* Note: Run `pkg.init()` before accessing this property.
*/
export const libdir: string;
/**
* The final pkglibdir when installed; usually, this would be prefix + '/lib' (or '/lib64')
*
* Note: Run `pkg.init()` before accessing this property.
*/
export const pkglibdir: string;
/**
* The final moduledir when installed; usually, this would be prefix + '/lib' (or '/lib64')
*
* Note: Run `pkg.init()` before accessing this property.
*/
export const moduledir: string;
/**
* The directory containing gettext translation files; this will be datadir + '/locale' when installed and './po' in the source tree
*
* Note: Run `pkg.init()` before accessing this property.
*/
export const localedir: string;
/**
* Initialize directories and global variables. Must be called
* before any of other API in Package is used.
* `params` must be an object with at least the following keys:
* - name: the package name ($(PACKAGE_NAME) in autotools,
* eg. org.foo.Bar)
* - version: the package version
* - prefix: the installation prefix
*
* init() will take care to check if the program is running from
* the source directory or not, by looking for a 'src' directory.
*
* At the end, the global variable 'pkg' will contain the
* Package module (imports.package). Additionally, the following
* module variables will be available:
* - name: the base name of the entry point (eg. org.foo.Bar.App)
* - version: same as in @params
* - prefix: the installation prefix (as passed in @params)
* - datadir, libdir: the final datadir and libdir when installed;
* usually, these would be prefix + '/share' and
* and prefix + '/lib' (or '/lib64')
* - pkgdatadir: the directory to look for private data files, such as
* images, stylesheets and UI definitions;
* this will be datadir + name when installed and
* './data' when running from the source tree
* - pkglibdir: the directory to look for private typelibs and C
* libraries;
* this will be libdir + name when installed and
* './lib' when running from the source tree
* - moduledir: the directory to look for JS modules;
* this will be pkglibdir when installed and
* './src' when running from the source tree
* - localedir: the directory containing gettext translation files;
* this will be datadir + '/locale' when installed
* and './po' in the source tree
*
* All paths are absolute and will not end with '/'.
*
* As a side effect, init() calls GLib.set_prgname().
*
* @param {object} params package parameters
*/
export function init(params: PackageInitParams): void;
/**
* This is the function to use if you want to have multiple
* entry points in one package.
* You must define a main(ARGV) function inside the passed
* in module, and then the launcher would be
*
* imports.package.init(...);
* imports.package.run(imports.entrypoint);
*
* @param module the module to run
* @returns the exit code of the module's main() function
*/
export function run(module: { main: (argv: string[]) => void }): number | undefined;
/**
* This is a convenience function if your package has a
* single entry point.
* You must define a main(ARGV) function inside a main.js
* module in moduledir.
*
* @param params see init()
*/
export function start(params: PackageInitParams): void;
/**
* Mark a dependency on a specific version of one or more
* external GI typelibs.
* `libs` must be an object whose keys are a typelib name,
* and values are the respective version. The empty string
* indicates any version.
* @param deps The external dependencies to import
*/
export function require(deps: Record<string, string>): void;
/**
* As checkSymbol(), but exit with an error if the
* dependency cannot be satisfied.
*
* @param lib an external dependency to import
* @param ver version of the dependency
* @param symbol symbol to check for
*/
export function requireSymbol(lib: string, ver?: string, symbol?: string): void;
/**
* Check whether an external GI typelib can be imported
* and provides @symbol.
*
* Symbols may refer to
* - global functions ('main_quit')
* - classes ('Window')
* - class / instance methods ('IconTheme.get_default' / 'IconTheme.has_icon')
* - GObject properties ('Window.default_height')
*
* @param lib an external dependency to import
* @param ver version of the dependency
* @param symbol symbol to check for
* @returns true if `lib` can be imported and provides `symbol`, false
* otherwise
*/
export function checkSymbol(lib: string, ver: string, symbol: string): boolean;
/**
* Initialize `gettext`.
* After calling this method `globalThis._`, `globalThis.C_` and `globalThis.N_` will be available.
*/
export function initGettext(): void;
/**
* Initializes string formatting capabilities by adding a format() method to String.prototype.
*
* After calling this method, you can use a printf-style string formatting by calling
* the format() method on any string:
*
* @example
* ```ts
* pkg.initFormat();
*
* // Now you can use format() on any string
* const name = "User";
* const count = 5;
* const formatted = "Hello %s, you have %d items".format(name, count);
* // formatted = "Hello User, you have 5 items"
*
* // Format numbers with precision
* const price = 10.5;
* const priceStr = "Price: $%.2f".format(price);
* // priceStr = "Price: $10.50"
*
* // Pad with zeros
* const id = 42;
* const idStr = "ID: %05d".format(id);
* // idStr = "ID: 00042"
* ```
*/
export function initFormat(): void;
/**
* As checkSymbol(), but exit with an error if the
* dependency cannot be satisfied.
*
* @param lib an external dependency to import
* @param ver version of the dependency
* @param symbol symbol to check for
*/
export function initSubmodule(lib: string, ver?: string, symbol?: string): void;
/**
* Load and register a GResource named @name. @name is optional and defaults to ${package-name}
* @param name The name of the GResource to load
*/
export function loadResource(name?: string): void;
}
declare namespace byteArray {
export class ByteArray {
static get(target: any, property: string, receiver: any): any;
static set(target: any, property: string, value: any, receiver: any): boolean;
length: number;
protected _array: Uint8Array;
constructor(x: Uint8Array | number);
toString(encoding?: TextDecoderEncoding): string;
fromString(input: string, encoding?: TextDecoderEncoding): ByteArray;
toGBytes(): GLib.Bytes;
}
/** @deprecated Use {@link TextEncoder.encode} instead */
export function fromString(input: string, encoding?: TextDecoderEncoding): Uint8Array;
/** @deprecated Use {@link GLib.Bytes.toArray} instead */
export function fromGBytes(input: GLib.Bytes): Uint8Array;
/** @deprecated Use {@link TextDecoder.decode} instead */
export function toString(x: Uint8Array, encoding?: TextDecoderEncoding): string;
/** @deprecated Use {@link GLib.Bytes new GLib.Bytes() } instead */
export function toGBytes(x: Uint8Array): GLib.Bytes;
/** @deprecated Use {@link ByteArray new ByteArray()} instead */
export function fromArray(array: Iterable<number>): ByteArray;
}
declare namespace lang {
// TODO: There is a lot more in Lang
export function Class(props: any): void;
}
declare namespace format {
/**
* Formats a string using printf-style format specifiers.
*
* @param str The format string
* @param args The arguments to be formatted
* @returns The formatted string
*/
export function vprintf(str: string, args: (string | number | boolean | null | undefined)[]): string;
/**
* Prints a formatted string to the console.
* Similar to C's printf function.
*
* @param fmt The format string
* @param args The arguments to be formatted
*/
export function printf(fmt: string, ...args: (string | number | boolean | null | undefined)[]): void;
/**
* Formats a string with the given arguments.
* This is the implementation that backs String.prototype.format
* when pkg.initFormat() is called.
*
* Supported format specifiers:
* - %s: Formats as a string
* - %d: Formats as an integer
* - %x: Formats as a hexadecimal number
* - %f: Formats as a floating point number, optionally with precision (e.g. %.2f)
*
* All specifiers can be prefixed with a minimum field width, e.g. "%5s" will pad with spaces.
* If the width is prefixed with '0', it will pad with zeroes instead of spaces.
*
* @example
* ```ts
* format.format("Hello %s, you have %d items", "User", 5);
* // Returns: "Hello User, you have 5 items"
* ```
*
* @param fmt The format string
* @param args The arguments to format the string with
* @returns The formatted string
*/
export function format(fmt: string, ...args: (string | number | boolean | null | undefined)[]): string;
}
declare namespace mainloop {
export function quit(name: string): void;
export function idle_source(handler: any, priority?: number): any;
export function idle_add(handler: any, priority?: number): any;
export function timeout_source(timeout: any, handler: any, priority?: number): any;
export function timeout_seconds_source(timeout: any, handler: any, priority?: number): any;
export function timeout_add(timeout: any, handler: any, priority?: number): any;
export function timeout_add_seconds(timeout: any, handler: any, priority?: number): any;
export function source_remove(id: any): any;
export function run(name: string): void;
}
/**
* You can use the `Signals.addSignalMethods` method to apply the `Signals` convenience methods to an `Object`.
* Generally, this is called on an object prototype, but may also be called on an object instance.
* You can use this Interface for this object or prototype to make the methods in typescript known
* @example
* ```ts
* const Signals = imports.signals;
*
* // Define an interface with the same name of your class to make the methods known
* interface Events extends Signals.Methods {}
*
* class Events {}
* Signals.addSignalMethods(Events.prototype);
*
* const events = new Events();
*
* // Typescript will not complain here
* events.emit("test-signal", "test argument");
* ```
*/
export interface SignalMethods {
/**
* Connects a callback to a signal for an object. Pass the returned ID to
* `disconnect()` to remove the handler.
*
* If `callback` returns `true`, emission will stop and no other handlers will be
* invoked.
*
* > Warning: Unlike GObject signals, `this` within a signal callback will always
* > refer to the global object (ie. `globalThis`).
*
* @param sigName A signal name
* @param callback A callback function
* @returns A handler ID
*/
connect(sigName: string, callback: (self: any, ...args: any[]) => void): number;
/**
* Emits a signal for an object. Emission stops if a signal handler returns `true`.
*
* Unlike GObject signals, it is not necessary to declare signals or define their
* signature. Simply call `emit()` with whatever signal name you wish, with
* whatever arguments you wish.
* @param sigName A signal name
* @param args Any number of arguments, of any type
*/
emit(sigName: string, ...args: any[]): void;
/**
* Disconnects a handler for a signal.
* @param id The ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Disconnects all signal handlers for an object.
*/
disconnectAll(): void;
/**
* Checks if a handler ID is connected.
* @param id The ID of the handler to be disconnected
* @returns `true` if connected, or `false` if not
*/
signalHandlerIsConnected(id: number): boolean;
}
declare namespace signals {
export function addSignalMethods<T = any>(proto: T): proto is T & SignalMethods;
}
declare global {
// https://gitlab.gnome.org/GNOME/gjs/-/blob/1.73.2/modules/esm/_encoding/encodingMap.js#L7-232
type TextDecoderEncoding =
| 'unicode-1-1-utf-8'
| 'unicode11utf8'
| 'unicode20utf8'
| 'utf-8'
| 'utf8'
| 'x-unicode20utf8'
| '866'
| 'cp866'
| 'csibm866'
| 'ibm866'
| 'csisolatin2'
| 'iso-8859-2'
| 'iso-ir-101'
| 'iso8859-2'
| 'iso88592'
| 'iso_8859-2'
| 'iso_8859-2:1987'
| 'l2'
| 'latin2'
| 'csisolatin3'
| 'iso-8859-3'
| 'iso-ir-109'
| 'iso8859-3'
| 'iso88593'
| 'iso_8859-3'
| 'iso_8859-3:1988'
| 'l3'
| 'latin3'
| 'csisolatin4'
| 'iso-8859-4'
| 'iso-ir-110'
| 'iso8859-4'
| 'iso88594'
| 'iso_8859-4'
| 'iso_8859-4:1988'
| 'l4'
| 'latin4'
| 'csisolatincyrillic'
| 'cyrillic'
| 'iso-8859-5'
| 'iso-ir-144'
| 'iso8859-5'
| 'iso88595'
| 'iso_8859-5'
| 'iso_8859-5:1988'
| 'arabic'
| 'asmo-708'
| 'csiso88596e'
| 'csiso88596i'
| 'csisolatinarabic'
| 'ecma-114'
| 'iso-8859-6'
| 'iso-8859-6-e'
| 'iso-8859-6-i'
| 'iso-ir-127'
| 'iso8859-6'
| 'iso88596'
| 'iso_8859-6'
| 'iso_8859-6:1987'
| 'csisolatingreek'
| 'ecma-118'
| 'elot_928'
| 'greek'
| 'greek8'
| 'iso-8859-7'
| 'iso-ir-126'
| 'iso8859-7'
| 'iso88597'
| 'iso_8859-7'
| 'iso_8859-7:1987'
| 'sun_eu_greek'
| 'csiso88598e'
| 'csisolatinhebrew'
| 'hebrew'
| 'iso-8859-8'
| 'iso-8859-8-e'
| 'iso-ir-138'
| 'iso8859-8'
| 'iso88598'
| 'iso_8859-8'
| 'iso_8859-8:1988'
| 'visual'
| 'csiso88598i'
| 'iso-8859-8-i'
| 'logical'
| 'csisolatin6'
| 'iso-8859-10'
| 'iso-ir-157'
| 'iso8859-10'
| 'iso885910'
| 'l6'
| 'latin6'
| 'iso-8859-13'
| 'iso8859-13'
| 'iso885913'
| 'iso-8859-14'
| 'iso8859-14'
| 'iso885914'
| 'csisolatin9'
| 'iso-8859-15'
| 'iso8859-15'
| 'iso885915'
| 'iso_8859-15'
| 'l9'
| 'iso-8859-16'
| 'cskoi8r'
| 'koi'
| 'koi8'
| 'koi8-r'
| 'koi8_r'
| 'koi8-ru'
| 'koi8-u'
| 'csmacintosh'
| 'mac'
| 'macintosh'
| 'x-mac-roman'
| 'dos-874'
| 'iso-8859-11'
| 'iso8859-11'
| 'iso885911'
| 'tis-620'
| 'windows-874'
| 'cp1250'
| 'windows-1250'
| 'x-cp1250'
| 'cp1251'
| 'windows-1251'
| 'x-cp1251'
| 'ansi_x3.4-1968'
| 'ascii'
| 'cp1252'
| 'cp819'
| 'csisolatin1'
| 'ibm819'
| 'iso-8859-1'
| 'iso-ir-100'
| 'iso8859-1'
| 'iso88591'
| 'iso_8859-1'
| 'iso_8859-1:1987'
| 'l1'
| 'latin1'
| 'us-ascii'
| 'windows-1252'
| 'x-cp1252'
| 'cp1253'
| 'windows-1253'
| 'x-cp1253'
| 'cp1254'
| 'csisolatin5'
| 'iso-8859-9'
| 'iso-ir-148'
| 'iso8859-9'
| 'iso88599'
| 'iso_8859-9'
| 'iso_8859-9:1989'
| 'l5'
| 'latin5'
| 'windows-1254'
| 'x-cp1254'
| 'cp1255'
| 'windows-1255'
| 'x-cp1255'
| 'cp1256'
| 'windows-1256'
| 'x-cp1256'
| 'cp1257'
| 'windows-1257'
| 'x-cp1257'
| 'cp1258'
| 'windows-1258'
| 'x-cp1258'
| 'x-mac-cyrillic'
| 'x-mac-ukrainian'
| 'chinese'
| 'csgb2312'
| 'csiso58gb231280'
| 'gb2312'
| 'gb_2312'
| 'gb_2312-80'
| 'gbk'
| 'iso-ir-58'
| 'x-gbk'
| 'gb18030'
| 'big5'
| 'cn-big5'
| 'csbig5'
| 'x-x-big5'
| 'cseucpkdfmtjapanese'
| 'euc-jp'
| 'x-euc-jp'
| 'csiso2022jp'
| 'iso-2022-jp'
| 'csshiftjis'
| 'ms932'
| 'ms_kanji'
| 'shift-jis'
| 'shift_jis'
| 'sjis'
| 'windows-31j'
| 'x-sjis'
| 'cseuckr'
| 'csksc56011987'
| 'euc-kr'
| 'iso-ir-149'
| 'korean'
| 'ks_c_5601-1987'
| 'ks_c_5601-1989'
| 'ksc5601'
| 'ksc_5601'
| 'windows-949'
| 'unicodefffe'
| 'utf-16be'
| 'csunicode'
| 'iso-10646-ucs-2'
| 'ucs-2'
| 'unicode'
| 'unicodefeff'
| 'utf-16'
| 'utf-16le';
interface GjsGiImports {
// Will be extended by the import of more gir types
versions: {
[namespace: string]: string;
};
}
interface GjsImports {
gi: GjsGiImports;
lang: typeof lang;
system: typeof system;
signals: typeof signals;
package: typeof package;
mainloop: typeof mainloop;
searchPath: string[];
gettext: typeof gettext;
byteArray: typeof byteArray;
format: typeof format;
cairo: typeof cairo;
}
// Overwrites, see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/script/package.js
/**
* Run `pkg.initGettext()` before using this.
* See {@link gettext.gettext}
*/
const _: typeof gettext.gettext;
/**
* Run `pkg.initGettext()` before using this.
* See {@link gettext.pgettext}
*/
const C_: typeof gettext.pgettext;
/**
* Run `pkg.initGettext()` before using this.
* Currently not implemented.
*/
const N_: (x: string) => string;
function print(...args: any[]): void;
function printerr(...args: any[]): void;
function log(obj: object, others?: object[]): void;
function log(msg: string, substitutions?: any[]): void;
function logError(exception: object, message?: any): void;
function logError(message?: any): void;
const pkg: typeof package;
interface BooleanConstructor {
$gtype: GObject.GType<boolean>;
}
interface NumberConstructor {
$gtype: GObject.GType<number>;
}
interface StringConstructor {
$gtype: GObject.GType<string>;
}
interface StringConstructor {
$gtype: GObject.GType<string>;
}
interface ObjectConstructor {
$gtype: GObject.GType<Object>;
}
const imports: GjsImports;
const ARGV: string[];
interface String {
/**
* Formats a string with the given arguments.
* This method is made available by calling `pkg.initFormat()`.
*
* Supported format specifiers:
* - %s: Formats as a string
* - %d: Formats as an integer
* - %x: Formats as a hexadecimal number
* - %f: Formats as a floating point number, optionally with precision (e.g. %.2f)
*
* All specifiers can be prefixed with a minimum field width, e.g. "%5s" will pad with spaces.
* If the width is prefixed with '0', it will pad with zeroes instead of spaces.
*
* @example
* ```ts
* // After calling pkg.initFormat()
* "Hello %s, you have %d items".format("User", 5);
* // Returns: "Hello User, you have 5 items"
*
* "Price: $%.2f".format(10.5);
* // Returns: "Price: $10.50"
*
* "ID: %05d".format(42);
* // Returns: "ID: 00042"
* ```
*
* @param args The arguments to format the string with
* @returns The formatted string
*/
format(...args: (string | number | boolean | null | undefined)[]): string;
}
}
declare const _imports: GjsImports;
export default _imports;
export { _imports as imports };

View File

@ -1,145 +0,0 @@
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://GL?version=1.0' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
export namespace GL {
/**
* GL-1.0
*/
function InitNames(): void;
class bitfield {
static $gtype: GObject.GType<bitfield>;
// Constructors
_init(...args: any[]): void;
}
class charARB {
static $gtype: GObject.GType<charARB>;
// Constructors
_init(...args: any[]): void;
}
class clampf {
static $gtype: GObject.GType<clampf>;
// Constructors
_init(...args: any[]): void;
}
class __boolean {
static $gtype: GObject.GType<__boolean>;
// Constructors
_init(...args: any[]): void;
}
class __enum {
static $gtype: GObject.GType<__enum>;
// Constructors
_init(...args: any[]): void;
}
class float {
static $gtype: GObject.GType<float>;
// Constructors
_init(...args: any[]): void;
}
class handleARB {
static $gtype: GObject.GType<handleARB>;
// Constructors
_init(...args: any[]): void;
}
class int {
static $gtype: GObject.GType<int>;
// Constructors
_init(...args: any[]): void;
}
class intptr {
static $gtype: GObject.GType<intptr>;
// Constructors
_init(...args: any[]): void;
}
class sizei {
static $gtype: GObject.GType<sizei>;
// Constructors
_init(...args: any[]): void;
}
class sizeiptr {
static $gtype: GObject.GType<sizeiptr>;
// Constructors
_init(...args: any[]): void;
}
class uint {
static $gtype: GObject.GType<uint>;
// Constructors
_init(...args: any[]): void;
}
class __void {
static $gtype: GObject.GType<__void>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default GL;
}
declare module 'gi://GL' {
import GL10 from 'gi://GL?version=1.0';
export default GL10;
}
// END

File diff suppressed because it is too large Load Diff

View File

@ -1,103 +0,0 @@
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://GLibUnix?version=2.0' {
// Module dependencies
import type GLib from 'gi://GLib?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
export namespace GLibUnix {
/**
* GLibUnix-2.0
*/
/**
* Mnemonic constants for the ends of a Unix pipe.
*/
/**
* Mnemonic constants for the ends of a Unix pipe.
*/
export namespace PipeEnd {
export const $gtype: GObject.GType<PipeEnd>;
}
enum PipeEnd {
/**
* The readable file descriptor 0
*/
READ,
/**
* The writable file descriptor 1
*/
WRITE,
}
function closefrom(lowfd: number): number;
function error_quark(): GLib.Quark;
function fd_add_full(
priority: number,
fd: number,
condition: GLib.IOCondition | null,
_function: GLib.UnixFDSourceFunc,
): number;
function fd_source_new(fd: number, condition: GLib.IOCondition | null): GLib.Source;
function fdwalk_set_cloexec(lowfd: number): number;
function get_passwd_entry(user_name: string): any | null;
function open_pipe(fds: number, flags: number): boolean;
function set_fd_nonblocking(fd: number, nonblock: boolean): boolean;
function signal_add_full(priority: number, signum: number, handler: GLib.SourceFunc): number;
function signal_source_new(signum: number): GLib.Source;
interface FDSourceFunc {
(fd: number, condition: GLib.IOCondition): boolean;
}
/**
* A Unix pipe. The advantage of this type over `int[2]` is that it can
* be closed automatically when it goes out of scope, using `g_auto(GUnixPipe)`,
* on compilers that support that feature.
*/
class Pipe {
static $gtype: GObject.GType<Pipe>;
// Fields
fds: number[];
// Constructors
constructor(
properties?: Partial<{
fds: number[];
}>,
);
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default GLibUnix;
}
declare module 'gi://GLibUnix' {
import GLibUnix20 from 'gi://GLibUnix?version=2.0';
export default GLibUnix20;
}
// END

View File

@ -1,207 +0,0 @@
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://GModule?version=2.0' {
// Module dependencies
import type GLib from 'gi://GLib?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
export namespace GModule {
/**
* GModule-2.0
*/
/**
* Errors returned by g_module_open_full().
*/
class ModuleError extends GLib.Error {
static $gtype: GObject.GType<ModuleError>;
// Static fields
/**
* there was an error loading or opening a module file
*/
static FAILED: number;
/**
* a module returned an error from its `g_module_check_init()` function
*/
static CHECK_FAILED: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
}
const MODULE_IMPL_AR: number;
const MODULE_IMPL_DL: number;
const MODULE_IMPL_NONE: number;
const MODULE_IMPL_WIN32: number;
/**
* A portable way to build the filename of a module. The platform-specific
* prefix and suffix are added to the filename, if needed, and the result
* is added to the directory, using the correct separator character.
*
* The directory should specify the directory where the module can be found.
* It can be %NULL or an empty string to indicate that the module is in a
* standard platform-specific directory, though this is not recommended
* since the wrong module may be found.
*
* For example, calling g_module_build_path() on a Linux system with a
* `directory` of `/lib` and a `module_name` of "mylibrary" will return
* `/lib/libmylibrary.so`. On a Windows system, using `\Windows` as the
* directory it will return `\Windows\mylibrary.dll`.
* @param directory the directory where the module is. This can be %NULL or the empty string to indicate that the standard platform-specific directories will be used, though that is not recommended
* @param module_name the name of the module
* @returns the complete path of the module, including the standard library prefix and suffix. This should be freed when no longer needed
*/
function module_build_path(directory: string | null, module_name: string): string;
/**
* Gets a string describing the last module error.
* @returns a string describing the last module error
*/
function module_error(): string;
function module_error_quark(): GLib.Quark;
/**
* Checks if modules are supported on the current platform.
* @returns %TRUE if modules are supported
*/
function module_supported(): boolean;
interface ModuleCheckInit {
(module: Module): string;
}
interface ModuleUnload {
(module: Module): void;
}
/**
* Flags passed to g_module_open().
* Note that these flags are not supported on all platforms.
*/
/**
* Flags passed to g_module_open().
* Note that these flags are not supported on all platforms.
*/
export namespace ModuleFlags {
export const $gtype: GObject.GType<ModuleFlags>;
}
enum ModuleFlags {
/**
* specifies that symbols are only resolved when
* needed. The default action is to bind all symbols when the module
* is loaded.
*/
LAZY,
/**
* specifies that symbols in the module should
* not be added to the global name space. The default action on most
* platforms is to place symbols in the module in the global name space,
* which may cause conflicts with existing symbols.
*/
LOCAL,
/**
* mask for all flags.
*/
MASK,
}
/**
* The #GModule struct is an opaque data structure to represent a
* [dynamically-loaded module](modules.html#dynamic-loading-of-modules).
* It should only be accessed via the following functions.
*/
abstract class Module {
static $gtype: GObject.GType<Module>;
// Constructors
_init(...args: any[]): void;
// Static methods
/**
* A portable way to build the filename of a module. The platform-specific
* prefix and suffix are added to the filename, if needed, and the result
* is added to the directory, using the correct separator character.
*
* The directory should specify the directory where the module can be found.
* It can be %NULL or an empty string to indicate that the module is in a
* standard platform-specific directory, though this is not recommended
* since the wrong module may be found.
*
* For example, calling g_module_build_path() on a Linux system with a
* `directory` of `/lib` and a `module_name` of "mylibrary" will return
* `/lib/libmylibrary.so`. On a Windows system, using `\Windows` as the
* directory it will return `\Windows\mylibrary.dll`.
* @param directory the directory where the module is. This can be %NULL or the empty string to indicate that the standard platform-specific directories will be used, though that is not recommended
* @param module_name the name of the module
*/
static build_path(directory: string | null, module_name: string): string;
/**
* Gets a string describing the last module error.
*/
static error(): string;
static error_quark(): GLib.Quark;
/**
* Checks if modules are supported on the current platform.
*/
static supported(): boolean;
// Methods
/**
* Closes a module.
* @returns %TRUE on success
*/
close(): boolean;
/**
* Ensures that a module will never be unloaded.
* Any future g_module_close() calls on the module will be ignored.
*/
make_resident(): void;
/**
* Returns the filename that the module was opened with.
*
* If `module` refers to the application itself, "main" is returned.
* @returns the filename of the module
*/
name(): string;
/**
* Gets a symbol pointer from a module, such as one exported
* by %G_MODULE_EXPORT. Note that a valid symbol can be %NULL.
* @param symbol_name the name of the symbol to find
* @returns %TRUE on success
*/
symbol(symbol_name: string): [boolean, any];
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default GModule;
}
declare module 'gi://GModule' {
import GModule20 from 'gi://GModule?version=2.0';
export default GModule20;
}
// END

View File

@ -1,260 +0,0 @@
/// <reference path="./gnomedesktop-4.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./gdkpixbuf-2.0.d.ts" />
/// <reference path="./gdesktopenums-3.0.d.ts" />
/// <reference path="./gdk-4.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./cairo.d.ts" />
/// <reference path="./pangocairo-1.0.d.ts" />
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://GnomeBG?version=4.0' {
// Module dependencies
import type GnomeDesktop from 'gi://GnomeDesktop?version=4.0';
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type GDesktopEnums from 'gi://GDesktopEnums?version=3.0';
import type Gdk from 'gi://Gdk?version=4.0';
import type cairo from 'cairo';
import type PangoCairo from 'gi://PangoCairo?version=1.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
export namespace GnomeBG {
/**
* GnomeBG-4.0
*/
namespace BG {
// Signal callback interfaces
interface Changed {
(): void;
}
interface Transitioned {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class BG extends GObject.Object {
static $gtype: GObject.GType<BG>;
// Constructors
constructor(properties?: Partial<BG.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): BG;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
connect(signal: 'transitioned', callback: (_source: this) => void): number;
connect_after(signal: 'transitioned', callback: (_source: this) => void): number;
emit(signal: 'transitioned'): void;
// Methods
changes_with_time(): boolean;
/**
* Creates a thumbnail for a certain frame, where 'frame' is somewhat
* vaguely defined as 'suitable point to show while single-stepping
* through the slideshow'.
* @param factory
* @param screen_area
* @param dest_width
* @param dest_height
* @param frame_num
* @returns the newly created thumbnail or or NULL if frame_num is out of bounds.
*/
create_frame_thumbnail(
factory: GnomeDesktop.DesktopThumbnailFactory,
screen_area: cairo.RectangleInt,
dest_width: number,
dest_height: number,
frame_num: number,
): GdkPixbuf.Pixbuf;
/**
* Create a surface that can be set as background for `window`.
* @param window
* @param width
* @param height
* @returns %NULL on error (e.g. out of X connections)
*/
create_surface(window: Gdk.Surface, width: number, height: number): cairo.Surface;
create_thumbnail(
factory: GnomeDesktop.DesktopThumbnailFactory,
screen_area: cairo.RectangleInt,
dest_width: number,
dest_height: number,
): GdkPixbuf.Pixbuf;
draw(dest: GdkPixbuf.Pixbuf): void;
get_filename(): string;
get_image_size(
factory: GnomeDesktop.DesktopThumbnailFactory,
best_width: number,
best_height: number,
width: number,
height: number,
): boolean;
get_placement(): GDesktopEnums.BackgroundStyle;
get_rgba(type: GDesktopEnums.BackgroundShading | null, primary: Gdk.RGBA, secondary: Gdk.RGBA): void;
has_multiple_sizes(): boolean;
is_dark(dest_width: number, dest_height: number): boolean;
load_from_preferences(settings: Gio.Settings): void;
save_to_preferences(settings: Gio.Settings): void;
set_filename(filename: string): void;
set_placement(placement: GDesktopEnums.BackgroundStyle | null): void;
set_rgba(type: GDesktopEnums.BackgroundShading | null, primary: Gdk.RGBA, secondary: Gdk.RGBA): void;
}
namespace BGSlideShow {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
file: Gio.File;
has_multiple_sizes: boolean;
hasMultipleSizes: boolean;
start_time: number;
startTime: number;
total_duration: number;
totalDuration: number;
}
}
class BGSlideShow extends GObject.Object {
static $gtype: GObject.GType<BGSlideShow>;
// Properties
get file(): Gio.File;
get has_multiple_sizes(): boolean;
get hasMultipleSizes(): boolean;
get start_time(): number;
get startTime(): number;
get total_duration(): number;
get totalDuration(): number;
// Fields
parent_object: GObject.Object;
// Constructors
constructor(properties?: Partial<BGSlideShow.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](filename: string): BGSlideShow;
// Methods
/**
* Returns the current slides progress.
* @param width monitor width
* @param height monitor height
*/
get_current_slide(width: number, height: number): [number, number, boolean, string, string];
/**
* gets whether or not the slide show has multiple sizes for different monitors
* @returns %TRUE if multiple sizes
*/
get_has_multiple_sizes(): boolean;
/**
* Returns number of slides in slide show
*/
get_num_slides(): number;
/**
* Retrieves slide by frame number
* @param frame_number frame number
* @param width monitor width
* @param height monitor height
* @returns %TRUE if successful
*/
get_slide(
frame_number: number,
width: number,
height: number,
): [boolean, number, number, boolean, string, string];
/**
* gets the start time of the slide show
* @returns a timestamp
*/
get_start_time(): number;
/**
* gets the total duration of the slide show
* @returns a timestamp
*/
get_total_duration(): number;
/**
* Tries to load the slide show.
* @returns %TRUE if successful
*/
load(): boolean;
/**
* Tries to load the slide show asynchronously.
* @param cancellable a #GCancellable
* @param callback the callback
*/
load_async(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): void;
}
type BGClass = typeof BG;
type BGSlideShowClass = typeof BGSlideShow;
abstract class BGSlideShowPrivate {
static $gtype: GObject.GType<BGSlideShowPrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default GnomeBG;
}
declare module 'gi://GnomeBG' {
import GnomeBG40 from 'gi://GnomeBG?version=4.0';
export default GnomeBG40;
}
// END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,355 +0,0 @@
/// <reference path="./gst-1.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://GstAllocators?version=1.0' {
// Module dependencies
import type Gst from 'gi://Gst?version=1.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace GstAllocators {
/**
* GstAllocators-1.0
*/
const ALLOCATOR_DMABUF: string;
const ALLOCATOR_FD: string;
/**
* Name of this allocator, to be used for example with gst_allocator_find() and
* gst_memory_is_type().
*/
const ALLOCATOR_SHM: string;
/**
* Constant that defines the caps feature name for DMA buffer sharing.
*
* It has to be used for non-mappable dma-buf only, i.e. when the underlying
* memory is not mappable to user space. Or when the mapped memory contains
* non meaningful data. It can be the case for protected content or when the
* user wants explicitly avoid any software post processing.
*
* In these cases all elements between the exported and the importer has to work
* in passthrough mode. This is done by adding this caps feature.
*
* When the memory is mappable for read and write requests then it is assumes
* to be a fast path and so this caps feature should not be used. Though
* according to the dma-buf protocol, while it is mapped it prevents the
* exporter to migrate the buffer.
*
* This caps feature should not serve at all the purpose of selecting the
* `GST_ALLOCATOR_DMABUF` allocator during caps negotiation.
* When the exporter is the upstream element from the importer point of view,
* the exporter should try to map the dma buffer at runtime (preferably during
* decide_allocation phase). When it succeeds for #GST_MAP_READWRITE this caps
* feature should not be used. This allows scalers, color converts and any image
* processing filters to work directly on the dma buffer.
* In this case the importer element should check all incoming memory using
* gst_is_dmabuf_memory().
*/
const CAPS_FEATURE_MEMORY_DMABUF: string;
/**
* Return the file descriptor associated with `mem`.
* @param mem the memory to get the file descriptor
* @returns the file descriptor associated with the memory, or -1. The file descriptor is still owned by the GstMemory. Use dup to take a copy if you intend to use it beyond the lifetime of this GstMemory.
*/
function dmabuf_memory_get_fd(mem: Gst.Memory): number;
/**
* Exports a DMABuf from the DRM Bumb buffer object. One can check if this
* feature is supported using gst_drm_dumb_allocator_has_prime_export();
* @param mem the memory to export from
* @returns a #GstMemory from #GstDmaBufAllocator wrapping the exported dma-buf file descriptor.
*/
function drm_dumb_memory_export_dmabuf(mem: Gst.Memory): Gst.Memory;
/**
* Return the DRM buffer object handle associated with `mem`.
* @param mem the memory to get the handle from
* @returns the DRM buffer object handle associated with the memory, or 0. The handle is still owned by the GstMemory and cannot be used beyond the lifetime of this GstMemory unless it is being passed to DRM driver, which does handle a refcount internally.
*/
function drm_dumb_memory_get_handle(mem: Gst.Memory): number;
/**
* Get the fd from `mem`. Call gst_is_fd_memory() to check if `mem` has
* an fd.
* @param mem #GstMemory
* @returns the fd of @mem or -1 when there is no fd on @mem
*/
function fd_memory_get_fd(mem: Gst.Memory): number;
/**
* Check if `mem` is dmabuf memory.
* @param mem the memory to be check
* @returns %TRUE if @mem is dmabuf memory, otherwise %FALSE
*/
function is_dmabuf_memory(mem: Gst.Memory): boolean;
function is_drm_dumb_memory(mem: Gst.Memory): boolean;
/**
* Check if `mem` is memory backed by an fd
* @param mem #GstMemory
* @returns %TRUE when @mem has an fd that can be retrieved with gst_fd_memory_get_fd().
*/
function is_fd_memory(mem: Gst.Memory): boolean;
function is_phys_memory(mem: Gst.Memory): boolean;
function phys_memory_get_phys_addr(mem: Gst.Memory): never;
/**
* Various flags to control the operation of the fd backed memory.
*/
/**
* Various flags to control the operation of the fd backed memory.
*/
export namespace FdMemoryFlags {
export const $gtype: GObject.GType<FdMemoryFlags>;
}
enum FdMemoryFlags {
/**
* no flag
*/
NONE,
/**
* once the memory is mapped,
* keep it mapped until the memory is destroyed.
*/
KEEP_MAPPED,
/**
* do a private mapping instead of
* the default shared mapping.
*/
MAP_PRIVATE,
/**
* don't close the file descriptor when
* the memory is freed. Since: 1.10
*/
DONT_CLOSE,
}
namespace DRMDumbAllocator {
// Constructor properties interface
interface ConstructorProps extends Gst.Allocator.ConstructorProps {
drm_device_path: string;
drmDevicePath: string;
drm_fd: number;
drmFd: number;
}
}
/**
* Private intance object for #GstDRMDumbAllocator.
*/
class DRMDumbAllocator extends Gst.Allocator {
static $gtype: GObject.GType<DRMDumbAllocator>;
// Properties
get drm_device_path(): string;
get drmDevicePath(): string;
get drm_fd(): number;
get drmFd(): number;
// Constructors
constructor(properties?: Partial<DRMDumbAllocator.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static new_with_device_path(drm_device_path: string): DRMDumbAllocator;
static new_with_fd(drm_fd: number): DRMDumbAllocator;
// Methods
/**
* Allocated a DRM buffer object for the specific `drm_fourcc,` `width` and
* `height`. Note that the DRM Dumb allocation interface is agnostic to the
* pixel format. This `drm_fourcc` is converted into a bpp (bit-per-pixel)
* number and the height is scaled according to the sub-sampling.
* @param drm_fourcc the DRM format to allocate for
* @param width padded width for this allocation
* @param height padded height for this allocation
* @returns a new DRM Dumb #GstMemory. Use gst_memory_unref() to release the memory after usage.
*/
alloc(drm_fourcc: number, width: number, height: number): [Gst.Memory, number];
// Conflicted with Gst.Allocator.alloc
alloc(...args: never[]): any;
/**
* This function allow verifying if the driver support dma-buf exportation.
* @returns %TRUE if the allocator support exporting dma-buf.
*/
has_prime_export(): boolean;
}
namespace DmaBufAllocator {
// Constructor properties interface
interface ConstructorProps extends FdAllocator.ConstructorProps {}
}
/**
* Base class for allocators with dmabuf-backed memory
*/
class DmaBufAllocator extends FdAllocator {
static $gtype: GObject.GType<DmaBufAllocator>;
// Constructors
constructor(properties?: Partial<DmaBufAllocator.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): DmaBufAllocator;
// Static methods
/**
* Return a %GstMemory that wraps a dmabuf file descriptor.
* @param allocator allocator to be used for this memory
* @param fd dmabuf file descriptor
* @param size memory size
*/
static alloc(allocator: Gst.Allocator, fd: number, size: number): Gst.Memory | null;
/**
* Return a %GstMemory that wraps a dmabuf file descriptor.
* @param allocator allocator to be used for this memory
* @param fd dmabuf file descriptor
* @param size memory size
* @param flags extra #GstFdMemoryFlags
*/
static alloc_with_flags(
allocator: Gst.Allocator,
fd: number,
size: number,
flags: FdMemoryFlags,
): Gst.Memory | null;
}
namespace FdAllocator {
// Constructor properties interface
interface ConstructorProps extends Gst.Allocator.ConstructorProps {}
}
/**
* Base class for allocators with fd-backed memory
*/
class FdAllocator extends Gst.Allocator {
static $gtype: GObject.GType<FdAllocator>;
// Constructors
constructor(properties?: Partial<FdAllocator.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): FdAllocator;
// Static methods
/**
* Return a %GstMemory that wraps a generic file descriptor.
* @param allocator allocator to be used for this memory
* @param fd file descriptor
* @param size memory size
* @param flags extra #GstFdMemoryFlags
*/
static alloc(allocator: Gst.Allocator, fd: number, size: number, flags: FdMemoryFlags): Gst.Memory | null;
}
namespace ShmAllocator {
// Constructor properties interface
interface ConstructorProps extends FdAllocator.ConstructorProps {}
}
/**
* This is a subclass of #GstFdAllocator that implements the
* gst_allocator_alloc() method using `memfd_create()` when available, POSIX
* `shm_open()` otherwise. Platforms not supporting any of those (Windows) will
* always return %NULL.
*
* Note that allocating new shared memories has a significant performance cost,
* it is thus recommended to keep a pool of pre-allocated #GstMemory, using
* #GstBufferPool. For that reason, this allocator has the
* %GST_ALLOCATOR_FLAG_NO_COPY flag set.
*/
class ShmAllocator extends FdAllocator {
static $gtype: GObject.GType<ShmAllocator>;
// Constructors
constructor(properties?: Partial<ShmAllocator.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Static methods
/**
* Get the #GstShmAllocator singleton previously registered with
* gst_shm_allocator_init_once().
*/
static get(): Gst.Allocator | null;
/**
* Register a #GstShmAllocator using gst_allocator_register() with the name
* %GST_ALLOCATOR_SHM. This is no-op after the first call.
*/
static init_once(): void;
}
type DRMDumbAllocatorClass = typeof DRMDumbAllocator;
type DmaBufAllocatorClass = typeof DmaBufAllocator;
type FdAllocatorClass = typeof FdAllocator;
type PhysMemoryAllocatorInterface = typeof PhysMemoryAllocator;
type ShmAllocatorClass = typeof ShmAllocator;
namespace PhysMemoryAllocator {
// Constructor properties interface
interface ConstructorProps extends Gst.Allocator.ConstructorProps {}
}
export interface PhysMemoryAllocatorNamespace {
$gtype: GObject.GType<PhysMemoryAllocator>;
prototype: PhysMemoryAllocator;
}
interface PhysMemoryAllocator extends Gst.Allocator {
// Virtual methods
/**
* Implementations shall return the physicall memory address
* that is backing the provided memory, or 0 if none.
* @param mem
*/
vfunc_get_phys_addr(mem: Gst.Memory): never;
}
export const PhysMemoryAllocator: PhysMemoryAllocatorNamespace & {
new (): PhysMemoryAllocator; // This allows `obj instanceof PhysMemoryAllocator`
};
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default GstAllocators;
}
declare module 'gi://GstAllocators' {
import GstAllocators10 from 'gi://GstAllocators?version=1.0';
export default GstAllocators10;
}
// END

Some files were not shown because too many files have changed in this diff Show More