@girs/mtk-15 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-15
3
+
4
+ ![version](https://img.shields.io/npm/v/@girs/mtk-15)
5
+ ![downloads/week](https://img.shields.io/npm/dw/@girs/mtk-15)
6
+
7
+
8
+ GJS TypeScript type definitions for Mtk-15, generated from library version 15.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-15
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ You can import this package into your project like this:
20
+ ```ts
21
+ import Mtk from '@girs/mtk-15';
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-15` or `@girs/mtk-15/ambient` in your `tsconfig` or entry point Typescript file:
28
+
29
+ `index.ts`:
30
+ ```ts
31
+ import '@girs/mtk-15'
32
+ ```
33
+
34
+ `tsconfig.json`:
35
+ ```json
36
+ {
37
+ "compilerOptions": {
38
+ ...
39
+ },
40
+ "include": ["@girs/mtk-15"],
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=15';
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-15` or `@girs/mtk-15/import` in your `tsconfig` or entry point Typescript file:
55
+
56
+ `index.ts`:
57
+ ```ts
58
+ import '@girs/mtk-15'
59
+ ```
60
+
61
+ `tsconfig.json`:
62
+ ```json
63
+ {
64
+ "compilerOptions": {
65
+ ...
66
+ },
67
+ "include": ["@girs/mtk-15"],
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-15-ambient.d.ts';
11
+
12
+
13
+ import Mtk from './mtk-15.js';
14
+ export default Mtk;
15
+
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import Mtk from './mtk-15.js';
4
+ export default Mtk;
5
+
@@ -0,0 +1,12 @@
1
+
2
+ declare module 'gi://Mtk?version=15' {
3
+ import Mtk15 from '@girs/mtk-15';
4
+ export default Mtk15;
5
+ }
6
+
7
+ declare module 'gi://Mtk' {
8
+ import Mtk15 from 'gi://Mtk?version=15';
9
+ export default Mtk15;
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-15.d.ts ADDED
@@ -0,0 +1,474 @@
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 Graphene from '@girs/graphene-1.0';
15
+ import type GObject from '@girs/gobject-2.0';
16
+ import type GLib from '@girs/glib-2.0';
17
+
18
+ export namespace Mtk {
19
+
20
+ /**
21
+ * Mtk-15
22
+ */
23
+
24
+
25
+ /**
26
+ * @gir-type Struct
27
+ */
28
+ class MonitorTransform {
29
+ static $gtype: GObject.GType<MonitorTransform>;
30
+
31
+ // Static fields
32
+ static NORMAL: number;
33
+
34
+ static "90": number;
35
+
36
+ static "180": number;
37
+
38
+ static "270": number;
39
+
40
+ static FLIPPED: number;
41
+
42
+ static FLIPPED_90: number;
43
+
44
+ static FLIPPED_180: number;
45
+
46
+ static FLIPPED_270: number;
47
+ }
48
+
49
+
50
+ /**
51
+ * @gir-type Enum
52
+ */
53
+ enum RegionOverlap {
54
+ OUT,
55
+ IN,
56
+ PART,
57
+ }
58
+
59
+
60
+ /**
61
+ * @gir-type Enum
62
+ */
63
+ enum RoundingStrategy {
64
+ SHRINK,
65
+ GROW,
66
+ ROUND,
67
+ }
68
+
69
+
70
+ const MONITOR_ALL_TRANSFORMS: number;
71
+
72
+ const MONITOR_N_TRANSFORMS: number;
73
+
74
+ const RECTANGLE_MAX_STACK_RECTS: number;
75
+
76
+ const REGION_BUILDER_MAX_LEVELS: number;
77
+
78
+ /**
79
+ * @param transform
80
+ */
81
+ function monitor_transform_invert(transform: MonitorTransform): MonitorTransform;
82
+
83
+ /**
84
+ * @param transform
85
+ * @param other
86
+ */
87
+ function monitor_transform_transform(transform: MonitorTransform, other: MonitorTransform): MonitorTransform;
88
+
89
+ /**
90
+ * @param transform
91
+ * @param matrix
92
+ */
93
+ function monitor_transform_transform_matrix(transform: MonitorTransform, matrix: Graphene.Matrix): void;
94
+
95
+ /**
96
+ * @param transform
97
+ * @param area_width
98
+ * @param area_height
99
+ * @param point_x
100
+ * @param point_y
101
+ */
102
+ function monitor_transform_transform_point(transform: MonitorTransform, area_width: number, area_height: number, point_x: number, point_y: number): void;
103
+
104
+ /**
105
+ * @param rect A rectangle
106
+ * @param rounding_strategy The rounding strategy
107
+ */
108
+ function rectangle_from_graphene_rect(rect: Graphene.Rect, rounding_strategy: RoundingStrategy): Rectangle;
109
+
110
+ function region_create(): Region;
111
+
112
+ /**
113
+ * @param rect
114
+ */
115
+ function region_create_rectangle(rect: Rectangle): Region;
116
+
117
+ /**
118
+ * @param rects
119
+ * @param n_rects
120
+ */
121
+ function region_create_rectangles(rects: Rectangle, n_rects: number): Region;
122
+
123
+ function x11_errors_deinit(): void;
124
+
125
+ /**
126
+ * @gir-type Struct
127
+ */
128
+ class Rectangle {
129
+ static $gtype: GObject.GType<Rectangle>;
130
+
131
+ // Fields
132
+ x: number;
133
+
134
+ y: number;
135
+
136
+ width: number;
137
+
138
+ height: number;
139
+
140
+ // Constructors
141
+
142
+ constructor(properties?: Partial<{
143
+ x: number;
144
+ y: number;
145
+ width: number;
146
+ height: number;
147
+ }>);
148
+
149
+ static ["new"](x: number, y: number, width: number, height: number): Rectangle;
150
+
151
+ static new_empty(): Rectangle;
152
+
153
+ // Static methods
154
+ /**
155
+ * @param rect A rectangle
156
+ * @param rounding_strategy The rounding strategy
157
+ */
158
+ static from_graphene_rect(rect: Graphene.Rect, rounding_strategy: RoundingStrategy): Rectangle;
159
+
160
+ // Methods
161
+ /**
162
+ * @returns The area of the rectangle
163
+ */
164
+ area(): number;
165
+
166
+ /**
167
+ * @param x X coordinate of the point
168
+ * @param y Y coordinate of the point
169
+ * @returns Whether the rectangle contains the point
170
+ */
171
+ contains_point(x: number, y: number): boolean;
172
+
173
+ /**
174
+ * @param x X coordinate of the point
175
+ * @param y Y coordinate of the point
176
+ * @returns Whether the rectangle contains the point
177
+ */
178
+ contains_pointf(x: number, y: number): boolean;
179
+
180
+ /**
181
+ * @param inner_rect The inner rectangle
182
+ * @returns Whether the outer rectangle contains the inner one
183
+ */
184
+ contains_rect(inner_rect: Rectangle): boolean;
185
+
186
+ copy(): Rectangle;
187
+
188
+ /**
189
+ * @param inner_rect The inner rectangle
190
+ * @returns Whether the inner rectangle could fit inside the outer one
191
+ */
192
+ could_fit_rect(inner_rect: Rectangle): boolean;
193
+
194
+ /**
195
+ * @param src_rect
196
+ * @param dst_width
197
+ * @param dst_height
198
+ * @param dest
199
+ */
200
+ crop_and_scale(src_rect: Graphene.Rect, dst_width: number, dst_height: number, dest: Rectangle): void;
201
+
202
+ /**
203
+ * Compares the two rectangles
204
+ * @param src2 The second rectangle
205
+ * @returns Whether the two rectangles are equal
206
+ */
207
+ equal(src2: Rectangle): boolean;
208
+
209
+ free(): void;
210
+
211
+ /**
212
+ * Similar to {@link Rectangle.overlap} but ignores the vertical location.
213
+ * @param rect2 The second rectangle
214
+ * @returns Whether the two rectangles overlap horizontally
215
+ */
216
+ horiz_overlap(rect2: Rectangle): boolean;
217
+
218
+ /**
219
+ * Find the intersection between the two rectangles
220
+ * @param src2 another {@link Mtk.Rectangle}
221
+ * @returns TRUE is some intersection exists and is not degenerate, FALSE otherwise.
222
+ */
223
+ intersect(src2: Rectangle): [boolean, Rectangle];
224
+
225
+ /**
226
+ * @param other
227
+ */
228
+ is_adjacent_to(other: Rectangle): boolean;
229
+
230
+ /**
231
+ * Similar to {@link Rectangle.intersect} but doesn't provide
232
+ * the location of the intersection.
233
+ * @param rect2 The second rectangle
234
+ * @returns Whether the two rectangles overlap
235
+ */
236
+ overlap(rect2: Rectangle): boolean;
237
+
238
+ /**
239
+ * @param scale
240
+ * @param rounding_strategy
241
+ * @param dest
242
+ */
243
+ scale_double(scale: number, rounding_strategy: RoundingStrategy, dest: Rectangle): void;
244
+
245
+ /**
246
+ * @returns Return a graphene_rect_t created from `rect`
247
+ */
248
+ to_graphene_rect(): Graphene.Rect;
249
+
250
+ /**
251
+ * This function transforms the values in `rect` in order to compensate for
252
+ * `transform` applied to a `MetaMonitor`, making them match the viewport. Note
253
+ * that compensating implies that for a clockwise rotation of the `MetaMonitor`
254
+ * an anti-clockwise rotation has to be applied to `rect`.
255
+ * @param transform the {@link Mtk.MonitorTransform}
256
+ * @param width the width of the target space
257
+ * @param height the height of the target space
258
+ * @param dest the transformed {@link Mtk.Rectangle}
259
+ */
260
+ transform(transform: MonitorTransform, width: number, height: number, dest: Rectangle): void;
261
+
262
+ /**
263
+ * Computes the union of the two rectangles
264
+ * @param rect2 another {@link Mtk.Rectangle}
265
+ */
266
+ union(rect2: Rectangle): Rectangle;
267
+
268
+ /**
269
+ * Similar to {@link Rectangle.overlap} but ignores the horizontal location.
270
+ * @param rect2 The second rectangle
271
+ * @returns Whether the two rectangles overlap vertically
272
+ */
273
+ vert_overlap(rect2: Rectangle): boolean;
274
+ }
275
+
276
+
277
+ /**
278
+ * @gir-type Struct
279
+ */
280
+ abstract class Region {
281
+ static $gtype: GObject.GType<Region>;
282
+
283
+ // Static methods
284
+ static create(): Region;
285
+
286
+ /**
287
+ * @param rect
288
+ */
289
+ static create_rectangle(rect: Rectangle): Region;
290
+
291
+ /**
292
+ * @param rects
293
+ * @param n_rects
294
+ */
295
+ static create_rectangles(rects: Rectangle, n_rects: number): Region;
296
+
297
+ // Methods
298
+ /**
299
+ * @param transform
300
+ */
301
+ apply_matrix_transform_expand(transform: Graphene.Matrix): Region;
302
+
303
+ /**
304
+ * @param x
305
+ * @param y
306
+ */
307
+ contains_point(x: number, y: number): boolean;
308
+
309
+ /**
310
+ * @param rect
311
+ */
312
+ contains_rectangle(rect: Rectangle): RegionOverlap;
313
+
314
+ /**
315
+ * @returns A copy of the passed region
316
+ */
317
+ copy(): Region;
318
+
319
+ /**
320
+ * @param src_rect
321
+ * @param dst_width
322
+ * @param dst_height
323
+ */
324
+ crop_and_scale(src_rect: Graphene.Rect, dst_width: number, dst_height: number): Region;
325
+
326
+ /**
327
+ * @param other
328
+ */
329
+ equal(other: Region): boolean;
330
+
331
+ get_extents(): Rectangle;
332
+
333
+ /**
334
+ * @param nth
335
+ */
336
+ get_rectangle(nth: number): Rectangle;
337
+
338
+ /**
339
+ * @param other
340
+ */
341
+ intersect(other: Region): void;
342
+
343
+ /**
344
+ * @param rect
345
+ */
346
+ intersect_rectangle(rect: Rectangle): void;
347
+
348
+ is_empty(): boolean;
349
+
350
+ num_rectangles(): number;
351
+
352
+ /**
353
+ * Increases the reference count
354
+ * @returns The region
355
+ */
356
+ ref(): Region;
357
+
358
+ /**
359
+ * @param scale
360
+ */
361
+ scale(scale: number): Region;
362
+
363
+ /**
364
+ * @param other
365
+ */
366
+ subtract(other: Region): void;
367
+
368
+ /**
369
+ * @param rect
370
+ */
371
+ subtract_rectangle(rect: Rectangle): void;
372
+
373
+ /**
374
+ * @param dx
375
+ * @param dy
376
+ */
377
+ translate(dx: number, dy: number): void;
378
+
379
+ /**
380
+ * @param other
381
+ */
382
+ union(other: Region): void;
383
+
384
+ /**
385
+ * @param rect
386
+ */
387
+ union_rectangle(rect: Rectangle): void;
388
+
389
+ unref(): void;
390
+ }
391
+
392
+
393
+ /**
394
+ * @gir-type Struct
395
+ */
396
+ class RegionBuilder {
397
+ static $gtype: GObject.GType<RegionBuilder>;
398
+
399
+ // Fields
400
+ n_levels: number;
401
+
402
+ // Methods
403
+ /**
404
+ * @param x
405
+ * @param y
406
+ * @param width
407
+ * @param height
408
+ */
409
+ add_rectangle(x: number, y: number, width: number, height: number): void;
410
+
411
+ finish(): Region;
412
+
413
+ init(): void;
414
+ }
415
+
416
+
417
+ /**
418
+ * MtkRegion is a yx banded region; sometimes its useful to iterate through
419
+ * such a region treating the start and end of each horizontal band in a distinct
420
+ * fashion.
421
+ *
422
+ * Usage:
423
+ *
424
+ * ```c
425
+ * MtkRegionIterator iter;
426
+ * for (mtk_region_iterator_init (&iter, region);
427
+ * !mtk_region_iterator_at_end (&iter);
428
+ * mtk_region_iterator_next (&iter))
429
+ * {
430
+ * [ Use iter.rectangle, iter.line_start, iter.line_end ]
431
+ * }
432
+ * ```
433
+ * @gir-type Struct
434
+ */
435
+ class RegionIterator {
436
+ static $gtype: GObject.GType<RegionIterator>;
437
+
438
+ // Fields
439
+ rectangle: Rectangle;
440
+
441
+ line_start: boolean;
442
+
443
+ line_end: boolean;
444
+
445
+ i: number;
446
+
447
+ // Methods
448
+ at_end(): boolean;
449
+
450
+ /**
451
+ * @param region
452
+ */
453
+ init(region: Region): void;
454
+
455
+ next(): void;
456
+ }
457
+
458
+
459
+ /**
460
+ * Name of the imported GIR library
461
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
462
+ */
463
+ const __name__: string;
464
+
465
+ /**
466
+ * Version of the imported GIR library
467
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
468
+ */
469
+ const __version__: string;
470
+ }
471
+
472
+ export default Mtk;
473
+
474
+ // END
package/mtk-15.js ADDED
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import Mtk from 'gi://Mtk?version=15';
4
+ export default Mtk;
5
+
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@girs/mtk-15",
3
+ "version": "4.0.4",
4
+ "libraryVersion": "15.0.0",
5
+ "description": "GJS TypeScript type definitions for Mtk-15, generated from library version 15.0.0",
6
+ "type": "module",
7
+ "module": "mtk-15.js",
8
+ "main": "mtk-15.js",
9
+ "exports": {
10
+ "./ambient": {
11
+ "types": "./mtk-15-ambient.d.ts",
12
+ "import": "./mtk-15-ambient.js",
13
+ "default": "./mtk-15-ambient.js"
14
+ },
15
+ "./import": {
16
+ "types": "./mtk-15-import.d.ts",
17
+ "import": "./mtk-15-import.js",
18
+ "default": "./mtk-15-import.js"
19
+ },
20
+ "./mtk-15": {
21
+ "types": "./mtk-15.d.ts",
22
+ "import": "./mtk-15.js",
23
+ "default": "./mtk-15.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/graphene-1.0": "^4.0.4",
37
+ "@girs/gobject-2.0": "^4.0.4",
38
+ "@girs/glib-2.0": "^4.0.4" },
39
+ "devDependencies": {
40
+ "typescript": "*"
41
+ },
42
+ "keywords": ["Gir", "TypeScript", "types", "GObject-Introspection", "GJS", "Mtk-15"],
43
+ "author": "ts-for-gir",
44
+ "license": "MIT",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/gjsify/types.git"
48
+ },
49
+ "bugs": {
50
+ "url": "https://github.com/gjsify/ts-for-gir/issues"
51
+ },
52
+ "homepage": "https://github.com/gjsify/types/tree/main/mtk-15#readme"
53
+ }
54
+
55
+
package/tsconfig.json ADDED
@@ -0,0 +1,38 @@
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/graphene-1.0": [
22
+ "../graphene-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/gjs": [
31
+ "../gjs/index.d.ts"
32
+ ]
33
+ }
34
+ },
35
+ "include": ["./mtk-15.d.ts"]
36
+ }
37
+
38
+
package/typedoc.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "entryPoints": ["./mtk-15.d.ts"],
3
+ "readme": "./README.md",
4
+ "name": "Mtk-15",
5
+ "tsconfig": "./tsconfig.json",
6
+ "skipErrorChecking": true,
7
+ "highlightLanguages": ["typescript", "javascript", "c", "cpp", "xml", "bash", "json", "css"]
8
+ }
9
+