@girs/gcalc-2 4.2.0 → 4.4.0

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.
package/README.md CHANGED
@@ -5,25 +5,25 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gcalc-2)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GCalc-2 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.2.0.
8
+ GJS TypeScript type definitions for GCalc-2 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.4.0.
9
9
 
10
10
  ## Install
11
11
 
12
- To use this type definitions, install them with NPM:
12
+ Install the type definitions with npm:
13
13
  ```bash
14
14
  npm install @girs/gcalc-2
15
15
  ```
16
16
 
17
17
  ## Usage
18
18
 
19
- You can import this package into your project like this:
19
+ Import it like any other module:
20
20
  ```ts
21
21
  import GCalc from '@girs/gcalc-2';
22
22
  ```
23
23
 
24
24
  ### Ambient Modules
25
25
 
26
- You can also use [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) to import this module like you would do this in JavaScript.
26
+ [Ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) let you write the same import you would in plain JavaScript.
27
27
  For this you need to include `@girs/gcalc-2` or `@girs/gcalc-2/ambient` in your `tsconfig` or entry point Typescript file:
28
28
 
29
29
  `index.ts`:
@@ -42,7 +42,7 @@ import '@girs/gcalc-2'
42
42
  }
43
43
  ```
44
44
 
45
- Now you can import the ambient module with TypeScript support:
45
+ The ambient module now resolves with types:
46
46
 
47
47
  ```ts
48
48
  import GCalc from 'gi://GCalc?version=2';
@@ -50,7 +50,7 @@ import GCalc from 'gi://GCalc?version=2';
50
50
 
51
51
  ### Global import
52
52
 
53
- You can also import the module with Typescript support using the global `imports.gi` object of GJS.
53
+ GJS's global `imports.gi` works too, with types.
54
54
  For this you need to include `@girs/gcalc-2` or `@girs/gcalc-2/import` in your `tsconfig` or entry point Typescript file:
55
55
 
56
56
  `index.ts`:
@@ -69,7 +69,7 @@ import '@girs/gcalc-2'
69
69
  }
70
70
  ```
71
71
 
72
- Now you have also type support for this, too:
72
+ That form carries types as well:
73
73
 
74
74
  ```ts
75
75
  const GCalc = imports.gi.GCalc;
@@ -77,7 +77,7 @@ const GCalc = imports.gi.GCalc;
77
77
 
78
78
  ### Bundle
79
79
 
80
- Depending on your project configuration, it is recommended to use a bundler like [esbuild](https://esbuild.github.io/). You can find examples using different bundlers [here](https://github.com/gjsify/ts-for-gir/tree/main/examples).
80
+ Most projects want a bundler. [esbuild](https://esbuild.github.io/) is the smallest thing that works; the [examples directory](https://github.com/gjsify/ts-for-gir/tree/main/examples) has setups for several others.
81
81
 
82
82
  ## Other packages
83
83
 
package/gcalc-2.d.ts CHANGED
@@ -1107,6 +1107,7 @@ export namespace GCalc {
1107
1107
  * The item type of a {@link Gio.ListModel} can not change during the life of the
1108
1108
  * model.
1109
1109
  * @returns the {@link GObject.GType} of the items contained in `list`.
1110
+ * @since 2.44
1110
1111
  */
1111
1112
  get_item_type(): GObject.GType;
1112
1113
 
@@ -1117,6 +1118,7 @@ export namespace GCalc {
1117
1118
  * less efficient than iterating the list with increasing values for
1118
1119
  * `position` until `g_list_model_get_item()` returns `null`.
1119
1120
  * @returns the number of items in `list`.
1121
+ * @since 2.44
1120
1122
  */
1121
1123
  get_n_items(): number;
1122
1124
 
@@ -1135,6 +1137,7 @@ export namespace GCalc {
1135
1137
  * See also: `g_list_model_get_n_items()`
1136
1138
  * @param position the position of the item to fetch
1137
1139
  * @returns the object at `position`.
1140
+ * @since 2.44
1138
1141
  */
1139
1142
  get_item(position: number): A | null;
1140
1143
 
@@ -1162,6 +1165,7 @@ export namespace GCalc {
1162
1165
  * @param position the position at which `list` changed
1163
1166
  * @param removed the number of items removed
1164
1167
  * @param added the number of items added
1168
+ * @since 2.44
1165
1169
  */
1166
1170
  items_changed(position: number, removed: number, added: number): void;
1167
1171
 
@@ -1174,6 +1178,7 @@ export namespace GCalc {
1174
1178
  *
1175
1179
  * The same {@link GObject.Object} instance may not appear more than once in a {@link Gio.ListModel}.
1176
1180
  * @param position the position of the item to fetch
1181
+ * @since 2.44
1177
1182
  * @virtual
1178
1183
  */
1179
1184
  vfunc_get_item(position: number): A | null;
@@ -1187,6 +1192,7 @@ export namespace GCalc {
1187
1192
  *
1188
1193
  * The item type of a {@link Gio.ListModel} can not change during the life of the
1189
1194
  * model.
1195
+ * @since 2.44
1190
1196
  * @virtual
1191
1197
  */
1192
1198
  vfunc_get_item_type(): GObject.GType;
@@ -1197,6 +1203,7 @@ export namespace GCalc {
1197
1203
  * Depending on the model implementation, calling this function may be
1198
1204
  * less efficient than iterating the list with increasing values for
1199
1205
  * `position` until `g_list_model_get_item()` returns `null`.
1206
+ * @since 2.44
1200
1207
  * @virtual
1201
1208
  */
1202
1209
  vfunc_get_n_items(): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gcalc-2",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "description": "GJS TypeScript type definitions for GCalc-2",
5
5
  "type": "module",
6
6
  "module": "gcalc-2.js",
@@ -31,12 +31,12 @@
31
31
  "test": "tsc --project tsconfig.json"
32
32
  },
33
33
  "dependencies": {
34
- "@girs/gjs": "^4.2.0",
35
- "@girs/gio-2.0": "^4.2.0",
36
- "@girs/gobject-2.0": "^4.2.0",
37
- "@girs/glib-2.0": "^4.2.0",
38
- "@girs/gmodule-2.0": "^4.2.0",
39
- "@girs/gee-0.8": "^4.2.0" },
34
+ "@girs/gjs": "^4.4.0",
35
+ "@girs/gio-2.0": "^4.4.0",
36
+ "@girs/gobject-2.0": "^4.4.0",
37
+ "@girs/glib-2.0": "^4.4.0",
38
+ "@girs/gmodule-2.0": "^4.4.0",
39
+ "@girs/gee-0.8": "^4.4.0" },
40
40
  "devDependencies": {
41
41
  "typescript": "*"
42
42
  },