UNPKG

@react-gnome/gjs-esm-types

Version:

TypeScript module declarations for GJS ESM modules.

1,347 lines (1,338 loc) 297 kB
/* * 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-gjs */ import type GLib from "gi://GLib?version=2.0"; declare module "gi://GObject?version=2.0" { /** * Flags to be passed to g_object_bind_property() or * g_object_bind_property_full(). * * This enumeration can be extended at later date. * @bitfield */ enum BindingFlags { /** * The default binding; if the source property * changes, the target property is updated with its value. */ DEFAULT, /** * Bidirectional binding; if either the * property of the source or the property of the target changes, * the other is updated. */ BIDIRECTIONAL, /** * Synchronize the values of the source and * target properties when creating the binding; the direction of * the synchronization is always from the source to the target. */ SYNC_CREATE, /** * If the two properties being bound are * booleans, setting one to %TRUE will result in the other being * set to %FALSE and vice versa. This flag will only work for * boolean properties, and cannot be used when passing custom * transformation functions to g_object_bind_property_full(). */ INVERT_BOOLEAN, } /** * The connection flags are used to specify the behaviour of a signal's * connection. * @bitfield */ enum ConnectFlags { /** * Default behaviour (no special flags). Since: 2.74 */ DEFAULT, /** * If set, the handler should be called after the * default handler of the signal. Normally, the handler is called before * the default handler. */ AFTER, /** * If set, the instance and data should be swapped when * calling the handler; see g_signal_connect_swapped() for an example. */ SWAPPED, } /** * Through the #GParamFlags flag values, certain aspects of parameters * can be configured. * * See also: %G_PARAM_STATIC_STRINGS * @bitfield */ enum ParamFlags { /** * the parameter is readable */ READABLE, /** * the parameter is writable */ WRITABLE, /** * alias for %G_PARAM_READABLE | %G_PARAM_WRITABLE */ READWRITE, /** * the parameter will be set upon object construction */ CONSTRUCT, /** * the parameter can only be set upon object construction */ CONSTRUCT_ONLY, /** * upon parameter conversion (see g_param_value_convert()) * strict validation is not required */ LAX_VALIDATION, /** * the string used as name when constructing the * parameter is guaranteed to remain valid and * unmodified for the lifetime of the parameter. * Since 2.8 */ STATIC_NAME, /** * internal */ PRIVATE, /** * the string used as nick when constructing the * parameter is guaranteed to remain valid and * unmmodified for the lifetime of the parameter. * Since 2.8 */ STATIC_NICK, /** * the string used as blurb when constructing the * parameter is guaranteed to remain valid and * unmodified for the lifetime of the parameter. * Since 2.8 */ STATIC_BLURB, /** * calls to g_object_set_property() for this * property will not automatically result in a "notify" signal being * emitted: the implementation must call g_object_notify() themselves * in case the property actually changes. Since: 2.42. */ EXPLICIT_NOTIFY, /** * the parameter is deprecated and will be removed * in a future version. A warning will be generated if it is used * while running with G_ENABLE_DIAGNOSTIC=1. * Since 2.26 */ DEPRECATED, } /** * The signal flags are used to specify a signal's behaviour. * @bitfield */ enum SignalFlags { /** * Invoke the object method handler in the first emission stage. */ RUN_FIRST, /** * Invoke the object method handler in the third emission stage. */ RUN_LAST, /** * Invoke the object method handler in the last emission stage. */ RUN_CLEANUP, /** * Signals being emitted for an object while currently being in * emission for this very object will not be emitted recursively, * but instead cause the first emission to be restarted. */ NO_RECURSE, /** * This signal supports "::detail" appendices to the signal name * upon handler connections and emissions. */ DETAILED, /** * Action signals are signals that may freely be emitted on alive * objects from user code via g_signal_emit() and friends, without * the need of being embedded into extra code that performs pre or * post emission adjustments on the object. They can also be thought * of as object methods which can be called generically by * third-party code. */ ACTION, /** * No emissions hooks are supported for this signal. */ NO_HOOKS, /** * Varargs signal emission will always collect the * arguments, even if there are no signal handlers connected. Since 2.30. */ MUST_COLLECT, /** * The signal is deprecated and will be removed * in a future version. A warning will be generated if it is connected while * running with G_ENABLE_DIAGNOSTIC=1. Since 2.32. */ DEPRECATED, /** * Only used in #GSignalAccumulator accumulator * functions for the #GSignalInvocationHint::run_type field to mark the first * call to the accumulator function for a signal emission. Since 2.68. */ ACCUMULATOR_FIRST_RUN, } /** * The match types specify what g_signal_handlers_block_matched(), * g_signal_handlers_unblock_matched() and g_signal_handlers_disconnect_matched() * match signals by. * @bitfield */ enum SignalMatchType { /** * The signal id must be equal. */ ID, /** * The signal detail must be equal. */ DETAIL, /** * The closure must be the same. */ CLOSURE, /** * The C closure callback must be the same. */ FUNC, /** * The closure data must be the same. */ DATA, /** * Only unblocked signals may be matched. */ UNBLOCKED, } /** * These flags used to be passed to g_type_init_with_debug_flags() which * is now deprecated. * * If you need to enable debugging features, use the GOBJECT_DEBUG * environment variable. * @bitfield */ enum TypeDebugFlags { /** * Print no messages */ NONE, /** * Print messages about object bookkeeping */ OBJECTS, /** * Print messages about signal emissions */ SIGNALS, /** * Keep a count of instances of each type */ INSTANCE_COUNT, /** * Mask covering all debug flags */ MASK, } /** * Bit masks used to check or determine characteristics of a type. * @bitfield */ enum TypeFlags { /** * No special flags. Since: 2.74 */ NONE, /** * Indicates an abstract type. No instances can be * created for an abstract type */ ABSTRACT, /** * Indicates an abstract value type, i.e. a type * that introduces a value table, but can't be used for * g_value_init() */ VALUE_ABSTRACT, /** * Indicates a final type. A final type is a non-derivable * leaf node in a deep derivable type hierarchy tree. Since: 2.70 */ FINAL, } /** * Bit masks used to check or determine specific characteristics of a * fundamental type. * @bitfield */ enum TypeFundamentalFlags { /** * Indicates a classed type */ CLASSED, /** * Indicates an instantiatable type (implies classed) */ INSTANTIATABLE, /** * Indicates a flat derivable type */ DERIVABLE, /** * Indicates a deep derivable type (implies derivable) */ DEEP_DERIVABLE, } /** * Mask containing the bits of #GParamSpec.flags which are reserved for GLib. */ const PARAM_MASK: number; /** * #GParamFlags value alias for %G_PARAM_STATIC_NAME | %G_PARAM_STATIC_NICK | %G_PARAM_STATIC_BLURB. * * It is recommended to use this for all properties by default, as it allows for * internal performance improvements in GObject. * * It is very rare that a property would have a dynamically constructed name, * nickname or blurb. * * Since 2.13.0 */ const PARAM_STATIC_STRINGS: number; /** * Minimum shift count to be used for user defined flags, to be stored in * #GParamSpec.flags. The maximum allowed is 10. */ const PARAM_USER_SHIFT: number; /** * A mask for all #GSignalFlags bits. */ const SIGNAL_FLAGS_MASK: number; /** * A mask for all #GSignalMatchType bits. */ const SIGNAL_MATCH_MASK: number; /** * A bit in the type number that's supposed to be left untouched. */ const TYPE_FLAG_RESERVED_ID_BIT: GLib.Type; /** * An integer constant that represents the number of identifiers reserved * for types that are assigned at compile-time. */ const TYPE_FUNDAMENTAL_MAX: number; /** * Shift value used in converting numbers to type IDs. */ const TYPE_FUNDAMENTAL_SHIFT: number; /** * First fundamental type number to create a new fundamental type id with * G_TYPE_MAKE_FUNDAMENTAL() reserved for BSE. */ const TYPE_RESERVED_BSE_FIRST: number; /** * Last fundamental type number reserved for BSE. */ const TYPE_RESERVED_BSE_LAST: number; /** * First fundamental type number to create a new fundamental type id with * G_TYPE_MAKE_FUNDAMENTAL() reserved for GLib. */ const TYPE_RESERVED_GLIB_FIRST: number; /** * Last fundamental type number reserved for GLib. */ const TYPE_RESERVED_GLIB_LAST: number; /** * First available fundamental type number to create new fundamental * type id with G_TYPE_MAKE_FUNDAMENTAL(). */ const TYPE_RESERVED_USER_FIRST: number; /** * For string values, indicates that the string contained is canonical and will * exist for the duration of the process. See g_value_set_interned_string(). */ const VALUE_INTERNED_STRING: number; /** * If passed to G_VALUE_COLLECT(), allocated data won't be copied * but used verbatim. This does not affect ref-counted types like * objects. This does not affect usage of g_value_copy(), the data will * be copied if it is not ref-counted. */ const VALUE_NOCOPY_CONTENTS: number; /** * Provide a copy of a boxed structure `src_boxed` which is of type `boxed_type`. * @param boxed_type The type of `src_boxed`. * @param src_boxed The boxed structure to be copied. * @returns The newly created copy of the boxed structure. */ function boxed_copy(boxed_type: GType, src_boxed: any): any; /** * Free the boxed structure `boxed` which is of type `boxed_type`. * @param boxed_type The type of `boxed`. * @param boxed The boxed structure to be freed. */ function boxed_free(boxed_type: GType, boxed: any): void; /** * A #GClosureMarshal function for use with signals with handlers that * take two boxed pointers as arguments and return a boolean. If you * have such a signal, you will probably also need to use an * accumulator, such as g_signal_accumulator_true_handled(). * @param closure A #GClosure. * @param return_value A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value. * @param n_param_values The length of the `param_values` array. * @param param_values An array of #GValues holding the arguments on which to invoke the callback of closure. * @param invocation_hint The invocation hint given as the last argument to g_closure_invoke(). * @param marshal_data Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal() */ function cclosure_marshal_BOOLEAN__BOXED_BOXED( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter * denotes a flags type. * @param closure the #GClosure to which the marshaller belongs * @param return_value a #GValue which can store the returned #gboolean * @param n_param_values 2 * @param param_values a #GValue array holding instance and arg1 * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_BOOLEAN__FLAGS( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value a #GValue, which can store the returned string * @param n_param_values 3 * @param param_values a #GValue array holding instance, arg1 and arg2 * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_STRING__OBJECT_POINTER( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #gboolean parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__BOOLEAN( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #GBoxed* parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__BOXED( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, gchar arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #gchar parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__CHAR( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #gdouble parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__DOUBLE( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter denotes an enumeration type.. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the enumeration parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__ENUM( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter denotes a flags type. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the flags parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__FLAGS( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #gfloat parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__FLOAT( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, gint arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #gint parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__INT( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, glong arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #glong parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__LONG( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, GObject *arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #GObject* parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__OBJECT( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #GParamSpec* parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__PARAM( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #gpointer parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__POINTER( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #gchar* parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__STRING( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, guchar arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #guchar parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__UCHAR( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, guint arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #guint parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__UINT( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 3 * @param param_values a #GValue array holding instance, arg1 and arg2 * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__UINT_POINTER( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, gulong arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #gulong parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__ULONG( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 2 * @param param_values a #GValue array holding the instance and the #GVariant* parameter * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__VARIANT( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A marshaller for a #GCClosure with a callback of type * `void (*callback) (gpointer instance, gpointer user_data)`. * @param closure the #GClosure to which the marshaller belongs * @param return_value ignored * @param n_param_values 1 * @param param_values a #GValue array holding only the instance * @param invocation_hint the invocation hint given as the last argument to g_closure_invoke() * @param marshal_data additional data specified when registering the marshaller */ function cclosure_marshal_VOID__VOID( closure: TClosure, return_value: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * A generic marshaller function implemented via * [libffi](http://sourceware.org/libffi/). * * Normally this function is not passed explicitly to g_signal_new(), * but used automatically by GLib when specifying a %NULL marshaller. * @param closure A #GClosure. * @param return_gvalue A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value. * @param n_param_values The length of the `param_values` array. * @param param_values An array of #GValues holding the arguments on which to invoke the callback of closure. * @param invocation_hint The invocation hint given as the last argument to g_closure_invoke(). * @param marshal_data Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal() */ function cclosure_marshal_generic( closure: TClosure, return_gvalue: any, n_param_values: number, param_values: any, invocation_hint: any | null, marshal_data: any | null ): void; /** * Disconnects a handler from `instance` so it will not be called during * any future or currently ongoing emissions of the signal it has been * connected to. The `handler_id_ptr` is then set to zero, which is never a valid handler ID value (see g_signal_connect()). * * If the handler ID is 0 then this function does nothing. * * There is also a macro version of this function so that the code * will be inlined. * @param handler_id_ptr A pointer to a handler ID (of type #gulong) of the handler to be disconnected. * @param instance The instance to remove the signal handler from. This pointer may be %NULL or invalid, if the handler ID is zero. */ function clear_signal_handler(handler_id_ptr: number, instance: Object): void; /** * This function is meant to be called from the `complete_type_info` * function of a #GTypePlugin implementation, as in the following * example: * * * ```c * static void * my_enum_complete_type_info (GTypePlugin *plugin, * GType g_type, * GTypeInfo *info, * GTypeValueTable *value_table) * { * static const GEnumValue values[] = { * { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" }, * { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" }, * { 0, NULL, NULL } * }; * * g_enum_complete_type_info (type, info, values); * } * ``` * * @param g_enum_type the type identifier of the type being completed * @param const_values An array of #GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0. */ function enum_complete_type_info( g_enum_type: GType, const_values: EnumValue ): /* info */ TypeInfo; /** * Returns the #GEnumValue for a value. * @param enum_class a #GEnumClass * @param value the value to look up * @returns the #GEnumValue for @value, or %NULL if @value is not a member of the enumeration */ function enum_get_value( enum_class: EnumClass, value: number ): EnumValue | null; /** * Looks up a #GEnumValue by name. * @param enum_class a #GEnumClass * @param name the name to look up * @returns the #GEnumValue with name @name, or %NULL if the enumeration doesn't have a member with that name */ function enum_get_value_by_name( enum_class: EnumClass, name: string | null ): EnumValue | null; /** * Looks up a #GEnumValue by nickname. * @param enum_class a #GEnumClass * @param nick the nickname to look up * @returns the #GEnumValue with nickname @nick, or %NULL if the enumeration doesn't have a member with that nickname */ function enum_get_value_by_nick( enum_class: EnumClass, nick: string | null ): EnumValue | null; /** * Registers a new static enumeration type with the name `name`. * * It is normally more convenient to let [glib-mkenums][glib-mkenums], * generate a my_enum_get_type() function from a usual C enumeration * definition than to write one yourself using g_enum_register_static(). * @param name A nul-terminated string used as the name of the new type. * @param const_static_values An array of #GEnumValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0. GObject keeps a reference to the data, so it cannot be stack-allocated. * @returns The new type identifier. */ function enum_register_static( name: string | null, const_static_values: EnumValue ): GType; /** * Pretty-prints `value` in the form of the enum’s name. * * This is intended to be used for debugging purposes. The format of the output * may change in the future. * @param g_enum_type the type identifier of a #GEnumClass type * @param value the value * @returns a newly-allocated text string */ function enum_to_string(g_enum_type: GType, value: number): string | null; /** * This function is meant to be called from the complete_type_info() * function of a #GTypePlugin implementation, see the example for * g_enum_complete_type_info() above. * @param g_flags_type the type identifier of the type being completed * @param const_values An array of #GFlagsValue structs for the possible enumeration values. The array is terminated by a struct with all members being 0. */ function flags_complete_type_info( g_flags_type: GType, const_values: FlagsValue ): /* info */ TypeInfo; /** * Returns the first #GFlagsValue which is set in `value`. * @param flags_class a #GFlagsClass * @param value the value * @returns the first #GFlagsValue which is set in @value, or %NULL if none is set */ function flags_get_first_value( flags_class: FlagsClass, value: number ): FlagsValue | null; /** * Looks up a #GFlagsValue by name. * @param flags_class a #GFlagsClass * @param name the name to look up * @returns the #GFlagsValue with name @name, or %NULL if there is no flag with that name */ function flags_get_value_by_name( flags_class: FlagsClass, name: string | null ): FlagsValue | null; /** * Looks up a #GFlagsValue by nickname. * @param flags_class a #GFlagsClass * @param nick the nickname to look up * @returns the #GFlagsValue with nickname @nick, or %NULL if there is no flag with that nickname */ function flags_get_value_by_nick( flags_class: FlagsClass, nick: string | null ): FlagsValue | null; /** * Registers a new static flags type with the name `name`. * * It is normally more convenient to let [glib-mkenums][glib-mkenums] * generate a my_flags_get_type() function from a usual C enumeration * definition than to write one yourself using g_flags_register_static(). * @param name A nul-terminated string used as the name of the new type. * @param const_static_values An array of #GFlagsValue structs for the possible flags values. The array is terminated by a struct with all members being 0. GObject keeps a reference to the data, so it cannot be stack-allocated. * @returns The new type identifier. */ function flags_register_static( name: string | null, const_static_values: FlagsValue ): GType; /** * Pretty-prints `value` in the form of the flag names separated by ` | ` and * sorted. Any extra bits will be shown at the end as a hexadecimal number. * * This is intended to be used for debugging purposes. The format of the output * may change in the future. * @param flags_type the type identifier of a #GFlagsClass type * @param value the value * @returns a newly-allocated text string */ function flags_to_string(flags_type: GType, value: number): string | null; function gtype_get_type(): GType; /** * Creates a new #GParamSpecBoolean instance specifying a %G_TYPE_BOOLEAN * property. In many cases, it may be more appropriate to use an enum with * g_param_spec_enum(), both to improve code clarity by using explicitly named * values, and to allow for more values to be added in future without breaking * API. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param default_value default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_boolean( name: string | null, nick: string | null, blurb: string | null, default_value: boolean, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_BOXED * derived property. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param boxed_type %G_TYPE_BOXED derived type of this property * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_boxed( name: string | null, nick: string | null, blurb: string | null, boxed_type: GType, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecChar instance specifying a %G_TYPE_CHAR property. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param minimum minimum value for the property specified * @param maximum maximum value for the property specified * @param default_value default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_char( name: string | null, nick: string | null, blurb: string | null, minimum: number, maximum: number, default_value: number, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecDouble instance specifying a %G_TYPE_DOUBLE * property. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param minimum minimum value for the property specified * @param maximum maximum value for the property specified * @param default_value default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_double( name: string | null, nick: string | null, blurb: string | null, minimum: number, maximum: number, default_value: number, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecEnum instance specifying a %G_TYPE_ENUM * property. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param enum_type a #GType derived from %G_TYPE_ENUM * @param default_value default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_enum( name: string | null, nick: string | null, blurb: string | null, enum_type: GType, default_value: number, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecFlags instance specifying a %G_TYPE_FLAGS * property. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param flags_type a #GType derived from %G_TYPE_FLAGS * @param default_value default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_flags( name: string | null, nick: string | null, blurb: string | null, flags_type: GType, default_value: number, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecFloat instance specifying a %G_TYPE_FLOAT property. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param minimum minimum value for the property specified * @param maximum maximum value for the property specified * @param default_value default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_float( name: string | null, nick: string | null, blurb: string | null, minimum: number, maximum: number, default_value: number, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecGType instance specifying a * %G_TYPE_GTYPE property. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param is_a_type a #GType whose subtypes are allowed as values of the property (use %G_TYPE_NONE for any type) * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_gtype( name: string | null, nick: string | null, blurb: string | null, is_a_type: GType, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecInt instance specifying a %G_TYPE_INT property. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param minimum minimum value for the property specified * @param maximum maximum value for the property specified * @param default_value default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_int( name: string | null, nick: string | null, blurb: string | null, minimum: number, maximum: number, default_value: number, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecInt64 instance specifying a %G_TYPE_INT64 property. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param minimum minimum value for the property specified * @param maximum maximum value for the property specified * @param default_value default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_int64( name: string | null, nick: string | null, blurb: string | null, minimum: number, maximum: number, default_value: number, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecLong instance specifying a %G_TYPE_LONG property. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param minimum minimum value for the property specified * @param maximum maximum value for the property specified * @param default_value default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_long( name: string | null, nick: string | null, blurb: string | null, minimum: number, maximum: number, default_value: number, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecBoxed instance specifying a %G_TYPE_OBJECT * derived property. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param object_type %G_TYPE_OBJECT derived type of this property * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_object( name: string | null, nick: string | null, blurb: string | null, object_type: GType, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecParam instance specifying a %G_TYPE_PARAM * property. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param param_type a #GType derived from %G_TYPE_PARAM * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_param( name: string | null, nick: string | null, blurb: string | null, param_type: GType, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecPointer instance specifying a pointer property. * Where possible, it is better to use g_param_spec_object() or * g_param_spec_boxed() to expose memory management information. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_pointer( name: string | null, nick: string | null, blurb: string | null, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecString instance. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param default_value default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_string( name: string | null, nick: string | null, blurb: string | null, default_value: string | null, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecUChar instance specifying a %G_TYPE_UCHAR property. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param minimum minimum value for the property specified * @param maximum maximum value for the property specified * @param default_value default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_uchar( name: string | null, nick: string | null, blurb: string | null, minimum: number, maximum: number, default_value: number, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecUInt instance specifying a %G_TYPE_UINT property. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param minimum minimum value for the property specified * @param maximum maximum value for the property specified * @param default_value default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_uint( name: string | null, nick: string | null, blurb: string | null, minimum: number, maximum: number, default_value: number, flags: ParamFlags ): ParamSpec; /** * Creates a new #GParamSpecUInt64 instance specifying a %G_TYPE_UINT64 * property. * * See g_param_spec_internal() for details on property names. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb descript