@girs/gcalc-1 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-1)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GCalc-1 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.2.0.
8
+ GJS TypeScript type definitions for GCalc-1 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-1
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-1';
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-1` or `@girs/gcalc-1/ambient` in your `tsconfig` or entry point Typescript file:
28
28
 
29
29
  `index.ts`:
@@ -42,7 +42,7 @@ import '@girs/gcalc-1'
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=1';
@@ -50,7 +50,7 @@ import GCalc from 'gi://GCalc?version=1';
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-1` or `@girs/gcalc-1/import` in your `tsconfig` or entry point Typescript file:
55
55
 
56
56
  `index.ts`:
@@ -69,7 +69,7 @@ import '@girs/gcalc-1'
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-1.d.ts CHANGED
@@ -329,6 +329,7 @@ export namespace GCalc {
329
329
  * The item type of a {@link Gio.ListModel} can not change during the life of the
330
330
  * model.
331
331
  * @returns the {@link GObject.GType} of the items contained in `list`.
332
+ * @since 2.44
332
333
  */
333
334
  get_item_type(): GObject.GType;
334
335
 
@@ -339,6 +340,7 @@ export namespace GCalc {
339
340
  * less efficient than iterating the list with increasing values for
340
341
  * `position` until `g_list_model_get_item()` returns `null`.
341
342
  * @returns the number of items in `list`.
343
+ * @since 2.44
342
344
  */
343
345
  get_n_items(): number;
344
346
 
@@ -357,6 +359,7 @@ export namespace GCalc {
357
359
  * See also: `g_list_model_get_n_items()`
358
360
  * @param position the position of the item to fetch
359
361
  * @returns the object at `position`.
362
+ * @since 2.44
360
363
  */
361
364
  get_item(position: number): A | null;
362
365
 
@@ -384,6 +387,7 @@ export namespace GCalc {
384
387
  * @param position the position at which `list` changed
385
388
  * @param removed the number of items removed
386
389
  * @param added the number of items added
390
+ * @since 2.44
387
391
  */
388
392
  items_changed(position: number, removed: number, added: number): void;
389
393
 
@@ -396,6 +400,7 @@ export namespace GCalc {
396
400
  *
397
401
  * The same {@link GObject.Object} instance may not appear more than once in a {@link Gio.ListModel}.
398
402
  * @param position the position of the item to fetch
403
+ * @since 2.44
399
404
  * @virtual
400
405
  */
401
406
  vfunc_get_item(position: number): A | null;
@@ -409,6 +414,7 @@ export namespace GCalc {
409
414
  *
410
415
  * The item type of a {@link Gio.ListModel} can not change during the life of the
411
416
  * model.
417
+ * @since 2.44
412
418
  * @virtual
413
419
  */
414
420
  vfunc_get_item_type(): GObject.GType;
@@ -419,6 +425,7 @@ export namespace GCalc {
419
425
  * Depending on the model implementation, calling this function may be
420
426
  * less efficient than iterating the list with increasing values for
421
427
  * `position` until `g_list_model_get_item()` returns `null`.
428
+ * @since 2.44
422
429
  * @virtual
423
430
  */
424
431
  vfunc_get_n_items(): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gcalc-1",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "description": "GJS TypeScript type definitions for GCalc-1",
5
5
  "type": "module",
6
6
  "module": "gcalc-1.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/gobject-2.0": "^4.2.0",
36
- "@girs/glib-2.0": "^4.2.0",
37
- "@girs/gio-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/gobject-2.0": "^4.4.0",
36
+ "@girs/glib-2.0": "^4.4.0",
37
+ "@girs/gio-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
  },