@girs/mtk-18 18.0.0-4.0.0-beta.41

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