@girs/gtksource-3.0 3.0.0-4.0.0-beta.2 → 3.0.0-4.0.0-beta.4
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 +1 -19
- package/gtksource-3.0.d.ts +6 -6
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for GtkSource-3.0, generated from library version 3.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.
|
|
8
|
+
GJS TypeScript type definitions for GtkSource-3.0, generated from library version 3.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.3.
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
## Install
|
|
@@ -22,11 +22,6 @@ You can import this package into your project like this:
|
|
|
22
22
|
import GtkSource from '@girs/gtksource-3.0';
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Or if you prefer CommonJS, you can also use this:
|
|
26
|
-
```ts
|
|
27
|
-
const GtkSource = require('@girs/gtksource-3.0');
|
|
28
|
-
```
|
|
29
|
-
|
|
30
25
|
### Ambient Modules
|
|
31
26
|
|
|
32
27
|
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.
|
|
@@ -81,19 +76,6 @@ Now you have also type support for this, too:
|
|
|
81
76
|
const GtkSource = imports.gi.GtkSource;
|
|
82
77
|
```
|
|
83
78
|
|
|
84
|
-
|
|
85
|
-
### ESM vs. CommonJS
|
|
86
|
-
|
|
87
|
-
GJS supports two different import syntaxes. The new modern ESM syntax and the old global imports syntax.
|
|
88
|
-
|
|
89
|
-
In TypeScript projects for GJS and GNOME Shell extensions, you have the flexibility to use `ESM` syntax and then decide the import syntax for your bundled file. If your bundler is configured to use `CommonJS`, it will convert to the GJS-specific global imports syntax, like `const moduleName = imports.gi[moduleName]`. This is different from the traditional `require` syntax seen in Node.js. The global imports syntax is chosen because it aligns with the CommonJS format supported by NPM, which is used for the generated type definitions and this package.
|
|
90
|
-
|
|
91
|
-
On the other hand, if you configure your bundler to use ESM, it will retain the ESM import syntax. It's crucial to ensure that your bundler is set up to correctly translate and bundle these imports into either CommonJS or ESM format, depending on your project's requirements.
|
|
92
|
-
|
|
93
|
-
This approach is particularly important due to the `@girs` types, which include both `*.cjs `files, using the GJS global imports syntax, and `*.js` files, which utilize the ESM syntax. By appropriately setting up your bundler, you can control which syntax—CommonJS or ESM—is used in your project. The choice of CommonJS in this context is also due to the similarity between the GJS-specific global imports and CommonJS syntax, allowing for easier management and bundling in these specific types of projects.
|
|
94
|
-
|
|
95
|
-
Since GNOME Shell 45, you should only use ESM, even for GNOME Shell extensions. Before that, extensions had to use the global import syntax, unlike normal GJS applications, where ESM has been available for some time.
|
|
96
|
-
|
|
97
79
|
### Bundle
|
|
98
80
|
|
|
99
81
|
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).
|
package/gtksource-3.0.d.ts
CHANGED
|
@@ -23,8 +23,8 @@ import type Pango from '@girs/pango-1.0';
|
|
|
23
23
|
import type HarfBuzz from '@girs/harfbuzz-0.0';
|
|
24
24
|
import type freetype2 from '@girs/freetype2-2.0';
|
|
25
25
|
import type Gio from '@girs/gio-2.0';
|
|
26
|
-
import type GModule from '@girs/gmodule-2.0';
|
|
27
26
|
import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
|
|
27
|
+
import type GModule from '@girs/gmodule-2.0';
|
|
28
28
|
import type Atk from '@girs/atk-1.0';
|
|
29
29
|
|
|
30
30
|
export namespace GtkSource {
|
|
@@ -682,7 +682,7 @@ export namespace GtkSource {
|
|
|
682
682
|
* @param category category to search for, or %NULL
|
|
683
683
|
* @returns whether @iter was moved.
|
|
684
684
|
*/
|
|
685
|
-
backward_iter_to_source_mark(iter: Gtk.TextIter, category?: string | null): boolean;
|
|
685
|
+
backward_iter_to_source_mark(iter: Gtk.TextIter, category?: string | null): [boolean, Gtk.TextIter];
|
|
686
686
|
/**
|
|
687
687
|
* Marks the beginning of a not undoable action on the buffer,
|
|
688
688
|
* disabling the undo manager. Typically you would call this function
|
|
@@ -749,7 +749,7 @@ export namespace GtkSource {
|
|
|
749
749
|
* @param category category to search for, or %NULL
|
|
750
750
|
* @returns whether @iter was moved.
|
|
751
751
|
*/
|
|
752
|
-
forward_iter_to_source_mark(iter: Gtk.TextIter, category?: string | null): boolean;
|
|
752
|
+
forward_iter_to_source_mark(iter: Gtk.TextIter, category?: string | null): [boolean, Gtk.TextIter];
|
|
753
753
|
/**
|
|
754
754
|
* Get all defined context classes at `iter`.
|
|
755
755
|
*
|
|
@@ -825,7 +825,7 @@ export namespace GtkSource {
|
|
|
825
825
|
* @param context_class the context class.
|
|
826
826
|
* @returns whether we found a context class toggle before @iter
|
|
827
827
|
*/
|
|
828
|
-
iter_backward_to_context_class_toggle(iter: Gtk.TextIter, context_class: string): boolean;
|
|
828
|
+
iter_backward_to_context_class_toggle(iter: Gtk.TextIter, context_class: string): [boolean, Gtk.TextIter];
|
|
829
829
|
/**
|
|
830
830
|
* Moves forward to the next toggle (on or off) of the context class. If no
|
|
831
831
|
* matching context class toggles are found, returns %FALSE, otherwise %TRUE.
|
|
@@ -838,7 +838,7 @@ export namespace GtkSource {
|
|
|
838
838
|
* @param context_class the context class.
|
|
839
839
|
* @returns whether we found a context class toggle after @iter
|
|
840
840
|
*/
|
|
841
|
-
iter_forward_to_context_class_toggle(iter: Gtk.TextIter, context_class: string): boolean;
|
|
841
|
+
iter_forward_to_context_class_toggle(iter: Gtk.TextIter, context_class: string): [boolean, Gtk.TextIter];
|
|
842
842
|
/**
|
|
843
843
|
* Check if the class `context_class` is set on `iter`.
|
|
844
844
|
*
|
|
@@ -12763,7 +12763,7 @@ export namespace GtkSource {
|
|
|
12763
12763
|
_init(...args: any[]): void;
|
|
12764
12764
|
}
|
|
12765
12765
|
|
|
12766
|
-
|
|
12766
|
+
class Encoding {
|
|
12767
12767
|
static $gtype: GObject.GType<Encoding>;
|
|
12768
12768
|
|
|
12769
12769
|
// Constructors of GtkSource.Encoding
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/gtksource-3.0",
|
|
3
|
-
"version": "3.0.0-4.0.0-beta.
|
|
3
|
+
"version": "3.0.0-4.0.0-beta.4",
|
|
4
4
|
"description": "GJS TypeScript type definitions for GtkSource-3.0, generated from library version 3.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "gtksource-3.0.js",
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
"test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gtksource-3.0.d.ts"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@girs/atk-1.0": "^2.52.0-4.0.0-beta.
|
|
30
|
-
"@girs/cairo-1.0": "^1.0.0-4.0.0-beta.
|
|
31
|
-
"@girs/freetype2-2.0": "^2.0.0-4.0.0-beta.
|
|
32
|
-
"@girs/gdk-3.0": "^3.24.41-4.0.0-beta.
|
|
33
|
-
"@girs/gdkpixbuf-2.0": "^2.0.0-4.0.0-beta.
|
|
34
|
-
"@girs/gio-2.0": "^2.80.0-4.0.0-beta.
|
|
35
|
-
"@girs/gjs": "^4.0.0-beta.
|
|
36
|
-
"@girs/glib-2.0": "^2.80.0-4.0.0-beta.
|
|
37
|
-
"@girs/gmodule-2.0": "^2.0.0-4.0.0-beta.
|
|
38
|
-
"@girs/gobject-2.0": "^2.80.0-4.0.0-beta.
|
|
39
|
-
"@girs/gtk-3.0": "^3.24.41-4.0.0-beta.
|
|
40
|
-
"@girs/harfbuzz-0.0": "^8.3.1-4.0.0-beta.
|
|
41
|
-
"@girs/pango-1.0": "^1.
|
|
42
|
-
"@girs/xlib-2.0": "^2.0.0-4.0.0-beta.
|
|
29
|
+
"@girs/atk-1.0": "^2.52.0-4.0.0-beta.4",
|
|
30
|
+
"@girs/cairo-1.0": "^1.0.0-4.0.0-beta.4",
|
|
31
|
+
"@girs/freetype2-2.0": "^2.0.0-4.0.0-beta.4",
|
|
32
|
+
"@girs/gdk-3.0": "^3.24.41-4.0.0-beta.4",
|
|
33
|
+
"@girs/gdkpixbuf-2.0": "^2.0.0-4.0.0-beta.4",
|
|
34
|
+
"@girs/gio-2.0": "^2.80.0-4.0.0-beta.4",
|
|
35
|
+
"@girs/gjs": "^4.0.0-beta.4",
|
|
36
|
+
"@girs/glib-2.0": "^2.80.0-4.0.0-beta.4",
|
|
37
|
+
"@girs/gmodule-2.0": "^2.0.0-4.0.0-beta.4",
|
|
38
|
+
"@girs/gobject-2.0": "^2.80.0-4.0.0-beta.4",
|
|
39
|
+
"@girs/gtk-3.0": "^3.24.41-4.0.0-beta.4",
|
|
40
|
+
"@girs/harfbuzz-0.0": "^8.3.1-4.0.0-beta.4",
|
|
41
|
+
"@girs/pango-1.0": "^1.52.2-4.0.0-beta.4",
|
|
42
|
+
"@girs/xlib-2.0": "^2.0.0-4.0.0-beta.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"typescript": "*"
|