@girs/gtksource-300 4.2.0 → 4.3.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/gtksource-300)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GtkSource-300 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.2.0.
8
+ GJS TypeScript type definitions for GtkSource-300 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.3.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/gtksource-300
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 GtkSource from '@girs/gtksource-300';
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/gtksource-300` or `@girs/gtksource-300/ambient` in your `tsconfig` or entry point Typescript file:
28
28
 
29
29
  `index.ts`:
@@ -42,7 +42,7 @@ import '@girs/gtksource-300'
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 GtkSource from 'gi://GtkSource?version=300';
@@ -50,7 +50,7 @@ import GtkSource from 'gi://GtkSource?version=300';
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/gtksource-300` or `@girs/gtksource-300/import` in your `tsconfig` or entry point Typescript file:
55
55
 
56
56
  `index.ts`:
@@ -69,7 +69,7 @@ import '@girs/gtksource-300'
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 GtkSource = imports.gi.GtkSource;
@@ -77,7 +77,7 @@ const GtkSource = imports.gi.GtkSource;
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
 
@@ -998,6 +998,13 @@ export namespace GtkSource {
998
998
  emit<K extends keyof Buffer.SignalSignatures>(signal: K, ...args: GObject.GjsParameters<Buffer.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never): void;
999
999
  emit(signal: string, ...args: any[]): void;
1000
1000
 
1001
+ // Static methods
1002
+ /**
1003
+ * Removes one trailing newline of `buffer` if it contains at least one.
1004
+ * @param buffer a {@link Gtk.TextBuffer}.
1005
+ */
1006
+ static remove_trailing_newline(buffer: Gtk.TextBuffer): void;
1007
+
1001
1008
  // Virtual methods
1002
1009
  /**
1003
1010
  * @param iter
@@ -2020,10 +2027,9 @@ export namespace GtkSource {
2020
2027
 
2021
2028
  // Methods
2022
2029
  /**
2023
- * Moves the {@link GtkSource.CompletionInfo} to `iter`. If `iter` is `null` `info` is
2024
- * moved to the cursor position. Moving will respect the {@link Gdk.Gravity} setting
2025
- * of the info window and will ensure the line at `iter` is not occluded by
2026
- * the window.
2030
+ * Moves the {@link GtkSource.CompletionInfo} to `iter`. If `iter` is `null` `info` is moved
2031
+ * to the cursor position. Moving will respect the {@link Gdk.Gravity} setting of the
2032
+ * info window and will ensure the line at `iter` is not occluded by the window.
2027
2033
  * @param view a {@link Gtk.TextView} on which the info window should be positioned.
2028
2034
  * @param iter a {@link Gtk.TextIter}.
2029
2035
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gtksource-300",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "GJS TypeScript type definitions for GtkSource-300",
5
5
  "type": "module",
6
6
  "module": "gtksource-300.js",
@@ -36,20 +36,20 @@
36
36
  "test": "tsc --project tsconfig.json"
37
37
  },
38
38
  "dependencies": {
39
- "@girs/gjs": "^4.2.0",
40
- "@girs/gtk-3.0": "^4.2.0",
41
- "@girs/xlib-2.0": "^4.2.0",
42
- "@girs/gdk-3.0": "^4.2.0",
43
- "@girs/cairo-1.0": "^4.2.0",
44
- "@girs/gobject-2.0": "^4.2.0",
45
- "@girs/glib-2.0": "^4.2.0",
46
- "@girs/pango-1.0": "^4.2.0",
47
- "@girs/harfbuzz-0.0": "^4.2.0",
48
- "@girs/freetype2-2.0": "^4.2.0",
49
- "@girs/gio-2.0": "^4.2.0",
50
- "@girs/gmodule-2.0": "^4.2.0",
51
- "@girs/gdkpixbuf-2.0": "^4.2.0",
52
- "@girs/atk-1.0": "^4.2.0" },
39
+ "@girs/gjs": "^4.3.0",
40
+ "@girs/gtk-3.0": "^4.3.0",
41
+ "@girs/xlib-2.0": "^4.3.0",
42
+ "@girs/gdk-3.0": "^4.3.0",
43
+ "@girs/cairo-1.0": "^4.3.0",
44
+ "@girs/gobject-2.0": "^4.3.0",
45
+ "@girs/glib-2.0": "^4.3.0",
46
+ "@girs/pango-1.0": "^4.3.0",
47
+ "@girs/harfbuzz-0.0": "^4.3.0",
48
+ "@girs/freetype2-2.0": "^4.3.0",
49
+ "@girs/gio-2.0": "^4.3.0",
50
+ "@girs/gmodule-2.0": "^4.3.0",
51
+ "@girs/gdkpixbuf-2.0": "^4.3.0",
52
+ "@girs/atk-1.0": "^4.3.0" },
53
53
  "devDependencies": {
54
54
  "typescript": "*"
55
55
  },