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