/// /// /// /// /// /// /** * 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://SpiceClientGLib?version=2.0' { // Module dependencies import type GstBase from 'gi://GstBase?version=1.0'; 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'; import type Gio from 'gi://Gio?version=2.0'; export namespace SpiceClientGLib { /** * SpiceClientGLib-2.0 */ /** * An event, emitted by #SpiceChannel::channel-event signal. */ /** * An event, emitted by #SpiceChannel::channel-event signal. */ export namespace ChannelEvent { export const $gtype: GObject.GType; } enum ChannelEvent { /** * no event, or ignored event */ NONE, /** * connection is authentified and ready */ OPENED, /** * disconnecting from the current host and connecting to the target host. */ SWITCHING, /** * connection is closed normally (sent if channel was ready) */ CLOSED, /** * connection error */ ERROR_CONNECT, /** * SSL error */ ERROR_TLS, /** * error during link process */ ERROR_LINK, /** * authentication error */ ERROR_AUTH, /** * IO error */ ERROR_IO, } /** * Error codes returned by spice-client API. */ class ClientError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * generic error code */ static FAILED: number; /** * device redirection rejected by host */ static USB_DEVICE_REJECTED: number; /** * device disconnected (fatal IO error) */ static USB_DEVICE_LOST: number; /** * password is required */ static AUTH_NEEDS_PASSWORD: number; /** * username is required */ static AUTH_NEEDS_USERNAME: number; /** * password and username are required */ static AUTH_NEEDS_PASSWORD_AND_USERNAME: number; /** * USB service error */ static USB_SERVICE: number; // Constructors constructor(options: { message: string; code: number }); _init(...args: any[]): void; } /** * An action to perform on the VM. */ /** * An action to perform on the VM. */ export namespace QmpPortVmAction { export const $gtype: GObject.GType; } enum QmpPortVmAction { /** * This command will cause the VM process to exit gracefully. */ QUIT, /** * Performs a hard reset of the VM. */ RESET, /** * Performs a power down operation. */ POWER_DOWN, /** * Stop all VCPU execution. */ PAUSE, /** * Resume all VCPU execution. */ CONTINUE, /** * the last enum value. */ LAST, } /** * Session migration state. */ /** * Session migration state. */ export namespace SessionMigration { export const $gtype: GObject.GType; } enum SessionMigration { /** * no migration going on */ NONE, /** * the session is switching host (destroy and reconnect) */ SWITCHING, /** * the session is migrating seamlessly (reconnect) */ MIGRATING, /** * the migration is connecting to destination (Since: 0.27) */ CONNECTING, } /** * Spice-Gtk major version component (e.g. 1 if version is 1.2.3) */ const GTK_MAJOR_VERSION: number; /** * Spice-Gtk micro version component (e.g. 3 if version is 1.2.3) */ const GTK_MICRO_VERSION: number; /** * Spice-Gtk minor version component (e.g. 2 if version is 1.2.3) */ const GTK_MINOR_VERSION: number; const WEBDAV_CLIPBOARD_FOLDER_PATH: string; /** * Gets a #GQuark representing the string "spice-client-error-quark" * @returns the #GQuark representing the string. */ function client_error_quark(): GLib.Quark; /** * Retrieves the GL scanout if available * @param channel a #SpiceDisplayChannel * @returns the current GL scanout, or %NULL if none or not valid */ function display_get_gl_scanout(channel: DisplayChannel): GlScanout; /** * After a SpiceDisplayChannel::gl-draw is emitted, the client should * draw the current display with the current GL scanout, and must * release the GL resource with a call to spice_display_gl_draw_done() * (failing to do so for each gl-draw may result in a frozen display). * @param channel a #SpiceDisplayChannel */ function display_gl_draw_done(channel: DisplayChannel): void; /** * Gets commandline options. * * Bindings for other languages are available since 0.32 * @returns a #GOptionGroup for the commandline arguments specific to Spice. You have to call spice_set_session_option() after to set the options on a #SpiceSession. */ function get_option_group(): GLib.OptionGroup; /** * Press a mouse button. * @param channel a #SpiceInputsChannel * @param button a SPICE_MOUSE_BUTTON * @param button_state SPICE_MOUSE_BUTTON_MASK flags */ function inputs_button_press(channel: InputsChannel, button: number, button_state: number): void; /** * Release a button. * @param channel a #SpiceInputsChannel * @param button a SPICE_MOUSE_BUTTON * @param button_state SPICE_MOUSE_BUTTON_MASK flags */ function inputs_button_release(channel: InputsChannel, button: number, button_state: number): void; /** * Press a key. * @param channel a #SpiceInputsChannel * @param scancode a PC XT (set 1) key scancode. For scancodes with an \%0xe0 prefix, drop the prefix and OR the scancode with \%0x100. */ function inputs_key_press(channel: InputsChannel, scancode: number): void; /** * Press and release a key event atomically (in the same message). * @param channel a #SpiceInputsChannel * @param scancode a PC XT (set 1) key scancode. For scancodes with an \%0xe0 prefix, drop the prefix and OR the scancode with \%0x100. */ function inputs_key_press_and_release(channel: InputsChannel, scancode: number): void; /** * Release a key. * @param channel a #SpiceInputsChannel * @param scancode a PC XT (set 1) key scancode. For scancodes with an \%0xe0 prefix, drop the prefix and OR the scancode with \%0x100. */ function inputs_key_release(channel: InputsChannel, scancode: number): void; /** * Change mouse position (used in SPICE_MOUSE_MODE_SERVER). * @param channel a #SpiceInputsChannel * @param dx delta X mouse coordinates * @param dy delta Y mouse coordinates * @param button_state SPICE_MOUSE_BUTTON_MASK flags */ function inputs_motion(channel: InputsChannel, dx: number, dy: number, button_state: number): void; /** * Change mouse position (used in SPICE_MOUSE_MODE_CLIENT). * @param channel a #SpiceInputsChannel * @param x X mouse coordinates * @param y Y mouse coordinates * @param display display channel id * @param button_state SPICE_MOUSE_BUTTON_MASK flags */ function inputs_position( channel: InputsChannel, x: number, y: number, display: number, button_state: number, ): void; /** * Set the keyboard locks on the guest (Caps, Num, Scroll..) * @param channel a #SpiceInputsChannel * @param locks #SpiceInputsLock modifiers flags */ function inputs_set_key_locks(channel: InputsChannel, locks: number): void; /** * Test capability of a remote agent. * @param channel a #SpiceMainChannel * @param cap an agent capability identifier * @returns %TRUE if @cap (channel kind capability) is available. */ function main_agent_test_capability(channel: MainChannel, cap: number): boolean; /** * Grab the guest clipboard, with #VD_AGENT_CLIPBOARD `types`. * @param channel a #SpiceMainChannel * @param types an array of #VD_AGENT_CLIPBOARD types available in the clipboard */ function main_clipboard_grab(channel: MainChannel, types: number[]): void; /** * Send the clipboard data to the guest. * @param channel a #SpiceMainChannel * @param type a #VD_AGENT_CLIPBOARD type * @param data clipboard data */ function main_clipboard_notify(channel: MainChannel, type: number, data: Uint8Array | string): void; /** * Release the clipboard (for example, when the client loses the * clipboard grab): Inform the guest no clipboard data is available. * @param channel a #SpiceMainChannel */ function main_clipboard_release(channel: MainChannel): void; /** * Request clipboard data of `type` from the guest. The reply is sent * through the #SpiceMainChannel::main-clipboard signal. * @param channel a #SpiceMainChannel * @param type a #VD_AGENT_CLIPBOARD type */ function main_clipboard_request(channel: MainChannel, type: number): void; /** * Grab the guest clipboard, with #VD_AGENT_CLIPBOARD `types`. * @param channel a #SpiceMainChannel * @param selection one of the clipboard #VD_AGENT_CLIPBOARD_SELECTION_* * @param types an array of #VD_AGENT_CLIPBOARD types available in the clipboard */ function main_clipboard_selection_grab(channel: MainChannel, selection: number, types: number[]): void; /** * Send the clipboard data to the guest. * @param channel a #SpiceMainChannel * @param selection one of the clipboard #VD_AGENT_CLIPBOARD_SELECTION_* * @param type a #VD_AGENT_CLIPBOARD type * @param data clipboard data */ function main_clipboard_selection_notify( channel: MainChannel, selection: number, type: number, data: Uint8Array | string, ): void; /** * Release the clipboard (for example, when the client loses the * clipboard grab): Inform the guest no clipboard data is available. * @param channel a #SpiceMainChannel * @param selection one of the clipboard #VD_AGENT_CLIPBOARD_SELECTION_* */ function main_clipboard_selection_release(channel: MainChannel, selection: number): void; /** * Request clipboard data of `type` from the guest. The reply is sent * through the #SpiceMainChannel::main-clipboard-selection signal. * @param channel a #SpiceMainChannel * @param selection one of the clipboard #VD_AGENT_CLIPBOARD_SELECTION_* * @param type a #VD_AGENT_CLIPBOARD type */ function main_clipboard_selection_request(channel: MainChannel, selection: number, type: number): void; /** * See: spice_main_channel_file_copy_async() * @param channel a #SpiceMainChannel * @param sources a %NULL-terminated array of #GFile objects to be transferred * @param flags set of #GFileCopyFlags * @param cancellable optional #GCancellable object, %NULL to ignore * @param progress_callback function to callback with progress information, or %NULL if progress information is not needed */ function main_file_copy_async( channel: MainChannel, sources: Gio.File[], flags: Gio.FileCopyFlags | null, cancellable?: Gio.Cancellable | null, progress_callback?: Gio.FileProgressCallback | null, ): Promise; /** * See: spice_main_channel_file_copy_async() * @param channel a #SpiceMainChannel * @param sources a %NULL-terminated array of #GFile objects to be transferred * @param flags set of #GFileCopyFlags * @param cancellable optional #GCancellable object, %NULL to ignore * @param progress_callback function to callback with progress information, or %NULL if progress information is not needed * @param callback a #GAsyncReadyCallback to call when the request is satisfied */ function main_file_copy_async( channel: MainChannel, sources: Gio.File[], flags: Gio.FileCopyFlags | null, cancellable: Gio.Cancellable | null, progress_callback: Gio.FileProgressCallback | null, callback: Gio.AsyncReadyCallback | null, ): void; /** * See: spice_main_channel_file_copy_async() * @param channel a #SpiceMainChannel * @param sources a %NULL-terminated array of #GFile objects to be transferred * @param flags set of #GFileCopyFlags * @param cancellable optional #GCancellable object, %NULL to ignore * @param progress_callback function to callback with progress information, or %NULL if progress information is not needed * @param callback a #GAsyncReadyCallback to call when the request is satisfied */ function main_file_copy_async( channel: MainChannel, sources: Gio.File[], flags: Gio.FileCopyFlags | null, cancellable?: Gio.Cancellable | null, progress_callback?: Gio.FileProgressCallback | null, callback?: Gio.AsyncReadyCallback | null, ): Promise | void; /** * Finishes copying the file started with * spice_main_file_copy_async(). * @param channel a #SpiceMainChannel * @param result a #GAsyncResult. * @returns a %TRUE on success, %FALSE on error. */ function main_file_copy_finish(channel: MainChannel, result: Gio.AsyncResult): boolean; /** * Request a mouse mode to the server. The server may not be able to * change the mouse mode, but spice-gtk will try to request it * when possible. * @param channel a %SpiceMainChannel * @param mode a SPICE_MOUSE_MODE */ function main_request_mouse_mode(channel: MainChannel, mode: number): void; /** * Send monitors configuration previously set with * spice_main_set_display() and spice_main_set_display_enabled() * @param channel a #SpiceMainChannel * @returns %TRUE on success. */ function main_send_monitor_config(channel: MainChannel): boolean; /** * Notify the guest of screen resolution change. The notification is * sent 1 second later, if no further changes happen. * @param channel a #SpiceMainChannel * @param id display ID * @param x x position * @param y y position * @param width display width * @param height display height */ function main_set_display( channel: MainChannel, id: number, x: number, y: number, width: number, height: number, ): void; /** * When sending monitor configuration to agent guest, don't set * display `id,` which the agent translates to disabling the display * id. Note: this will take effect next time the monitor * configuration is sent. * @param channel a #SpiceMainChannel * @param id display ID (if -1: set all displays) * @param enabled wether display @id is enabled */ function main_set_display_enabled(channel: MainChannel, id: number, enabled: boolean): void; /** * Update the display `id` resolution. * * If `update` is %TRUE, the remote configuration will be updated too * after 1 second without further changes. You can send when you want * without delay the new configuration to the remote with * spice_main_send_monitor_config() * @param channel a #SpiceMainChannel * @param id display ID * @param x x position * @param y y position * @param width display width * @param height display height * @param update if %TRUE, update guest resolution after 1sec. */ function main_update_display( channel: MainChannel, id: number, x: number, y: number, width: number, height: number, update: boolean, ): void; /** * When sending monitor configuration to agent guest, if `enabled` is %FALSE, * don't set display `id,` which the agent translates to disabling the display * id. If `enabled` is %TRUE, the monitor will be included in the next monitor * update. Note: this will take effect next time the monitor configuration is * sent. * * If `update` is %FALSE, no server update will be triggered by this call, but * the value will be saved and used in the next configuration update. * @param channel a #SpiceMainChannel * @param id display ID (if -1: set all displays) * @param enabled wether display @id is enabled * @param update if %TRUE, update guest display state after 1sec. */ function main_update_display_enabled(channel: MainChannel, id: number, enabled: boolean, update: boolean): void; /** * Send an event to the port. * * Note: The values SPICE_PORT_EVENT_CLOSED and * SPICE_PORT_EVENT_OPENED are managed by the channel connection * state. * @param port a #SpicePortChannel * @param event a SPICE_PORT_EVENT value */ function port_event(port: PortChannel, event: number): void; /** * Request an asynchronous write of count bytes from `buffer` into the * `port`. When the operation is finished `callback` will be called. You * can then call spice_port_write_finish() to get the result of * the operation. * @param port A #SpicePortChannel * @param buffer the buffer containing the data to write * @param cancellable optional GCancellable object, NULL to ignore */ function port_write_async( port: PortChannel, buffer: Uint8Array | string, cancellable?: Gio.Cancellable | null, ): Promise; /** * Request an asynchronous write of count bytes from `buffer` into the * `port`. When the operation is finished `callback` will be called. You * can then call spice_port_write_finish() to get the result of * the operation. * @param port A #SpicePortChannel * @param buffer the buffer containing the data to write * @param cancellable optional GCancellable object, NULL to ignore * @param callback callback to call when the request is satisfied */ function port_write_async( port: PortChannel, buffer: Uint8Array | string, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null, ): void; /** * Request an asynchronous write of count bytes from `buffer` into the * `port`. When the operation is finished `callback` will be called. You * can then call spice_port_write_finish() to get the result of * the operation. * @param port A #SpicePortChannel * @param buffer the buffer containing the data to write * @param cancellable optional GCancellable object, NULL to ignore * @param callback callback to call when the request is satisfied */ function port_write_async( port: PortChannel, buffer: Uint8Array | string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null, ): Promise | void; /** * Finishes a port write operation. * @param port a #SpicePortChannel * @param result a #GAsyncResult * @returns a #gssize containing the number of bytes written to the stream. */ function port_write_finish(port: PortChannel, result: Gio.AsyncResult): number; /** * Send recorded PCM data to the guest. * @param channel a #SpiceRecordChannel * @param data PCM data * @param bytes size of @data * @param time stream timestamp */ function record_send_data(channel: RecordChannel, data: any | null, bytes: number, time: number): void; /** * Set various properties on `session,` according to the commandline * arguments given to spice_get_option_group() option group. * @param session a #SpiceSession to set option upon */ function set_session_option(session: Session): void; function util_get_debug(): boolean; /** * Gets the version string * @returns Spice-GTK version as a const string. */ function util_get_version_string(): string; /** * Enable or disable Spice-GTK debugging messages. * @param enabled %TRUE or %FALSE */ function util_set_debug(enabled: boolean): void; /** * Creates a string representation of `uuid,` of the form * "06e023d5-86d8-420e-8103-383e4566087a" * @param uuid UUID byte array * @returns A string that should be freed with g_free(). */ function uuid_to_string(uuid: Uint8Array | string): string; interface msg_handler { (channel: Channel, _in: MsgIn): void; } type VReader = object | null; /** * Constants used to synchronize modifiers between a client and a guest. */ /** * Constants used to synchronize modifiers between a client and a guest. */ export namespace InputsLock { export const $gtype: GObject.GType; } enum InputsLock { /** * Scroll Lock */ SCROLL_LOCK, /** * Num Lock */ NUM_LOCK, /** * Caps Lock */ CAPS_LOCK, } /** * Peer certificate verification parameters flags. */ /** * Peer certificate verification parameters flags. */ export namespace SessionVerify { export const $gtype: GObject.GType; } enum SessionVerify { /** * verify certificate public key matching */ PUBKEY, /** * verify certificate hostname matching */ HOSTNAME, /** * verify certificate subject matching */ SUBJECT, } module Audio { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { main_context: GLib.MainContext; mainContext: GLib.MainContext; session: Session; } } /** * The #SpiceAudio struct is opaque and should not be accessed directly. */ abstract class Audio extends GObject.Object { static $gtype: GObject.GType