@girs/glygtk4-2 2.0.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.
- package/README.md +85 -0
- package/glygtk4-2-ambient.d.ts +9 -0
- package/glygtk4-2-ambient.js +2 -0
- package/glygtk4-2-import.d.ts +9 -0
- package/glygtk4-2-import.js +3 -0
- package/glygtk4-2.d.ts +52 -0
- package/glygtk4-2.js +5 -0
- package/index.d.ts +15 -0
- package/index.js +5 -0
- package/package.json +63 -0
- package/tsconfig.json +25 -0
- package/typedoc.json +7 -0
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
|
|
2
|
+
# GlyGtk4-2
|
|
3
|
+
|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
GJS TypeScript type definitions for GlyGtk4-2, generated from library version 2.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.37.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
To use this type definitions, install them with NPM:
|
|
13
|
+
```bash
|
|
14
|
+
npm install @girs/glygtk4-2
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
You can import this package into your project like this:
|
|
20
|
+
```ts
|
|
21
|
+
import GlyGtk4 from '@girs/glygtk4-2';
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Ambient Modules
|
|
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.
|
|
27
|
+
For this you need to include `@girs/glygtk4-2` or `@girs/glygtk4-2/ambient` in your `tsconfig` or entry point Typescript file:
|
|
28
|
+
|
|
29
|
+
`index.ts`:
|
|
30
|
+
```ts
|
|
31
|
+
import '@girs/glygtk4-2'
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`tsconfig.json`:
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"compilerOptions": {
|
|
38
|
+
...
|
|
39
|
+
},
|
|
40
|
+
"include": ["@girs/glygtk4-2"],
|
|
41
|
+
...
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Now you can import the ambient module with TypeScript support:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import GlyGtk4 from 'gi://GlyGtk4?version=2';
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Global import
|
|
52
|
+
|
|
53
|
+
You can also import the module with Typescript support using the global `imports.gi` object of GJS.
|
|
54
|
+
For this you need to include `@girs/glygtk4-2` or `@girs/glygtk4-2/import` in your `tsconfig` or entry point Typescript file:
|
|
55
|
+
|
|
56
|
+
`index.ts`:
|
|
57
|
+
```ts
|
|
58
|
+
import '@girs/glygtk4-2'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`tsconfig.json`:
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"compilerOptions": {
|
|
65
|
+
...
|
|
66
|
+
},
|
|
67
|
+
"include": ["@girs/glygtk4-2"],
|
|
68
|
+
...
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Now you have also type support for this, too:
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
const GlyGtk4 = imports.gi.GlyGtk4;
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Bundle
|
|
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).
|
|
81
|
+
|
|
82
|
+
## Other packages
|
|
83
|
+
|
|
84
|
+
All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
|
|
85
|
+
|
package/glygtk4-2.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
3
|
+
*
|
|
4
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
5
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
|
|
6
|
+
*
|
|
7
|
+
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import '@girs/gjs';
|
|
11
|
+
|
|
12
|
+
// Module dependencies
|
|
13
|
+
import type Gly from '@girs/gly-2';
|
|
14
|
+
import type Gio from '@girs/gio-2.0';
|
|
15
|
+
import type GObject from '@girs/gobject-2.0';
|
|
16
|
+
import type GLib from '@girs/glib-2.0';
|
|
17
|
+
import type GModule from '@girs/gmodule-2.0';
|
|
18
|
+
import type Gdk from '@girs/gdk-4.0';
|
|
19
|
+
import type cairo from 'cairo';
|
|
20
|
+
import type PangoCairo from '@girs/pangocairo-1.0';
|
|
21
|
+
import type Pango from '@girs/pango-1.0';
|
|
22
|
+
import type HarfBuzz from '@girs/harfbuzz-0.0';
|
|
23
|
+
import type freetype2 from '@girs/freetype2-2.0';
|
|
24
|
+
import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
|
|
25
|
+
|
|
26
|
+
export namespace GlyGtk4 {
|
|
27
|
+
/**
|
|
28
|
+
* GlyGtk4-2
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Gets the actual image from a frame. See the [class`Gly`.Loader] docs
|
|
33
|
+
* for a complete example.
|
|
34
|
+
* @param frame Frame
|
|
35
|
+
* @returns A GDK Texture
|
|
36
|
+
*/
|
|
37
|
+
function frame_get_texture(frame: Gly.Frame): Gdk.Texture;
|
|
38
|
+
/**
|
|
39
|
+
* Name of the imported GIR library
|
|
40
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
41
|
+
*/
|
|
42
|
+
const __name__: string;
|
|
43
|
+
/**
|
|
44
|
+
* Version of the imported GIR library
|
|
45
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
46
|
+
*/
|
|
47
|
+
const __version__: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default GlyGtk4;
|
|
51
|
+
|
|
52
|
+
// END
|
package/glygtk4-2.js
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
3
|
+
*
|
|
4
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
5
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
|
|
6
|
+
*
|
|
7
|
+
* This template is used to generate the index.d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import './glygtk4-2-ambient.d.ts';
|
|
11
|
+
|
|
12
|
+
import './glygtk4-2-import.d.ts';
|
|
13
|
+
|
|
14
|
+
import GlyGtk4 from './glygtk4-2.js';
|
|
15
|
+
export default GlyGtk4;
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@girs/glygtk4-2",
|
|
3
|
+
"version": "2.0.0-4.0.0-beta.37",
|
|
4
|
+
"description": "GJS TypeScript type definitions for GlyGtk4-2, generated from library version 2.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "glygtk4-2.js",
|
|
7
|
+
"main": "glygtk4-2.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./ambient": {
|
|
10
|
+
"types": "./glygtk4-2-ambient.d.ts",
|
|
11
|
+
"import": "./glygtk4-2-ambient.js",
|
|
12
|
+
"default": "./glygtk4-2-ambient.js"
|
|
13
|
+
},
|
|
14
|
+
"./import": {
|
|
15
|
+
"types": "./glygtk4-2-import.d.ts",
|
|
16
|
+
"import": "./glygtk4-2-import.js",
|
|
17
|
+
"default": "./glygtk4-2-import.js"
|
|
18
|
+
},
|
|
19
|
+
"./glygtk4-2": {
|
|
20
|
+
"types": "./glygtk4-2.d.ts",
|
|
21
|
+
"import": "./glygtk4-2.js",
|
|
22
|
+
"default": "./glygtk4-2.js"
|
|
23
|
+
},
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./index.d.ts",
|
|
26
|
+
"import": "./index.js",
|
|
27
|
+
"default": "./index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"test": "tsc --project tsconfig.json"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@girs/gjs": "4.0.0-beta.37",
|
|
35
|
+
"@girs/gly-2": "2.0.0-4.0.0-beta.37",
|
|
36
|
+
"@girs/gio-2.0": "2.86.0-4.0.0-beta.37",
|
|
37
|
+
"@girs/gobject-2.0": "2.86.0-4.0.0-beta.37",
|
|
38
|
+
"@girs/glib-2.0": "2.86.0-4.0.0-beta.37",
|
|
39
|
+
"@girs/gmodule-2.0": "2.0.0-4.0.0-beta.37",
|
|
40
|
+
"@girs/gdk-4.0": "4.0.0-4.0.0-beta.37",
|
|
41
|
+
"@girs/cairo-1.0": "1.0.0-4.0.0-beta.37",
|
|
42
|
+
"@girs/pangocairo-1.0": "1.0.0-4.0.0-beta.37",
|
|
43
|
+
"@girs/pango-1.0": "1.57.0-4.0.0-beta.37",
|
|
44
|
+
"@girs/harfbuzz-0.0": "11.5.0-4.0.0-beta.37",
|
|
45
|
+
"@girs/freetype2-2.0": "2.0.0-4.0.0-beta.37",
|
|
46
|
+
"@girs/gdkpixbuf-2.0": "2.0.0-4.0.0-beta.37" },
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"typescript": "*"
|
|
49
|
+
},
|
|
50
|
+
"keywords": ["Gir", "TypeScript", "types", "GObject-Introspection", "GJS", "GlyGtk4-2"],
|
|
51
|
+
"author": "ts-for-gir",
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/gjsify/types.git"
|
|
56
|
+
},
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/gjsify/ts-for-gir/issues"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://github.com/gjsify/types/tree/main/glygtk4-2#readme"
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// General settings for code interpretation
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"module": "NodeNext",
|
|
6
|
+
"lib": ["ESNext"],
|
|
7
|
+
"types": [],
|
|
8
|
+
"experimentalDecorators": true,
|
|
9
|
+
"moduleResolution": "NodeNext",
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"noEmitOnError": false,
|
|
12
|
+
"baseUrl": "./",
|
|
13
|
+
"rootDir": ".",
|
|
14
|
+
// General settings for code generation
|
|
15
|
+
"removeComments": false,
|
|
16
|
+
"inlineSourceMap": false,
|
|
17
|
+
"inlineSources": false,
|
|
18
|
+
"newLine": "LF",
|
|
19
|
+
// Show diagnostics
|
|
20
|
+
"diagnostics": true
|
|
21
|
+
},
|
|
22
|
+
"include": ["./glygtk4-2.d.ts"]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|