@girs/mtk-16 16.0.0-4.0.0-beta.21

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,86 @@
1
+
2
+ # Mtk-16
3
+
4
+ ![version](https://img.shields.io/npm/v/@girs/mtk-16)
5
+ ![downloads/week](https://img.shields.io/npm/dw/@girs/mtk-16)
6
+
7
+
8
+ GJS TypeScript type definitions for Mtk-16, generated from library version 16.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.21.
9
+
10
+
11
+ ## Install
12
+
13
+ To use this type definitions, install them with NPM:
14
+ ```bash
15
+ npm install @girs/mtk-16
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ You can import this package into your project like this:
21
+ ```ts
22
+ import Mtk from '@girs/mtk-16';
23
+ ```
24
+
25
+ ### Ambient Modules
26
+
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.
28
+ For this you need to include `@girs/mtk-16` or `@girs/mtk-16/ambient` in your `tsconfig` or entry point Typescript file:
29
+
30
+ `index.ts`:
31
+ ```ts
32
+ import '@girs/mtk-16'
33
+ ```
34
+
35
+ `tsconfig.json`:
36
+ ```json
37
+ {
38
+ "compilerOptions": {
39
+ ...
40
+ },
41
+ "include": ["@girs/mtk-16"],
42
+ ...
43
+ }
44
+ ```
45
+
46
+ Now you can import the ambient module with TypeScript support:
47
+
48
+ ```ts
49
+ import Mtk from 'gi://Mtk?version=16';
50
+ ```
51
+
52
+ ### Global import
53
+
54
+ You can also import the module with Typescript support using the global `imports.gi` object of GJS.
55
+ For this you need to include `@girs/mtk-16` or `@girs/mtk-16/import` in your `tsconfig` or entry point Typescript file:
56
+
57
+ `index.ts`:
58
+ ```ts
59
+ import '@girs/mtk-16'
60
+ ```
61
+
62
+ `tsconfig.json`:
63
+ ```json
64
+ {
65
+ "compilerOptions": {
66
+ ...
67
+ },
68
+ "include": ["@girs/mtk-16"],
69
+ ...
70
+ }
71
+ ```
72
+
73
+ Now you have also type support for this, too:
74
+
75
+ ```ts
76
+ const Mtk = imports.gi.Mtk;
77
+ ```
78
+
79
+ ### Bundle
80
+
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).
82
+
83
+ ## Other packages
84
+
85
+ All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
86
+
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-16-ambient.d.ts';
11
+
12
+ import './mtk-16-import.d.ts';
13
+
14
+ import Mtk from './mtk-16.js';
15
+ export default Mtk;
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import Mtk from './mtk-16.js';
4
+ export default Mtk;
5
+
@@ -0,0 +1,9 @@
1
+ declare module 'gi://Mtk?version=16' {
2
+ import Mtk16 from '@girs/mtk-16';
3
+ export default Mtk16;
4
+ }
5
+
6
+ declare module 'gi://Mtk' {
7
+ import Mtk16 from 'gi://Mtk?version=16';
8
+ export default Mtk16;
9
+ }
@@ -0,0 +1,2 @@
1
+ export {}
2
+
@@ -0,0 +1,9 @@
1
+ import Mtk16 from '@girs/mtk-16';
2
+
3
+ declare global {
4
+ export interface GjsGiImports {
5
+ Mtk: typeof Mtk16;
6
+ }
7
+ }
8
+
9
+ export default GjsGiImports;
@@ -0,0 +1,3 @@
1
+ const gi = globalThis.imports?.gi || {};
2
+ export default gi;
3
+
package/mtk-16.d.ts ADDED
@@ -0,0 +1,294 @@
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
+ // Module dependencies
11
+ import type Graphene from '@girs/graphene-1.0';
12
+ import type GObject from '@girs/gobject-2.0';
13
+ import type GLib from '@girs/glib-2.0';
14
+
15
+ export namespace Mtk {
16
+ /**
17
+ * Mtk-16
18
+ */
19
+
20
+ class MonitorTransform {
21
+ static $gtype: GObject.GType<MonitorTransform>;
22
+
23
+ // Static fields
24
+
25
+ static NORMAL: number;
26
+ static '90': number;
27
+ static '180': number;
28
+ static '270': number;
29
+ static FLIPPED: number;
30
+ static FLIPPED_90: number;
31
+ static FLIPPED_180: number;
32
+ static FLIPPED_270: number;
33
+
34
+ // Constructors
35
+
36
+ _init(...args: any[]): void;
37
+ }
38
+
39
+ export namespace RegionOverlap {
40
+ export const $gtype: GObject.GType<RegionOverlap>;
41
+ }
42
+
43
+ enum RegionOverlap {
44
+ OUT,
45
+ IN,
46
+ PART,
47
+ }
48
+
49
+ export namespace RoundingStrategy {
50
+ export const $gtype: GObject.GType<RoundingStrategy>;
51
+ }
52
+
53
+ enum RoundingStrategy {
54
+ SHRINK,
55
+ GROW,
56
+ ROUND,
57
+ }
58
+ const MONITOR_ALL_TRANSFORMS: number;
59
+ const MONITOR_N_TRANSFORMS: number;
60
+ const RECTANGLE_MAX_STACK_RECTS: number;
61
+ const REGION_BUILDER_MAX_LEVELS: number;
62
+ function compute_viewport_matrix(
63
+ matrix: Graphene.Matrix,
64
+ width: number,
65
+ height: number,
66
+ scale: number,
67
+ transform: MonitorTransform | null,
68
+ src_rect: Graphene.Rect,
69
+ ): void;
70
+ function monitor_transform_from_string(name: string): MonitorTransform;
71
+ function monitor_transform_invert(transform: MonitorTransform | null): MonitorTransform;
72
+ function monitor_transform_to_string(transform: MonitorTransform | null): string;
73
+ function monitor_transform_transform(
74
+ transform: MonitorTransform | null,
75
+ other: MonitorTransform | null,
76
+ ): MonitorTransform;
77
+ function monitor_transform_transform_matrix(transform: MonitorTransform | null, matrix: Graphene.Matrix): void;
78
+ function monitor_transform_transform_point(
79
+ transform: MonitorTransform | null,
80
+ area_width: number,
81
+ area_height: number,
82
+ point_x: number,
83
+ point_y: number,
84
+ ): void;
85
+ function rectangle_from_graphene_rect(rect: Graphene.Rect, rounding_strategy: RoundingStrategy | null): Rectangle;
86
+ function region_create(): Region;
87
+ function region_create_rectangle(rect: Rectangle): Region;
88
+ function region_create_rectangles(rects: Rectangle, n_rects: number): Region;
89
+ function x11_errors_deinit(): void;
90
+ class Rectangle {
91
+ static $gtype: GObject.GType<Rectangle>;
92
+
93
+ // Fields
94
+
95
+ x: number;
96
+ y: number;
97
+ width: number;
98
+ height: number;
99
+
100
+ // Constructors
101
+
102
+ constructor(
103
+ properties?: Partial<{
104
+ x: number;
105
+ y: number;
106
+ width: number;
107
+ height: number;
108
+ }>,
109
+ );
110
+ _init(...args: any[]): void;
111
+
112
+ static ['new'](x: number, y: number, width: number, height: number): Rectangle;
113
+
114
+ static new_empty(): Rectangle;
115
+
116
+ // Static methods
117
+
118
+ static from_graphene_rect(rect: Graphene.Rect, rounding_strategy: RoundingStrategy): Rectangle;
119
+
120
+ // Methods
121
+
122
+ area(): number;
123
+ contains_point(x: number, y: number): boolean;
124
+ contains_pointf(x: number, y: number): boolean;
125
+ contains_rect(inner_rect: Rectangle): boolean;
126
+ copy(): Rectangle;
127
+ could_fit_rect(inner_rect: Rectangle): boolean;
128
+ crop_and_scale(src_rect: Graphene.Rect, dst_width: number, dst_height: number, dest: Rectangle): void;
129
+ /**
130
+ * Compares the two rectangles
131
+ * @param src2 The second rectangle
132
+ * @returns Whether the two rectangles are equal
133
+ */
134
+ equal(src2: Rectangle): boolean;
135
+ free(): void;
136
+ /**
137
+ * Similar to [method`Rectangle`.overlap] but ignores the vertical location.
138
+ * @param rect2 The second rectangle
139
+ * @returns Whether the two rectangles overlap horizontally
140
+ */
141
+ horiz_overlap(rect2: Rectangle): boolean;
142
+ /**
143
+ * Find the intersection between the two rectangles
144
+ * @param src2 another #MtkRectangle
145
+ * @returns TRUE is some intersection exists and is not degenerate, FALSE otherwise.
146
+ */
147
+ intersect(src2: Rectangle): [boolean, Rectangle];
148
+ is_adjacent_to(other: Rectangle): boolean;
149
+ /**
150
+ * Similar to [method`Rectangle`.intersect] but doesn't provide
151
+ * the location of the intersection.
152
+ * @param rect2 The second rectangle
153
+ * @returns Whether the two rectangles overlap
154
+ */
155
+ overlap(rect2: Rectangle): boolean;
156
+ scale_double(scale: number, rounding_strategy: RoundingStrategy | null, dest: Rectangle): void;
157
+ to_graphene_rect(): Graphene.Rect;
158
+ /**
159
+ * This function transforms the values in `rect` in order to compensate for
160
+ * `transform` applied to a #MetaMonitor, making them match the viewport. Note
161
+ * that compensating implies that for a clockwise rotation of the #MetaMonitor
162
+ * an anti-clockwise rotation has to be applied to `rect`.
163
+ * @param transform the #MtkMonitorTransform
164
+ * @param width the width of the target space
165
+ * @param height the height of the target space
166
+ * @param dest the transformed #MtkRectangle
167
+ */
168
+ transform(transform: MonitorTransform | null, width: number, height: number, dest: Rectangle): void;
169
+ /**
170
+ * Computes the union of the two rectangles
171
+ * @param rect2 another #MtkRectangle
172
+ */
173
+ union(rect2: Rectangle): Rectangle;
174
+ /**
175
+ * Similar to [method`Rectangle`.overlap] but ignores the horizontal location.
176
+ * @param rect2 The second rectangle
177
+ * @returns Whether the two rectangles overlap vertically
178
+ */
179
+ vert_overlap(rect2: Rectangle): boolean;
180
+ }
181
+
182
+ abstract class Region {
183
+ static $gtype: GObject.GType<Region>;
184
+
185
+ // Constructors
186
+
187
+ _init(...args: any[]): void;
188
+
189
+ // Static methods
190
+
191
+ static create(): Region;
192
+ static create_rectangle(rect: Rectangle): Region;
193
+ static create_rectangles(rects: Rectangle, n_rects: number): Region;
194
+
195
+ // Methods
196
+
197
+ apply_matrix_transform_expand(transform: Graphene.Matrix): Region;
198
+ contains_point(x: number, y: number): boolean;
199
+ contains_rectangle(rect: Rectangle): RegionOverlap;
200
+ copy(): Region;
201
+ crop_and_scale(src_rect: Graphene.Rect, dst_width: number, dst_height: number): Region;
202
+ equal(other: Region): boolean;
203
+ get_box(nth: number, x1: number, y1: number, x2: number, y2: number): void;
204
+ get_extents(): Rectangle;
205
+ get_rectangle(nth: number): Rectangle;
206
+ intersect(other: Region): void;
207
+ intersect_rectangle(rect: Rectangle): void;
208
+ is_empty(): boolean;
209
+ num_rectangles(): number;
210
+ /**
211
+ * Increases the reference count
212
+ * @returns The region
213
+ */
214
+ ref(): Region;
215
+ scale(scale: number): Region;
216
+ subtract(other: Region): void;
217
+ subtract_rectangle(rect: Rectangle): void;
218
+ translate(dx: number, dy: number): void;
219
+ union(other: Region): void;
220
+ union_rectangle(rect: Rectangle): void;
221
+ unref(): void;
222
+ }
223
+
224
+ class RegionBuilder {
225
+ static $gtype: GObject.GType<RegionBuilder>;
226
+
227
+ // Fields
228
+
229
+ n_levels: number;
230
+
231
+ // Constructors
232
+
233
+ _init(...args: any[]): void;
234
+
235
+ // Methods
236
+
237
+ add_rectangle(x: number, y: number, width: number, height: number): void;
238
+ finish(): Region;
239
+ init(): void;
240
+ }
241
+
242
+ /**
243
+ * MtkRegion is a yx banded region; sometimes its useful to iterate through
244
+ * such a region treating the start and end of each horizontal band in a distinct
245
+ * fashion.
246
+ *
247
+ * Usage:
248
+ *
249
+ * ```c
250
+ * MtkRegionIterator iter;
251
+ * for (mtk_region_iterator_init (&iter, region);
252
+ * !mtk_region_iterator_at_end (&iter);
253
+ * mtk_region_iterator_next (&iter))
254
+ * {
255
+ * [ Use iter.rectangle, iter.line_start, iter.line_end ]
256
+ * }
257
+ * ```
258
+ */
259
+ class RegionIterator {
260
+ static $gtype: GObject.GType<RegionIterator>;
261
+
262
+ // Fields
263
+
264
+ rectangle: Rectangle;
265
+ line_start: boolean;
266
+ line_end: boolean;
267
+ i: number;
268
+
269
+ // Constructors
270
+
271
+ _init(...args: any[]): void;
272
+
273
+ // Methods
274
+
275
+ at_end(): boolean;
276
+ init(region: Region): void;
277
+ next(): void;
278
+ }
279
+
280
+ /**
281
+ * Name of the imported GIR library
282
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
283
+ */
284
+ const __name__: string;
285
+ /**
286
+ * Version of the imported GIR library
287
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
288
+ */
289
+ const __version__: string;
290
+ }
291
+
292
+ export default Mtk;
293
+
294
+ // END
package/mtk-16.js ADDED
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import Mtk from 'gi://Mtk?version=16';
4
+ export default Mtk;
5
+
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@girs/mtk-16",
3
+ "version": "16.0.0-4.0.0-beta.21",
4
+ "description": "GJS TypeScript type definitions for Mtk-16, generated from library version 16.0.0",
5
+ "type": "module",
6
+ "module": "mtk-16.js",
7
+ "main": "mtk-16.js",
8
+ "exports": {
9
+ "./ambient": {
10
+ "types": "./mtk-16-ambient.d.ts",
11
+ "import": "./mtk-16-ambient.js",
12
+ "default": "./mtk-16-ambient.js"
13
+ },
14
+ "./import": {
15
+ "types": "./mtk-16-import.d.ts",
16
+ "import": "./mtk-16-import.js",
17
+ "default": "./mtk-16-import.js"
18
+ },
19
+ "./mtk-16": {
20
+ "types": "./mtk-16.d.ts",
21
+ "import": "./mtk-16.js",
22
+ "default": "./mtk-16.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.21",
35
+ "@girs/glib-2.0": "^2.83.3-4.0.0-beta.21",
36
+ "@girs/gobject-2.0": "^2.83.3-4.0.0-beta.21",
37
+ "@girs/graphene-1.0": "^1.0.0-4.0.0-beta.21"
38
+ },
39
+ "devDependencies": {
40
+ "typescript": "*"
41
+ },
42
+ "keywords": [
43
+ "Gir",
44
+ "TypeScript",
45
+ "types",
46
+ "GObject-Introspection",
47
+ "GJS",
48
+ "Mtk-16"
49
+ ],
50
+ "author": "ts-for-gir",
51
+ "license": "MIT",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/gjsify/ts-for-gir.git"
55
+ },
56
+ "bugs": {
57
+ "url": "https://github.com/gjsify/ts-for-gir/issues"
58
+ },
59
+ "homepage": "https://github.com/gjsify/types/tree/main/mtk-16#readme"
60
+ }
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": ["./mtk-16.d.ts"]
23
+ }
24
+
25
+
package/typedoc.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "entryPoints": ["./mtk-16.d.ts"],
3
+ "readme": "./README.md",
4
+ "name": "Mtk-16",
5
+ "tsconfig": "./tsconfig.json"
6
+ }
7
+