@girs/gobject-2.0 2.86.0-4.0.0-beta.37 → 2.86.0-4.0.0-beta.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/gobject-2.0.d.ts +102 -124
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gobject-2.0)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GObject-2.0, generated from library version 2.86.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.37.
8
+ GJS TypeScript type definitions for GObject-2.0, generated from library version 2.86.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.38.
9
9
 
10
10
  ## Install
11
11
 
package/gobject-2.0.d.ts CHANGED
@@ -449,29 +449,15 @@ export namespace GObject {
449
449
  */
450
450
  const VALUE_COLLECT_FORMAT_MAX_LENGTH: number;
451
451
  /**
452
- * Flag to indicate that a string in a [struct`GObject`.Value] is canonical and
453
- * will exist for the duration of the process.
454
- *
455
- * See [method`GObject`.Value.set_interned_string].
456
- *
457
- * This flag should be checked by implementations of
458
- * [callback`GObject`.TypeValueFreeFunc], [callback`GObject`.TypeValueCollectFunc]
459
- * and [callback`GObject`.TypeValueLCopyFunc].
452
+ * For string values, indicates that the string contained is canonical and will
453
+ * exist for the duration of the process. See g_value_set_interned_string().
460
454
  */
461
455
  const VALUE_INTERNED_STRING: number;
462
456
  /**
463
- * Flag to indicate that allocated data in a [struct`GObject`.Value] shouldn’t be
464
- * copied.
465
- *
466
- * If passed to [func`GObject`.VALUE_COLLECT], allocated data won’t be copied
467
- * but used verbatim. This does not affect ref-counted types like objects.
468
- *
469
- * This does not affect usage of [method`GObject`.Value.copy]: the data will
457
+ * If passed to G_VALUE_COLLECT(), allocated data won't be copied
458
+ * but used verbatim. This does not affect ref-counted types like
459
+ * objects. This does not affect usage of g_value_copy(), the data will
470
460
  * be copied if it is not ref-counted.
471
- *
472
- * This flag should be checked by implementations of
473
- * [callback`GObject`.TypeValueFreeFunc], [callback`GObject`.TypeValueCollectFunc]
474
- * and [callback`GObject`.TypeValueLCopyFunc].
475
461
  */
476
462
  const VALUE_NOCOPY_CONTENTS: number;
477
463
  /**
@@ -965,9 +951,9 @@ export namespace GObject {
965
951
  * ```
966
952
  *
967
953
  * @param g_enum_type the type identifier of the type being completed
968
- * @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.
954
+ * @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.
969
955
  */
970
- function enum_complete_type_info(g_enum_type: GType, const_values: EnumValue[]): TypeInfo;
956
+ function enum_complete_type_info(g_enum_type: GType, const_values: EnumValue): TypeInfo;
971
957
  /**
972
958
  * Returns the #GEnumValue for a value.
973
959
  * @param enum_class a #GEnumClass
@@ -1015,9 +1001,9 @@ export namespace GObject {
1015
1001
  * function of a #GTypePlugin implementation, see the example for
1016
1002
  * g_enum_complete_type_info() above.
1017
1003
  * @param g_flags_type the type identifier of the type being completed
1018
- * @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.
1004
+ * @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.
1019
1005
  */
1020
- function flags_complete_type_info(g_flags_type: GType, const_values: FlagsValue[]): TypeInfo;
1006
+ function flags_complete_type_info(g_flags_type: GType, const_values: FlagsValue): TypeInfo;
1021
1007
  /**
1022
1008
  * Returns the first #GFlagsValue which is set in `value`.
1023
1009
  * @param flags_class a #GFlagsClass
@@ -2158,6 +2144,15 @@ export namespace GObject {
2158
2144
  * @returns the #GTypeClass structure for the given type ID or %NULL if the class does not currently exist or is dynamically loaded
2159
2145
  */
2160
2146
  function type_class_peek_static(type: GType): TypeClass | null;
2147
+ /**
2148
+ * Increments the reference count of the class structure belonging to
2149
+ * `type`.
2150
+ *
2151
+ * This function will demand-create the class if it doesn't exist already.
2152
+ * @param type type ID of a classed type
2153
+ * @returns the #GTypeClass structure for the given type ID
2154
+ */
2155
+ function type_class_ref(type: GType): TypeClass;
2161
2156
  /**
2162
2157
  * Returns the default interface vtable for the given `g_type`.
2163
2158
  *
@@ -2183,6 +2178,21 @@ export namespace GObject {
2183
2178
  * @returns the default vtable for the interface, or %NULL if the type is not currently in use
2184
2179
  */
2185
2180
  function type_default_interface_peek(g_type: GType): TypeInterface;
2181
+ /**
2182
+ * Increments the reference count for the interface type `g_type,`
2183
+ * and returns the default interface vtable for the type.
2184
+ *
2185
+ * If the type is not currently in use, then the default vtable
2186
+ * for the type will be created and initialized by calling
2187
+ * the base interface init and default vtable init functions for
2188
+ * the type (the `base_init` and `class_init` members of #GTypeInfo).
2189
+ * Calling g_type_default_interface_ref() is useful when you
2190
+ * want to make sure that signals and properties for an interface
2191
+ * have been installed.
2192
+ * @param g_type an interface type
2193
+ * @returns the default vtable for the interface; call g_type_default_interface_unref() when you are done using the interface.
2194
+ */
2195
+ function type_default_interface_ref(g_type: GType): TypeInterface;
2186
2196
  /**
2187
2197
  * Decrements the reference count for the type corresponding to the
2188
2198
  * interface default vtable `g_iface`.
@@ -2482,23 +2492,21 @@ export namespace GObject {
2482
2492
  function type_set_qdata(type: GType, quark: GLib.Quark, data?: any | null): void;
2483
2493
  function type_test_flags(type: GType, flags: number): boolean;
2484
2494
  /**
2485
- * Checks whether a [method`GObject`.Value.copy] is able to copy values of type
2486
- * `src_type` into values of type `dest_type`.
2487
- * @param src_type source type to be copied
2488
- * @param dest_type destination type for copying
2489
- * @returns true if the copy is possible; false otherwise
2495
+ * Returns whether a #GValue of type `src_type` can be copied into
2496
+ * a #GValue of type `dest_type`.
2497
+ * @param src_type source type to be copied.
2498
+ * @param dest_type destination type for copying.
2499
+ * @returns %TRUE if g_value_copy() is possible with @src_type and @dest_type.
2490
2500
  */
2491
2501
  function value_type_compatible(src_type: GType, dest_type: GType): boolean;
2492
2502
  /**
2493
- * Checks whether [method`GObject`.Value.transform] is able to transform values
2494
- * of type `src_type` into values of type `dest_type`.
2495
- *
2496
- * Note that for the types to be transformable, they must be compatible or a
2497
- * transformation function must be registered using
2498
- * [func`GObject`.Value.register_transform_func].
2499
- * @param src_type source type
2500
- * @param dest_type target type
2501
- * @returns true if the transformation is possible; false otherwise
2503
+ * Check whether g_value_transform() is able to transform values
2504
+ * of type `src_type` into values of type `dest_type`. Note that for
2505
+ * the types to be transformable, they must be compatible or a
2506
+ * transformation function must be registered.
2507
+ * @param src_type Source type.
2508
+ * @param dest_type Target type.
2509
+ * @returns %TRUE if the transformation is possible, %FALSE otherwise.
2502
2510
  */
2503
2511
  function value_type_transformable(src_type: GType, dest_type: GType): boolean;
2504
2512
  function variant_get_gtype(): GType;
@@ -4852,10 +4860,10 @@ export namespace GObject {
4852
4860
  * Since 2.56 if `module` is %NULL this will call g_type_register_static()
4853
4861
  * instead. This can be used when making a static build of the module.
4854
4862
  * @param name name for the type
4855
- * @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.
4863
+ * @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.
4856
4864
  * @returns the new or existing type ID
4857
4865
  */
4858
- register_enum(name: string, const_static_values: EnumValue[]): GType;
4866
+ register_enum(name: string, const_static_values: EnumValue): GType;
4859
4867
  /**
4860
4868
  * Looks up or registers a flags type that is implemented with a particular
4861
4869
  * type plugin. If a type with name `type_name` was previously registered,
@@ -4868,10 +4876,10 @@ export namespace GObject {
4868
4876
  * Since 2.56 if `module` is %NULL this will call g_type_register_static()
4869
4877
  * instead. This can be used when making a static build of the module.
4870
4878
  * @param name name for the type
4871
- * @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.
4879
+ * @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.
4872
4880
  * @returns the new or existing type ID
4873
4881
  */
4874
- register_flags(name: string, const_static_values: FlagsValue[]): GType;
4882
+ register_flags(name: string, const_static_values: FlagsValue): GType;
4875
4883
  /**
4876
4884
  * Looks up or registers a type that is implemented with a particular
4877
4885
  * type plugin. If a type with name `type_name` was previously registered,
@@ -6135,6 +6143,14 @@ export namespace GObject {
6135
6143
  * @param type type ID of a classed type
6136
6144
  */
6137
6145
  static peek_static(type: GType): TypeClass | null;
6146
+ /**
6147
+ * Increments the reference count of the class structure belonging to
6148
+ * `type`.
6149
+ *
6150
+ * This function will demand-create the class if it doesn't exist already.
6151
+ * @param type type ID of a classed type
6152
+ */
6153
+ static ref(type: GType): TypeClass;
6138
6154
 
6139
6155
  // Methods
6140
6156
 
@@ -6435,23 +6451,14 @@ export namespace GObject {
6435
6451
  /**
6436
6452
  * An opaque structure used to hold different types of values.
6437
6453
  *
6438
- * Before it can be used, a `GValue` has to be initialized to a specific type by
6439
- * calling [method`GObject`.Value.init] on it.
6440
- *
6441
- * Many types which are stored within a `GValue` need to allocate data on the
6442
- * heap, so [method`GObject`.Value.unset] must always be called on a `GValue` to
6443
- * free any such data once you’re finished with the `GValue`, even if the
6444
- * `GValue` itself is stored on the stack.
6445
- *
6446
6454
  * The data within the structure has protected scope: it is accessible only
6447
- * to functions within a [struct`GObject`.TypeValueTable] structure, or
6448
- * implementations of the `g_value_*()` API. That is, code which implements new
6449
- * fundamental types.
6455
+ * to functions within a #GTypeValueTable structure, or implementations of
6456
+ * the g_value_*() API. That is, code portions which implement new fundamental
6457
+ * types.
6450
6458
  *
6451
- * `GValue` users cannot make any assumptions about how data is stored
6459
+ * #GValue users cannot make any assumptions about how data is stored
6452
6460
  * within the 2 element `data` union, and the `g_type` member should
6453
- * only be accessed through the [func`GObject`.VALUE_TYPE] macro and related
6454
- * macros.
6461
+ * only be accessed through the G_VALUE_TYPE() macro.
6455
6462
  */
6456
6463
  class Value {
6457
6464
  static $gtype: GType<Value>;
@@ -6463,21 +6470,19 @@ export namespace GObject {
6463
6470
  // Static methods
6464
6471
 
6465
6472
  /**
6466
- * Checks whether a [method`GObject`.Value.copy] is able to copy values of type
6467
- * `src_type` into values of type `dest_type`.
6468
- * @param src_type source type to be copied
6469
- * @param dest_type destination type for copying
6473
+ * Returns whether a #GValue of type `src_type` can be copied into
6474
+ * a #GValue of type `dest_type`.
6475
+ * @param src_type source type to be copied.
6476
+ * @param dest_type destination type for copying.
6470
6477
  */
6471
6478
  static type_compatible(src_type: GType, dest_type: GType): boolean;
6472
6479
  /**
6473
- * Checks whether [method`GObject`.Value.transform] is able to transform values
6474
- * of type `src_type` into values of type `dest_type`.
6475
- *
6476
- * Note that for the types to be transformable, they must be compatible or a
6477
- * transformation function must be registered using
6478
- * [func`GObject`.Value.register_transform_func].
6479
- * @param src_type source type
6480
- * @param dest_type target type
6480
+ * Check whether g_value_transform() is able to transform values
6481
+ * of type `src_type` into values of type `dest_type`. Note that for
6482
+ * the types to be transformable, they must be compatible or a
6483
+ * transformation function must be registered.
6484
+ * @param src_type Source type.
6485
+ * @param dest_type Target type.
6481
6486
  */
6482
6487
  static type_transformable(src_type: GType, dest_type: GType): boolean;
6483
6488
 
@@ -6485,7 +6490,7 @@ export namespace GObject {
6485
6490
 
6486
6491
  /**
6487
6492
  * Copies the value of `src_value` into `dest_value`.
6488
- * @param dest_value an initialized [struct@GObject.Value] structure of the same type as @src_value
6493
+ * @param dest_value An initialized #GValue structure of the same type as @src_value.
6489
6494
  */
6490
6495
  copy(dest_value: Value | any): void;
6491
6496
  /**
@@ -6508,9 +6513,8 @@ export namespace GObject {
6508
6513
  dup_variant(): GLib.Variant | null;
6509
6514
  /**
6510
6515
  * Determines if `value` will fit inside the size of a pointer value.
6511
- *
6512
6516
  * This is an internal function introduced mainly for C marshallers.
6513
- * @returns true if @value will fit inside a pointer value; false otherwise
6517
+ * @returns %TRUE if @value will fit inside a pointer value.
6514
6518
  */
6515
6519
  fits_pointer(): boolean;
6516
6520
  /**
@@ -6622,51 +6626,33 @@ export namespace GObject {
6622
6626
  */
6623
6627
  get_variant(): GLib.Variant | null;
6624
6628
  /**
6625
- * Initializes `value` to store values of the given `type,` and sets its value
6626
- * to the default for `type`.
6627
- *
6628
- * This must be called before any other methods on a [struct`GObject`.Value], so
6629
- * the value knows what type it’s meant to store.
6630
- *
6631
- * ```c
6632
- * GValue value = G_VALUE_INIT;
6633
- *
6634
- * g_value_init (&value, SOME_G_TYPE);
6635
- * …
6636
- * g_value_unset (&value);
6637
- * ```
6638
- * @param g_type type the [struct@GObject.Value] should hold values of
6639
- * @returns the [struct@GObject.Value] structure that has been passed in
6629
+ * Initializes `value` with the default value of `type`.
6630
+ * @param g_type Type the #GValue should hold values of.
6631
+ * @returns the #GValue structure that has been passed in
6640
6632
  */
6641
6633
  init(g_type: GType): unknown;
6642
6634
  /**
6643
- * Initializes and sets `value` from an instantiatable type.
6644
- *
6645
- * This calls the [callback`GObject`.TypeValueCollectFunc] function for the type
6646
- * the [struct`GObject`.Value] contains.
6635
+ * Initializes and sets `value` from an instantiatable type via the
6636
+ * value_table's collect_value() function.
6647
6637
  *
6648
6638
  * Note: The `value` will be initialised with the exact type of
6649
- * `instance`. If you wish to set the `value’`s type to a different
6650
- * [type`GObject`.Type] (such as a parent class type), you need to manually call
6651
- * [method`GObject`.Value.init] and [method`GObject`.Value.set_instance].
6639
+ * `instance`. If you wish to set the `value'`s type to a different GType
6640
+ * (such as a parent class GType), you need to manually call
6641
+ * g_value_init() and g_value_set_instance().
6652
6642
  * @param instance the instance
6653
6643
  */
6654
6644
  init_from_instance(instance: TypeInstance): void;
6655
6645
  /**
6656
- * Returns the value contents as a pointer.
6657
- *
6658
- * This function asserts that [method`GObject`.Value.fits_pointer] returned true
6659
- * for the passed in value.
6660
- *
6646
+ * Returns the value contents as pointer. This function asserts that
6647
+ * g_value_fits_pointer() returned %TRUE for the passed in value.
6661
6648
  * This is an internal function introduced mainly for C marshallers.
6662
- * @returns the value contents as a pointer
6649
+ * @returns the value contents as pointer
6663
6650
  */
6664
6651
  peek_pointer(): any | null;
6665
6652
  /**
6666
6653
  * Clears the current value in `value` and resets it to the default value
6667
- * (as if the value had just been initialized using
6668
- * [method`GObject`.Value.init]).
6669
- * @returns the [struct@GObject.Value] structure that has been passed in
6654
+ * (as if the value had just been initialized).
6655
+ * @returns the #GValue structure that has been passed in
6670
6656
  */
6671
6657
  reset(): unknown;
6672
6658
  /**
@@ -6676,7 +6662,7 @@ export namespace GObject {
6676
6662
  set_boolean(v_boolean: boolean): void;
6677
6663
  /**
6678
6664
  * Set the contents of a %G_TYPE_BOXED derived #GValue to `v_boxed`.
6679
- * @param v_boxed caller-owned boxed object to be duplicated for the #GValue
6665
+ * @param v_boxed boxed value to be set
6680
6666
  */
6681
6667
  set_boxed(v_boxed?: any | null): void;
6682
6668
  /**
@@ -6715,10 +6701,8 @@ export namespace GObject {
6715
6701
  */
6716
6702
  set_gtype(v_gtype: GType): void;
6717
6703
  /**
6718
- * Sets `value` from an instantiatable type.
6719
- *
6720
- * This calls the [callback`GObject`.TypeValueCollectFunc] function for the type
6721
- * the [struct`GObject`.Value] contains.
6704
+ * Sets `value` from an instantiatable type via the
6705
+ * value_table's collect_value() function.
6722
6706
  * @param instance the instance
6723
6707
  */
6724
6708
  set_instance(instance?: any | null): void;
@@ -6871,27 +6855,21 @@ export namespace GObject {
6871
6855
  take_variant(variant?: GLib.Variant | null): void;
6872
6856
  /**
6873
6857
  * Tries to cast the contents of `src_value` into a type appropriate
6874
- * to store in `dest_value`.
6875
- *
6876
- * If a transformation is not possible, `dest_value` is not modified.
6877
- *
6878
- * For example, this could transform a `G_TYPE_INT` value into a `G_TYPE_FLOAT`
6879
- * value.
6880
- *
6881
- * Performing transformations between value types might incur precision loss.
6882
- * Especially transformations into strings might reveal seemingly arbitrary
6883
- * results and the format of particular transformations to strings is not
6884
- * guaranteed over time.
6885
- * @param dest_value target value
6886
- * @returns true on success; false otherwise
6858
+ * to store in `dest_value,` e.g. to transform a %G_TYPE_INT value
6859
+ * into a %G_TYPE_FLOAT value. Performing transformations between
6860
+ * value types might incur precision lossage. Especially
6861
+ * transformations into strings might reveal seemingly arbitrary
6862
+ * results and shouldn't be relied upon for production code (such
6863
+ * as rcfile value or object property serialization).
6864
+ * @param dest_value Target value.
6865
+ * @returns Whether a transformation rule was found and could be applied. Upon failing transformations, @dest_value is left untouched.
6887
6866
  */
6888
6867
  transform(dest_value: Value | any): boolean;
6889
6868
  /**
6890
- * Clears the current value in `value` (if any) and unsets the type.
6891
- *
6892
- * This releases all resources associated with this [struct`GObject`.Value]. An
6893
- * unset value is the same as a cleared (zero-filled)
6894
- * [struct`GObject`.Value] structure set to `G_VALUE_INIT`.
6869
+ * Clears the current value in `value` (if any) and "unsets" the type,
6870
+ * this releases all resources associated with this GValue. An unset
6871
+ * value is the same as an uninitialized (zero-filled) #GValue
6872
+ * structure.
6895
6873
  */
6896
6874
  unset(): void;
6897
6875
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gobject-2.0",
3
- "version": "2.86.0-4.0.0-beta.37",
3
+ "version": "2.86.0-4.0.0-beta.38",
4
4
  "description": "GJS TypeScript type definitions for GObject-2.0, generated from library version 2.86.0",
5
5
  "type": "module",
6
6
  "module": "gobject-2.0.js",
@@ -31,8 +31,8 @@
31
31
  "test": "tsc --project tsconfig.json"
32
32
  },
33
33
  "dependencies": {
34
- "@girs/gjs": "4.0.0-beta.37",
35
- "@girs/glib-2.0": "2.86.0-4.0.0-beta.37" },
34
+ "@girs/gjs": "4.0.0-beta.38",
35
+ "@girs/glib-2.0": "2.86.0-4.0.0-beta.38" },
36
36
  "devDependencies": {
37
37
  "typescript": "*"
38
38
  },