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

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 +124 -102
  3. package/package.json +5 -5
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.84.4 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.36.
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.
9
9
 
10
10
  ## Install
11
11
 
package/gobject-2.0.d.ts CHANGED
@@ -449,15 +449,29 @@ export namespace GObject {
449
449
  */
450
450
  const VALUE_COLLECT_FORMAT_MAX_LENGTH: number;
451
451
  /**
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().
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].
454
460
  */
455
461
  const VALUE_INTERNED_STRING: number;
456
462
  /**
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
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
460
470
  * 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].
461
475
  */
462
476
  const VALUE_NOCOPY_CONTENTS: number;
463
477
  /**
@@ -951,9 +965,9 @@ export namespace GObject {
951
965
  * ```
952
966
  *
953
967
  * @param g_enum_type the type identifier of the type being completed
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.
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.
955
969
  */
956
- function enum_complete_type_info(g_enum_type: GType, const_values: EnumValue): TypeInfo;
970
+ function enum_complete_type_info(g_enum_type: GType, const_values: EnumValue[]): TypeInfo;
957
971
  /**
958
972
  * Returns the #GEnumValue for a value.
959
973
  * @param enum_class a #GEnumClass
@@ -1001,9 +1015,9 @@ export namespace GObject {
1001
1015
  * function of a #GTypePlugin implementation, see the example for
1002
1016
  * g_enum_complete_type_info() above.
1003
1017
  * @param g_flags_type the type identifier of the type being completed
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.
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.
1005
1019
  */
1006
- function flags_complete_type_info(g_flags_type: GType, const_values: FlagsValue): TypeInfo;
1020
+ function flags_complete_type_info(g_flags_type: GType, const_values: FlagsValue[]): TypeInfo;
1007
1021
  /**
1008
1022
  * Returns the first #GFlagsValue which is set in `value`.
1009
1023
  * @param flags_class a #GFlagsClass
@@ -2144,15 +2158,6 @@ export namespace GObject {
2144
2158
  * @returns the #GTypeClass structure for the given type ID or %NULL if the class does not currently exist or is dynamically loaded
2145
2159
  */
2146
2160
  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;
2156
2161
  /**
2157
2162
  * Returns the default interface vtable for the given `g_type`.
2158
2163
  *
@@ -2178,21 +2183,6 @@ export namespace GObject {
2178
2183
  * @returns the default vtable for the interface, or %NULL if the type is not currently in use
2179
2184
  */
2180
2185
  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;
2196
2186
  /**
2197
2187
  * Decrements the reference count for the type corresponding to the
2198
2188
  * interface default vtable `g_iface`.
@@ -2492,21 +2482,23 @@ export namespace GObject {
2492
2482
  function type_set_qdata(type: GType, quark: GLib.Quark, data?: any | null): void;
2493
2483
  function type_test_flags(type: GType, flags: number): boolean;
2494
2484
  /**
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.
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
2500
2490
  */
2501
2491
  function value_type_compatible(src_type: GType, dest_type: GType): boolean;
2502
2492
  /**
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.
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
2510
2502
  */
2511
2503
  function value_type_transformable(src_type: GType, dest_type: GType): boolean;
2512
2504
  function variant_get_gtype(): GType;
@@ -4860,10 +4852,10 @@ export namespace GObject {
4860
4852
  * Since 2.56 if `module` is %NULL this will call g_type_register_static()
4861
4853
  * instead. This can be used when making a static build of the module.
4862
4854
  * @param name name for the type
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.
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.
4864
4856
  * @returns the new or existing type ID
4865
4857
  */
4866
- register_enum(name: string, const_static_values: EnumValue): GType;
4858
+ register_enum(name: string, const_static_values: EnumValue[]): GType;
4867
4859
  /**
4868
4860
  * Looks up or registers a flags type that is implemented with a particular
4869
4861
  * type plugin. If a type with name `type_name` was previously registered,
@@ -4876,10 +4868,10 @@ export namespace GObject {
4876
4868
  * Since 2.56 if `module` is %NULL this will call g_type_register_static()
4877
4869
  * instead. This can be used when making a static build of the module.
4878
4870
  * @param name name for the type
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.
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.
4880
4872
  * @returns the new or existing type ID
4881
4873
  */
4882
- register_flags(name: string, const_static_values: FlagsValue): GType;
4874
+ register_flags(name: string, const_static_values: FlagsValue[]): GType;
4883
4875
  /**
4884
4876
  * Looks up or registers a type that is implemented with a particular
4885
4877
  * type plugin. If a type with name `type_name` was previously registered,
@@ -6143,14 +6135,6 @@ export namespace GObject {
6143
6135
  * @param type type ID of a classed type
6144
6136
  */
6145
6137
  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;
6154
6138
 
6155
6139
  // Methods
6156
6140
 
@@ -6451,14 +6435,23 @@ export namespace GObject {
6451
6435
  /**
6452
6436
  * An opaque structure used to hold different types of values.
6453
6437
  *
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
+ *
6454
6446
  * The data within the structure has protected scope: it is accessible only
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.
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.
6458
6450
  *
6459
- * #GValue users cannot make any assumptions about how data is stored
6451
+ * `GValue` users cannot make any assumptions about how data is stored
6460
6452
  * within the 2 element `data` union, and the `g_type` member should
6461
- * only be accessed through the G_VALUE_TYPE() macro.
6453
+ * only be accessed through the [func`GObject`.VALUE_TYPE] macro and related
6454
+ * macros.
6462
6455
  */
6463
6456
  class Value {
6464
6457
  static $gtype: GType<Value>;
@@ -6470,19 +6463,21 @@ export namespace GObject {
6470
6463
  // Static methods
6471
6464
 
6472
6465
  /**
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.
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
6477
6470
  */
6478
6471
  static type_compatible(src_type: GType, dest_type: GType): boolean;
6479
6472
  /**
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.
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
6486
6481
  */
6487
6482
  static type_transformable(src_type: GType, dest_type: GType): boolean;
6488
6483
 
@@ -6490,7 +6485,7 @@ export namespace GObject {
6490
6485
 
6491
6486
  /**
6492
6487
  * Copies the value of `src_value` into `dest_value`.
6493
- * @param dest_value An initialized #GValue structure of the same type as @src_value.
6488
+ * @param dest_value an initialized [struct@GObject.Value] structure of the same type as @src_value
6494
6489
  */
6495
6490
  copy(dest_value: Value | any): void;
6496
6491
  /**
@@ -6513,8 +6508,9 @@ export namespace GObject {
6513
6508
  dup_variant(): GLib.Variant | null;
6514
6509
  /**
6515
6510
  * Determines if `value` will fit inside the size of a pointer value.
6511
+ *
6516
6512
  * This is an internal function introduced mainly for C marshallers.
6517
- * @returns %TRUE if @value will fit inside a pointer value.
6513
+ * @returns true if @value will fit inside a pointer value; false otherwise
6518
6514
  */
6519
6515
  fits_pointer(): boolean;
6520
6516
  /**
@@ -6626,33 +6622,51 @@ export namespace GObject {
6626
6622
  */
6627
6623
  get_variant(): GLib.Variant | null;
6628
6624
  /**
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
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
6632
6640
  */
6633
6641
  init(g_type: GType): unknown;
6634
6642
  /**
6635
- * Initializes and sets `value` from an instantiatable type via the
6636
- * value_table's collect_value() function.
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.
6637
6647
  *
6638
6648
  * Note: The `value` will be initialised with the exact type of
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().
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].
6642
6652
  * @param instance the instance
6643
6653
  */
6644
6654
  init_from_instance(instance: TypeInstance): void;
6645
6655
  /**
6646
- * Returns the value contents as pointer. This function asserts that
6647
- * g_value_fits_pointer() returned %TRUE for the passed in value.
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
+ *
6648
6661
  * This is an internal function introduced mainly for C marshallers.
6649
- * @returns the value contents as pointer
6662
+ * @returns the value contents as a pointer
6650
6663
  */
6651
6664
  peek_pointer(): any | null;
6652
6665
  /**
6653
6666
  * Clears the current value in `value` and resets it to the default value
6654
- * (as if the value had just been initialized).
6655
- * @returns the #GValue structure that has been passed in
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
6656
6670
  */
6657
6671
  reset(): unknown;
6658
6672
  /**
@@ -6662,7 +6676,7 @@ export namespace GObject {
6662
6676
  set_boolean(v_boolean: boolean): void;
6663
6677
  /**
6664
6678
  * Set the contents of a %G_TYPE_BOXED derived #GValue to `v_boxed`.
6665
- * @param v_boxed boxed value to be set
6679
+ * @param v_boxed caller-owned boxed object to be duplicated for the #GValue
6666
6680
  */
6667
6681
  set_boxed(v_boxed?: any | null): void;
6668
6682
  /**
@@ -6701,8 +6715,10 @@ export namespace GObject {
6701
6715
  */
6702
6716
  set_gtype(v_gtype: GType): void;
6703
6717
  /**
6704
- * Sets `value` from an instantiatable type via the
6705
- * value_table's collect_value() function.
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.
6706
6722
  * @param instance the instance
6707
6723
  */
6708
6724
  set_instance(instance?: any | null): void;
@@ -6855,21 +6871,27 @@ export namespace GObject {
6855
6871
  take_variant(variant?: GLib.Variant | null): void;
6856
6872
  /**
6857
6873
  * Tries to cast the contents of `src_value` into a type appropriate
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.
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
6866
6887
  */
6867
6888
  transform(dest_value: Value | any): boolean;
6868
6889
  /**
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.
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`.
6873
6895
  */
6874
6896
  unset(): void;
6875
6897
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@girs/gobject-2.0",
3
- "version": "2.84.4-4.0.0-beta.36",
4
- "description": "GJS TypeScript type definitions for GObject-2.0, generated from library version 2.84.4",
3
+ "version": "2.86.0-4.0.0-beta.37",
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",
7
7
  "main": "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.36",
35
- "@girs/glib-2.0": "2.84.4-4.0.0-beta.36" },
34
+ "@girs/gjs": "4.0.0-beta.37",
35
+ "@girs/glib-2.0": "2.86.0-4.0.0-beta.37" },
36
36
  "devDependencies": {
37
37
  "typescript": "*"
38
38
  },
@@ -41,7 +41,7 @@
41
41
  "license": "MIT",
42
42
  "repository": {
43
43
  "type": "git",
44
- "url": "https://github.com/gjsify/types.git"
44
+ "url": "git+https://github.com/gjsify/types.git"
45
45
  },
46
46
  "bugs": {
47
47
  "url": "https://github.com/gjsify/ts-for-gir/issues"