@girs/mtk-13 4.0.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 ADDED
@@ -0,0 +1,85 @@
1
+
2
+ # Mtk-13
3
+
4
+ ![version](https://img.shields.io/npm/v/@girs/mtk-13)
5
+ ![downloads/week](https://img.shields.io/npm/dw/@girs/mtk-13)
6
+
7
+
8
+ GJS TypeScript type definitions for Mtk-13, generated from library version 13.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.4.
9
+
10
+ ## Install
11
+
12
+ To use this type definitions, install them with NPM:
13
+ ```bash
14
+ npm install @girs/mtk-13
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ You can import this package into your project like this:
20
+ ```ts
21
+ import Mtk from '@girs/mtk-13';
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/mtk-13` or `@girs/mtk-13/ambient` in your `tsconfig` or entry point Typescript file:
28
+
29
+ `index.ts`:
30
+ ```ts
31
+ import '@girs/mtk-13'
32
+ ```
33
+
34
+ `tsconfig.json`:
35
+ ```json
36
+ {
37
+ "compilerOptions": {
38
+ ...
39
+ },
40
+ "include": ["@girs/mtk-13"],
41
+ ...
42
+ }
43
+ ```
44
+
45
+ Now you can import the ambient module with TypeScript support:
46
+
47
+ ```ts
48
+ import Mtk from 'gi://Mtk?version=13';
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/mtk-13` or `@girs/mtk-13/import` in your `tsconfig` or entry point Typescript file:
55
+
56
+ `index.ts`:
57
+ ```ts
58
+ import '@girs/mtk-13'
59
+ ```
60
+
61
+ `tsconfig.json`:
62
+ ```json
63
+ {
64
+ "compilerOptions": {
65
+ ...
66
+ },
67
+ "include": ["@girs/mtk-13"],
68
+ ...
69
+ }
70
+ ```
71
+
72
+ Now you have also type support for this, too:
73
+
74
+ ```ts
75
+ const Mtk = imports.gi.Mtk;
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/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 './mtk-13-ambient.d.ts';
11
+
12
+
13
+ import Mtk from './mtk-13.js';
14
+ export default Mtk;
15
+
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import Mtk from './mtk-13.js';
4
+ export default Mtk;
5
+
@@ -0,0 +1,12 @@
1
+
2
+ declare module 'gi://Mtk?version=13' {
3
+ import Mtk13 from '@girs/mtk-13';
4
+ export default Mtk13;
5
+ }
6
+
7
+ declare module 'gi://Mtk' {
8
+ import Mtk13 from 'gi://Mtk?version=13';
9
+ export default Mtk13;
10
+ }
11
+
12
+
@@ -0,0 +1,2 @@
1
+ export {}
2
+
@@ -0,0 +1,2 @@
1
+ // Module import type definition not generated, otherwise this would cause a type conflict, this is because several GIR modules were generated with the same namespace: "Mtk"
2
+
@@ -0,0 +1,3 @@
1
+ const gi = globalThis.imports?.gi || {};
2
+ export default gi;
3
+
package/mtk-13.d.ts ADDED
@@ -0,0 +1,163 @@
1
+
2
+ /**
3
+ * Type Definitions for Gjs (https://gjs.guide/)
4
+ *
5
+ * These type definitions are automatically generated, do not edit them by hand.
6
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
7
+ *
8
+ * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
9
+ */
10
+
11
+ import '@girs/gjs';
12
+
13
+ // Module dependencies
14
+ import type cairo from 'cairo';
15
+ import type GObject from '@girs/gobject-2.0';
16
+ import type GLib from '@girs/glib-2.0';
17
+ import type Graphene from '@girs/graphene-1.0';
18
+
19
+ export namespace Mtk {
20
+
21
+ /**
22
+ * Mtk-13
23
+ */
24
+
25
+
26
+ /**
27
+ * @gir-type Enum
28
+ */
29
+ enum RoundingStrategy {
30
+ SHRINK,
31
+ GROW,
32
+ ROUND,
33
+ }
34
+
35
+
36
+ /**
37
+ * @param rect A rectangle
38
+ * @param rounding_strategy The rounding strategy
39
+ */
40
+ function rectangle_from_graphene_rect(rect: Graphene.Rect, rounding_strategy: RoundingStrategy): Rectangle;
41
+
42
+ function x11_errors_deinit(): void;
43
+
44
+ /**
45
+ * @gir-type Struct
46
+ */
47
+ class Rectangle {
48
+ static $gtype: GObject.GType<Rectangle>;
49
+
50
+ // Fields
51
+ x: number;
52
+
53
+ y: number;
54
+
55
+ width: number;
56
+
57
+ height: number;
58
+
59
+ // Constructors
60
+
61
+ constructor(properties?: Partial<{
62
+ x: number;
63
+ y: number;
64
+ width: number;
65
+ height: number;
66
+ }>);
67
+
68
+ static ["new"](x: number, y: number, width: number, height: number): Rectangle;
69
+
70
+ // Static methods
71
+ /**
72
+ * @param rect A rectangle
73
+ * @param rounding_strategy The rounding strategy
74
+ */
75
+ static from_graphene_rect(rect: Graphene.Rect, rounding_strategy: RoundingStrategy): Rectangle;
76
+
77
+ // Methods
78
+ /**
79
+ * @returns The area of the rectangle
80
+ */
81
+ area(): number;
82
+
83
+ /**
84
+ * @param inner_rect The inner rectangle
85
+ * @returns Whether the outer rectangle contains the inner one
86
+ */
87
+ contains_rect(inner_rect: Rectangle): boolean;
88
+
89
+ copy(): Rectangle;
90
+
91
+ /**
92
+ * @param inner_rect The inner rectangle
93
+ * @returns Whether the inner rectangle could fit inside the outer one
94
+ */
95
+ could_fit_rect(inner_rect: Rectangle): boolean;
96
+
97
+ /**
98
+ * Compares the two rectangles
99
+ * @param src2 The second rectangle
100
+ * @returns Whether the two rectangles are equal
101
+ */
102
+ equal(src2: Rectangle): boolean;
103
+
104
+ free(): void;
105
+
106
+ /**
107
+ * Similar to {@link Rectangle.overlap} but ignores the vertical location.
108
+ * @param rect2 The second rectangle
109
+ * @returns Whether the two rectangles overlap horizontally
110
+ */
111
+ horiz_overlap(rect2: Rectangle): boolean;
112
+
113
+ /**
114
+ * Find the intersection between the two rectangles
115
+ * @param src2 another {@link Mtk.Rectangle}
116
+ * @returns TRUE is some intersection exists and is not degenerate, FALSE otherwise.
117
+ */
118
+ intersect(src2: Rectangle): [boolean, Rectangle];
119
+
120
+ /**
121
+ * Similar to {@link Rectangle.intersect} but doesn't provide
122
+ * the location of the intersection.
123
+ * @param rect2 The second rectangle
124
+ * @returns Whether the two rectangles overlap
125
+ */
126
+ overlap(rect2: Rectangle): boolean;
127
+
128
+ /**
129
+ * @returns Return a graphene_rect_t created from `rect`
130
+ */
131
+ to_graphene_rect(): Graphene.Rect;
132
+
133
+ /**
134
+ * Computes the union of the two rectangles
135
+ * @param rect2 another {@link Mtk.Rectangle}
136
+ */
137
+ union(rect2: Rectangle): Rectangle;
138
+
139
+ /**
140
+ * Similar to {@link Rectangle.overlap} but ignores the horizontal location.
141
+ * @param rect2 The second rectangle
142
+ * @returns Whether the two rectangles overlap vertically
143
+ */
144
+ vert_overlap(rect2: Rectangle): boolean;
145
+ }
146
+
147
+
148
+ /**
149
+ * Name of the imported GIR library
150
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
151
+ */
152
+ const __name__: string;
153
+
154
+ /**
155
+ * Version of the imported GIR library
156
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
157
+ */
158
+ const __version__: string;
159
+ }
160
+
161
+ export default Mtk;
162
+
163
+ // END
package/mtk-13.js ADDED
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import Mtk from 'gi://Mtk?version=13';
4
+ export default Mtk;
5
+
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@girs/mtk-13",
3
+ "version": "4.0.4",
4
+ "libraryVersion": "13.0.0",
5
+ "description": "GJS TypeScript type definitions for Mtk-13, generated from library version 13.0.0",
6
+ "type": "module",
7
+ "module": "mtk-13.js",
8
+ "main": "mtk-13.js",
9
+ "exports": {
10
+ "./ambient": {
11
+ "types": "./mtk-13-ambient.d.ts",
12
+ "import": "./mtk-13-ambient.js",
13
+ "default": "./mtk-13-ambient.js"
14
+ },
15
+ "./import": {
16
+ "types": "./mtk-13-import.d.ts",
17
+ "import": "./mtk-13-import.js",
18
+ "default": "./mtk-13-import.js"
19
+ },
20
+ "./mtk-13": {
21
+ "types": "./mtk-13.d.ts",
22
+ "import": "./mtk-13.js",
23
+ "default": "./mtk-13.js"
24
+ },
25
+ ".": {
26
+ "types": "./index.d.ts",
27
+ "import": "./index.js",
28
+ "default": "./index.js"
29
+ }
30
+ },
31
+ "scripts": {
32
+ "test": "tsc --project tsconfig.json"
33
+ },
34
+ "dependencies": {
35
+ "@girs/gjs": "^4.0.4",
36
+ "@girs/cairo-1.0": "^4.0.4",
37
+ "@girs/gobject-2.0": "^4.0.4",
38
+ "@girs/glib-2.0": "^4.0.4",
39
+ "@girs/graphene-1.0": "^4.0.4" },
40
+ "devDependencies": {
41
+ "typescript": "*"
42
+ },
43
+ "keywords": ["Gir", "TypeScript", "types", "GObject-Introspection", "GJS", "Mtk-13"],
44
+ "author": "ts-for-gir",
45
+ "license": "MIT",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/gjsify/types.git"
49
+ },
50
+ "bugs": {
51
+ "url": "https://github.com/gjsify/ts-for-gir/issues"
52
+ },
53
+ "homepage": "https://github.com/gjsify/types/tree/main/mtk-13#readme"
54
+ }
55
+
56
+
package/tsconfig.json ADDED
@@ -0,0 +1,41 @@
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
+ "rootDir": ".",
13
+ // General settings for code generation
14
+ "removeComments": false,
15
+ "inlineSourceMap": false,
16
+ "inlineSources": false,
17
+ "newLine": "LF",
18
+ // Show diagnostics
19
+ "diagnostics": true,
20
+ "paths": {
21
+ "@girs/cairo-1.0": [
22
+ "../cairo-1.0/index.d.ts"
23
+ ],
24
+ "@girs/gobject-2.0": [
25
+ "../gobject-2.0/index.d.ts"
26
+ ],
27
+ "@girs/glib-2.0": [
28
+ "../glib-2.0/index.d.ts"
29
+ ],
30
+ "@girs/graphene-1.0": [
31
+ "../graphene-1.0/index.d.ts"
32
+ ],
33
+ "@girs/gjs": [
34
+ "../gjs/index.d.ts"
35
+ ]
36
+ }
37
+ },
38
+ "include": ["./mtk-13.d.ts"]
39
+ }
40
+
41
+
package/typedoc.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "entryPoints": ["./mtk-13.d.ts"],
3
+ "readme": "./README.md",
4
+ "name": "Mtk-13",
5
+ "tsconfig": "./tsconfig.json",
6
+ "skipErrorChecking": true,
7
+ "highlightLanguages": ["typescript", "javascript", "c", "cpp", "xml", "bash", "json", "css"]
8
+ }
9
+