///
///
/**
* 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://Dbusmenu?version=0.4' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
export namespace Dbusmenu {
/**
* Dbusmenu-0.4
*/
/**
* Tracks how the menus should be presented to the user.
*/
/**
* Tracks how the menus should be presented to the user.
*/
export namespace Status {
export const $gtype: GObject.GType;
}
enum Status {
/**
* Everything is normal
*/
NORMAL,
/**
* The menus should be shown at a higher priority
*/
NOTICE,
}
/**
* The direction of text that the strings that this server
* will be sending strings as.
*/
/**
* The direction of text that the strings that this server
* will be sending strings as.
*/
export namespace TextDirection {
export const $gtype: GObject.GType;
}
enum TextDirection {
/**
* Unspecified text direction
*/
NONE,
/**
* Left-to-right text direction
*/
LTR,
/**
* Right-to-left text direction
*/
RTL,
}
/**
* String to access property #DbusmenuClient:dbus-name
*/
const CLIENT_PROP_DBUS_NAME: string;
/**
* String to access property #DbusmenuClient:dbus-object
*/
const CLIENT_PROP_DBUS_OBJECT: string;
/**
* String to access property #DbusmenuClient:group-events
*/
const CLIENT_PROP_GROUP_EVENTS: string;
/**
* String to access property #DbusmenuClient:status
*/
const CLIENT_PROP_STATUS: string;
/**
* String to access property #DbusmenuClient:text-direction
*/
const CLIENT_PROP_TEXT_DIRECTION: string;
/**
* String to attach to signal #DbusmenuClient::event-result
*/
const CLIENT_SIGNAL_EVENT_RESULT: string;
/**
* String to attach to signal #DbusmenuClient::icon-theme-dirs-changed
*/
const CLIENT_SIGNAL_ICON_THEME_DIRS_CHANGED: string;
/**
* String to attach to signal #DbusmenuClient::item-activate
*/
const CLIENT_SIGNAL_ITEM_ACTIVATE: string;
/**
* String to attach to signal #DbusmenuClient::layout-updated
*/
const CLIENT_SIGNAL_LAYOUT_UPDATED: string;
/**
* String to attach to signal #DbusmenuClient::new-menuitem
*/
const CLIENT_SIGNAL_NEW_MENUITEM: string;
/**
* String to attach to signal #DbusmenuClient::root-changed
*/
const CLIENT_SIGNAL_ROOT_CHANGED: string;
/**
* Used to set the 'type' property on a menu item to create
* a standard menu item.
*/
const CLIENT_TYPES_DEFAULT: string;
/**
* Used to set the 'type' property on a menu item to create
* an image menu item. Deprecated as standard menu items now
* support images as well.
*/
const CLIENT_TYPES_IMAGE: string;
/**
* Used to set the 'type' property on a menu item to create
* a separator menu item.
*/
const CLIENT_TYPES_SEPARATOR: string;
/**
* Used in #DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY to have the
* subitems displayed as a submenu.
*/
const MENUITEM_CHILD_DISPLAY_SUBMENU: string;
/**
* Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu
* item displayed in a way that conveys it's giving an alert
* to the user.
*/
const MENUITEM_DISPOSITION_ALERT: string;
/**
* Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu
* item displayed in a way that conveys it's giving additional
* information to the user.
*/
const MENUITEM_DISPOSITION_INFORMATIVE: string;
/**
* Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu
* item displayed in the normal manner. Default value.
*/
const MENUITEM_DISPOSITION_NORMAL: string;
/**
* Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu
* item displayed in a way that conveys it's giving a warning
* to the user.
*/
const MENUITEM_DISPOSITION_WARNING: string;
/**
* String for the event identifier when a menu item is clicked
* on by the user.
*/
const MENUITEM_EVENT_ACTIVATED: string;
/**
* String for the event identifier when a menu is closed and
* displayed to the user. Only valid for items that contain
* submenus.
*/
const MENUITEM_EVENT_CLOSED: string;
/**
* String for the event identifier when a menu is opened and
* displayed to the user. Only valid for items that contain
* submenus.
*/
const MENUITEM_EVENT_OPENED: string;
/**
* Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's
* toggle item is undecided.
*/
const MENUITEM_ICON_NAME_BLANK: string;
/**
* #DbusmenuMenuitem property used to provide a textual description of any
* information that the icon may convey. The contents of this property are
* passed through to assistive technologies such as the Orca screen reader.
* The contents of this property will not be visible in the menu item. If
* this property is set, Orca will use this property instead of the label
* property.
*/
const MENUITEM_PROP_ACCESSIBLE_DESC: string;
/**
* #DbusmenuMenuitem property that tells how the children of this menuitem
* should be displayed. Most likely this will be unset or of the value
* #DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU. Type: #G_VARIANT_TYPE_STRING
*/
const MENUITEM_PROP_CHILD_DISPLAY: string;
/**
* #DbusmenuMenuitem property to tell what type of information that the
* menu item is displaying to the user. Type: #G_VARIANT_TYPE_STRING
*/
const MENUITEM_PROP_DISPOSITION: string;
/**
* #DbusmenuMenuitem property used to represent whether the menuitem
* is clickable or not. Type: #G_VARIANT_TYPE_BOOLEAN.
*/
const MENUITEM_PROP_ENABLED: string;
/**
* #DbusmenuMenuitem property that is the raw data of a custom icon
* used in the application. Type: #G_VARIANT_TYPE_VARIANT
*
* It is recommended that this is not set directly but instead the
* libdbusmenu-gtk library is used with the function dbusmenu_menuitem_property_set_image()
*/
const MENUITEM_PROP_ICON_DATA: string;
/**
* #DbusmenuMenuitem property that is the name of the icon under the
* Freedesktop.org icon naming spec. Type: #G_VARIANT_TYPE_STRING
*/
const MENUITEM_PROP_ICON_NAME: string;
/**
* #DbusmenuMenuitem property used for the text on the menu item.
*/
const MENUITEM_PROP_LABEL: string;
/**
* #DbusmenuMenuitem property that is the entries that represent a shortcut
* to activate the menuitem. It is an array of arrays of strings.
*
* It is recommended that this is not set directly but instead the
* libdbusmenu-gtk library is used with the function dbusmenu_menuitem_property_set_shortcut()
*/
const MENUITEM_PROP_SHORTCUT: string;
/**
* #DbusmenuMenuitem property that says what state a toggle entry should
* be shown as the menu. Should be either #DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED
* #DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED or #DBUSMENU_MENUITEM_TOGGLE_STATUE_UNKNOWN.
*/
const MENUITEM_PROP_TOGGLE_STATE: string;
/**
* #DbusmenuMenuitem property that says what type of toggle entry should
* be shown in the menu. Should be either #DBUSMENU_MENUITEM_TOGGLE_CHECK
* or #DBUSMENU_MENUITEM_TOGGLE_RADIO. Type: #G_VARIANT_TYPE_STRING
*/
const MENUITEM_PROP_TOGGLE_TYPE: string;
/**
* #DbusmenuMenuitem property used to represent what type of menuitem
* this object represents. Type: #G_VARIANT_TYPE_STRING.
*/
const MENUITEM_PROP_TYPE: string;
/**
* #DbusmenuMenuitem property used to represent whether the menuitem
* should be shown or not. Type: #G_VARIANT_TYPE_BOOLEAN.
*/
const MENUITEM_PROP_VISIBLE: string;
/**
* Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the
* alternate key.
*/
const MENUITEM_SHORTCUT_ALT: string;
/**
* Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the
* control key.
*/
const MENUITEM_SHORTCUT_CONTROL: string;
/**
* Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the
* shift key.
*/
const MENUITEM_SHORTCUT_SHIFT: string;
/**
* Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the
* super key.
*/
const MENUITEM_SHORTCUT_SUPER: string;
/**
* String to attach to signal #DbusmenuServer::about-to-show
*/
const MENUITEM_SIGNAL_ABOUT_TO_SHOW: string;
/**
* String to attach to signal #DbusmenuServer::child-added
*/
const MENUITEM_SIGNAL_CHILD_ADDED: string;
/**
* String to attach to signal #DbusmenuServer::child-moved
*/
const MENUITEM_SIGNAL_CHILD_MOVED: string;
/**
* String to attach to signal #DbusmenuServer::child-removed
*/
const MENUITEM_SIGNAL_CHILD_REMOVED: string;
/**
* String to attach to signal #DbusmenuServer::event
*/
const MENUITEM_SIGNAL_EVENT: string;
/**
* String to attach to signal #DbusmenuServer::item-activated
*/
const MENUITEM_SIGNAL_ITEM_ACTIVATED: string;
/**
* String to attach to signal #DbusmenuServer::property-changed
*/
const MENUITEM_SIGNAL_PROPERTY_CHANGED: string;
/**
* String to attach to signal #DbusmenuServer::realized
*/
const MENUITEM_SIGNAL_REALIZED: string;
/**
* String to attach to signal #DbusmenuServer::show-to-user
*/
const MENUITEM_SIGNAL_SHOW_TO_USER: string;
/**
* Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE to be a standard
* check mark item.
*/
const MENUITEM_TOGGLE_CHECK: string;
/**
* Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE to be a standard
* radio item.
*/
const MENUITEM_TOGGLE_RADIO: string;
/**
* Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's
* toggle item is filled.
*/
const MENUITEM_TOGGLE_STATE_CHECKED: number;
/**
* Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's
* toggle item is empty.
*/
const MENUITEM_TOGGLE_STATE_UNCHECKED: number;
/**
* Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's
* toggle item is undecided.
*/
const MENUITEM_TOGGLE_STATE_UNKNOWN: number;
/**
* String to access property #DbusmenuServer:dbus-object
*/
const SERVER_PROP_DBUS_OBJECT: string;
/**
* String to access property #DbusmenuServer:root-node
*/
const SERVER_PROP_ROOT_NODE: string;
/**
* String to access property #DbusmenuServer:status
*/
const SERVER_PROP_STATUS: string;
/**
* String to access property #DbusmenuServer:text-direction
*/
const SERVER_PROP_TEXT_DIRECTION: string;
/**
* String to access property #DbusmenuServer:version
*/
const SERVER_PROP_VERSION: string;
/**
* String to attach to signal #DbusmenuServer::item-property-updated
*/
const SERVER_SIGNAL_ID_PROP_UPDATE: string;
/**
* String to attach to signal #DbusmenuServer::item-updated
*/
const SERVER_SIGNAL_ID_UPDATE: string;
/**
* String to attach to signal #DbusmenuServer::item-activation-requested
*/
const SERVER_SIGNAL_ITEM_ACTIVATION: string;
/**
* String to attach to signal #DbusmenuServer::layout-updated
*/
const SERVER_SIGNAL_LAYOUT_UPDATED: string;
interface ClientTypeHandler {
(newitem: Menuitem, parent: Menuitem, client: Client): boolean;
}
interface menuitem_about_to_show_cb {
(mi: Menuitem): void;
}
interface menuitem_buildvariant_slot_t {
(mi: Menuitem, properties?: string | null): GLib.Variant;
}
namespace Client {
// Signal callback interfaces
interface EventResult {
(object: GObject.Object, p0: string, p1: GLib.Variant, p2: number, p3?: any | null): void;
}
interface IconThemeDirsChanged {
(arg1?: any | null): void;
}
interface ItemActivate {
(arg1: GObject.Object, arg2: number): void;
}
interface LayoutUpdated {
(): void;
}
interface NewMenuitem {
(arg1: GObject.Object): void;
}
interface RootChanged {
(arg1: GObject.Object): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
dbus_name: string;
dbusName: string;
dbus_object: string;
dbusObject: string;
group_events: boolean;
groupEvents: boolean;
}
}
/**
* The client for a #DbusmenuServer creating a shared
* object set of #DbusmenuMenuitem objects.
*/
class Client extends GObject.Object {
static $gtype: GObject.GType;
// Properties
get dbus_name(): string;
get dbusName(): string;
get dbus_object(): string;
get dbusObject(): string;
get group_events(): boolean;
set group_events(val: boolean);
get groupEvents(): boolean;
set groupEvents(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](name: string, object: string): 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: 'event-result',
callback: (
_source: this,
object: GObject.Object,
p0: string,
p1: GLib.Variant,
p2: number,
p3: any | null,
) => void,
): number;
connect_after(
signal: 'event-result',
callback: (
_source: this,
object: GObject.Object,
p0: string,
p1: GLib.Variant,
p2: number,
p3: any | null,
) => void,
): number;
emit(
signal: 'event-result',
object: GObject.Object,
p0: string,
p1: GLib.Variant,
p2: number,
p3?: any | null,
): void;
connect(signal: 'icon-theme-dirs-changed', callback: (_source: this, arg1: any | null) => void): number;
connect_after(
signal: 'icon-theme-dirs-changed',
callback: (_source: this, arg1: any | null) => void,
): number;
emit(signal: 'icon-theme-dirs-changed', arg1?: any | null): void;
connect(
signal: 'item-activate',
callback: (_source: this, arg1: GObject.Object, arg2: number) => void,
): number;
connect_after(
signal: 'item-activate',
callback: (_source: this, arg1: GObject.Object, arg2: number) => void,
): number;
emit(signal: 'item-activate', arg1: GObject.Object, arg2: number): void;
connect(signal: 'layout-updated', callback: (_source: this) => void): number;
connect_after(signal: 'layout-updated', callback: (_source: this) => void): number;
emit(signal: 'layout-updated'): void;
connect(signal: 'new-menuitem', callback: (_source: this, arg1: GObject.Object) => void): number;
connect_after(signal: 'new-menuitem', callback: (_source: this, arg1: GObject.Object) => void): number;
emit(signal: 'new-menuitem', arg1: GObject.Object): void;
connect(signal: 'root-changed', callback: (_source: this, arg1: GObject.Object) => void): number;
connect_after(signal: 'root-changed', callback: (_source: this, arg1: GObject.Object) => void): number;
emit(signal: 'root-changed', arg1: GObject.Object): void;
// Methods
/**
* This function connects into the type handling of the #DbusmenuClient.
* Every new menuitem that comes in immediately gets asked for its
* properties. When we get those properties we check the 'type'
* property and look to see if it matches a handler that is known
* by the client. If so, the `newfunc` function is executed on that
* #DbusmenuMenuitem. If not, then the DbusmenuClient::new-menuitem
* signal is sent.
*
* In the future the known types will be sent to the server so that it
* can make choices about the menu item types availble.
* @param type A text string that will be matched with the 'type' property on incoming menu items
* @param newfunc The function that will be executed with those new items when they come in.
* @returns If registering the new type was successful.
*/
add_type_handler(type: string, newfunc: ClientTypeHandler): boolean;
/**
* This function connects into the type handling of the #DbusmenuClient.
* Every new menuitem that comes in immediately gets asked for its
* properties. When we get those properties we check the 'type'
* property and look to see if it matches a handler that is known
* by the client. If so, the `newfunc` function is executed on that
* #DbusmenuMenuitem. If not, then the DbusmenuClient::new-menuitem
* signal is sent.
*
* In the future the known types will be sent to the server so that it
* can make choices about the menu item types availble.
* @param type A text string that will be matched with the 'type' property on incoming menu items
* @param newfunc The function that will be executed with those new items when they come in.
* @returns If registering the new type was successful.
*/
add_type_handler_full(type: string, newfunc: ClientTypeHandler): boolean;
/**
* Gets the stored and exported icon paths from the client.
* @returns A NULL-terminated list of icon paths with memory managed by the client. Duplicate if you want to keep them.
*/
get_icon_paths(): string[];
/**
* Grabs the root node for the specified client `client`. This
* function may block. It will block if there is currently a
* call to update the layout, it will block on that layout
* updated and then return the newly updated layout. Chances
* are that this update is in the queue for the mainloop as
* it would have been requested some time ago, but in theory
* it could block longer.
* @returns A #DbusmenuMenuitem representing the root of menu on the server. If there is no server or there is an error receiving its layout it'll return #NULL.
*/
get_root(): Menuitem;
/**
* Gets the recommended current status that the server
* is exporting for the menus. In situtations where the
* value is #DBUSMENU_STATUS_NOTICE it is recommended that
* the client show the menus to the user an a more noticible
* way.
*
* Return value: Status being exported.
*/
get_status(): Status;
/**
* Gets the text direction that the server is exporting. If
* the server is not exporting a direction then the value
* #DBUSMENU_TEXT_DIRECTION_NONE will be returned.
*
* Return value: Text direction being exported.
*/
get_text_direction(): TextDirection;
}
namespace Menuitem {
// Signal callback interfaces
interface AboutToShow {
(): boolean;
}
interface ChildAdded {
(arg1: GObject.Object, arg2: number): void;
}
interface ChildMoved {
(arg1: GObject.Object, arg2: number, arg3: number): void;
}
interface ChildRemoved {
(arg1: GObject.Object): void;
}
interface Event {
(arg1: string, arg2: GLib.Variant, arg3: number): boolean;
}
interface ItemActivated {
(arg1: number): void;
}
interface PropertyChanged {
(arg1: string, arg2: GLib.Variant): void;
}
interface Realized {
(): void;
}
interface ShowToUser {
(arg1: number): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
id: number;
}
}
/**
* This is the #GObject based object that represents a menu
* item. It gets created the same on both the client and
* the server side and libdbusmenu-glib does the work of making
* this object model appear on both sides of DBus. Simple
* really, though through updates and people coming on and off
* the bus it can lead to lots of fun complex scenarios.
*/
class Menuitem extends GObject.Object {
static $gtype: GObject.GType