@girs/mtk-15 15.0.0-4.0.0-beta.7
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 +86 -0
- package/index.d.ts +15 -0
- package/index.js +5 -0
- package/mtk-15-ambient.d.ts +9 -0
- package/mtk-15-ambient.js +2 -0
- package/mtk-15-import.d.ts +9 -0
- package/mtk-15-import.js +3 -0
- package/mtk-15.d.ts +229 -0
- package/mtk-15.js +5 -0
- package/package.json +60 -0
- package/tsconfig.json +23 -0
- package/typedoc.json +7 -0
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
|
|
2
|
+
# Mtk-15
|
|
3
|
+
|
|
4
|
+

|
|
5
|
+

|
|
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.0-beta.7.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
To use this type definitions, install them with NPM:
|
|
14
|
+
```bash
|
|
15
|
+
npm install @girs/mtk-15
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
You can import this package into your project like this:
|
|
21
|
+
```ts
|
|
22
|
+
import Mtk from '@girs/mtk-15';
|
|
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-15` or `@girs/mtk-15/ambient` in your `tsconfig` or entry point Typescript file:
|
|
29
|
+
|
|
30
|
+
`index.ts`:
|
|
31
|
+
```ts
|
|
32
|
+
import '@girs/mtk-15'
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`tsconfig.json`:
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"compilerOptions": {
|
|
39
|
+
...
|
|
40
|
+
},
|
|
41
|
+
"include": ["@girs/mtk-15"],
|
|
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=15';
|
|
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-15` or `@girs/mtk-15/import` in your `tsconfig` or entry point Typescript file:
|
|
56
|
+
|
|
57
|
+
`index.ts`:
|
|
58
|
+
```ts
|
|
59
|
+
import '@girs/mtk-15'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`tsconfig.json`:
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"compilerOptions": {
|
|
66
|
+
...
|
|
67
|
+
},
|
|
68
|
+
"include": ["@girs/mtk-15"],
|
|
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-15-ambient.d.ts';
|
|
11
|
+
|
|
12
|
+
import './mtk-15-import.d.ts';
|
|
13
|
+
|
|
14
|
+
import Mtk from './mtk-15.js';
|
|
15
|
+
export default Mtk;
|
package/index.js
ADDED
package/mtk-15-import.js
ADDED
package/mtk-15.d.ts
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
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-15
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
enum RegionOverlap {
|
|
21
|
+
OUT,
|
|
22
|
+
IN,
|
|
23
|
+
PART,
|
|
24
|
+
}
|
|
25
|
+
enum RoundingStrategy {
|
|
26
|
+
SHRINK,
|
|
27
|
+
GROW,
|
|
28
|
+
ROUND,
|
|
29
|
+
}
|
|
30
|
+
const RECTANGLE_MAX_STACK_RECTS: number;
|
|
31
|
+
const REGION_BUILDER_MAX_LEVELS: number;
|
|
32
|
+
function rectangle_from_graphene_rect(rect: Graphene.Rect, rounding_strategy: RoundingStrategy): Rectangle;
|
|
33
|
+
function region_create(): Region;
|
|
34
|
+
function region_create_rectangle(rect: Rectangle): Region;
|
|
35
|
+
function region_create_rectangles(rects: Rectangle, n_rects: number): Region;
|
|
36
|
+
function x11_errors_deinit(): void;
|
|
37
|
+
class Rectangle {
|
|
38
|
+
static $gtype: GObject.GType<Rectangle>;
|
|
39
|
+
|
|
40
|
+
// Own fields of Mtk.Rectangle
|
|
41
|
+
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
|
|
47
|
+
// Constructors of Mtk.Rectangle
|
|
48
|
+
|
|
49
|
+
constructor(
|
|
50
|
+
properties?: Partial<{
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
}>,
|
|
56
|
+
);
|
|
57
|
+
_init(...args: any[]): void;
|
|
58
|
+
|
|
59
|
+
static ['new'](x: number, y: number, width: number, height: number): Rectangle;
|
|
60
|
+
|
|
61
|
+
static new_empty(): Rectangle;
|
|
62
|
+
|
|
63
|
+
// Own static methods of Mtk.Rectangle
|
|
64
|
+
|
|
65
|
+
static from_graphene_rect(rect: Graphene.Rect, rounding_strategy: RoundingStrategy): Rectangle;
|
|
66
|
+
|
|
67
|
+
// Own methods of Mtk.Rectangle
|
|
68
|
+
|
|
69
|
+
area(): number;
|
|
70
|
+
contains_point(x: number, y: number): boolean;
|
|
71
|
+
contains_pointf(x: number, y: number): boolean;
|
|
72
|
+
contains_rect(inner_rect: Rectangle): boolean;
|
|
73
|
+
copy(): Rectangle;
|
|
74
|
+
could_fit_rect(inner_rect: Rectangle): boolean;
|
|
75
|
+
crop_and_scale(src_rect: Graphene.Rect, dst_width: number, dst_height: number, dest: Rectangle): void;
|
|
76
|
+
/**
|
|
77
|
+
* Compares the two rectangles
|
|
78
|
+
* @param src2 The second rectangle
|
|
79
|
+
* @returns Whether the two rectangles are equal
|
|
80
|
+
*/
|
|
81
|
+
equal(src2: Rectangle): boolean;
|
|
82
|
+
free(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Similar to [method`Rectangle`.overlap] but ignores the vertical location.
|
|
85
|
+
* @param rect2 The second rectangle
|
|
86
|
+
* @returns Whether the two rectangles overlap horizontally
|
|
87
|
+
*/
|
|
88
|
+
horiz_overlap(rect2: Rectangle): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Find the intersection between the two rectangles
|
|
91
|
+
* @param src2 another #MtkRectangle
|
|
92
|
+
* @returns TRUE is some intersection exists and is not degenerate, FALSE otherwise.
|
|
93
|
+
*/
|
|
94
|
+
intersect(src2: Rectangle): [boolean, Rectangle];
|
|
95
|
+
is_adjacent_to(other: Rectangle): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Similar to [method`Rectangle`.intersect] but doesn't provide
|
|
98
|
+
* the location of the intersection.
|
|
99
|
+
* @param rect2 The second rectangle
|
|
100
|
+
* @returns Whether the two rectangles overlap
|
|
101
|
+
*/
|
|
102
|
+
overlap(rect2: Rectangle): boolean;
|
|
103
|
+
scale_double(scale: number, rounding_strategy: RoundingStrategy, dest: Rectangle): void;
|
|
104
|
+
to_graphene_rect(): Graphene.Rect;
|
|
105
|
+
/**
|
|
106
|
+
* Computes the union of the two rectangles
|
|
107
|
+
* @param rect2 another #MtkRectangle
|
|
108
|
+
*/
|
|
109
|
+
union(rect2: Rectangle): Rectangle;
|
|
110
|
+
/**
|
|
111
|
+
* Similar to [method`Rectangle`.overlap] but ignores the horizontal location.
|
|
112
|
+
* @param rect2 The second rectangle
|
|
113
|
+
* @returns Whether the two rectangles overlap vertically
|
|
114
|
+
*/
|
|
115
|
+
vert_overlap(rect2: Rectangle): boolean;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
abstract class Region {
|
|
119
|
+
static $gtype: GObject.GType<Region>;
|
|
120
|
+
|
|
121
|
+
// Constructors of Mtk.Region
|
|
122
|
+
|
|
123
|
+
_init(...args: any[]): void;
|
|
124
|
+
|
|
125
|
+
// Own static methods of Mtk.Region
|
|
126
|
+
|
|
127
|
+
static create(): Region;
|
|
128
|
+
static create_rectangle(rect: Rectangle): Region;
|
|
129
|
+
static create_rectangles(rects: Rectangle, n_rects: number): Region;
|
|
130
|
+
|
|
131
|
+
// Own methods of Mtk.Region
|
|
132
|
+
|
|
133
|
+
apply_matrix_transform_expand(transform: Graphene.Matrix): Region;
|
|
134
|
+
contains_point(x: number, y: number): boolean;
|
|
135
|
+
contains_rectangle(rect: Rectangle): RegionOverlap;
|
|
136
|
+
copy(): Region;
|
|
137
|
+
crop_and_scale(src_rect: Graphene.Rect, dst_width: number, dst_height: number): Region;
|
|
138
|
+
equal(other: Region): boolean;
|
|
139
|
+
get_extents(): Rectangle;
|
|
140
|
+
get_rectangle(nth: number): Rectangle;
|
|
141
|
+
intersect(other: Region): void;
|
|
142
|
+
intersect_rectangle(rect: Rectangle): void;
|
|
143
|
+
is_empty(): boolean;
|
|
144
|
+
num_rectangles(): number;
|
|
145
|
+
/**
|
|
146
|
+
* Increases the reference count
|
|
147
|
+
* @returns The region
|
|
148
|
+
*/
|
|
149
|
+
ref(): Region;
|
|
150
|
+
scale(scale: number): Region;
|
|
151
|
+
subtract(other: Region): void;
|
|
152
|
+
subtract_rectangle(rect: Rectangle): void;
|
|
153
|
+
translate(dx: number, dy: number): void;
|
|
154
|
+
union(other: Region): void;
|
|
155
|
+
union_rectangle(rect: Rectangle): void;
|
|
156
|
+
unref(): void;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
class RegionBuilder {
|
|
160
|
+
static $gtype: GObject.GType<RegionBuilder>;
|
|
161
|
+
|
|
162
|
+
// Own fields of Mtk.RegionBuilder
|
|
163
|
+
|
|
164
|
+
n_levels: number;
|
|
165
|
+
|
|
166
|
+
// Constructors of Mtk.RegionBuilder
|
|
167
|
+
|
|
168
|
+
_init(...args: any[]): void;
|
|
169
|
+
|
|
170
|
+
// Own methods of Mtk.RegionBuilder
|
|
171
|
+
|
|
172
|
+
add_rectangle(x: number, y: number, width: number, height: number): void;
|
|
173
|
+
finish(): Region;
|
|
174
|
+
init(): void;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* MtkRegion is a yx banded region; sometimes its useful to iterate through
|
|
179
|
+
* such a region treating the start and end of each horizontal band in a distinct
|
|
180
|
+
* fashion.
|
|
181
|
+
*
|
|
182
|
+
* Usage:
|
|
183
|
+
*
|
|
184
|
+
* ```c
|
|
185
|
+
* MtkRegionIterator iter;
|
|
186
|
+
* for (mtk_region_iterator_init (&iter, region);
|
|
187
|
+
* !mtk_region_iterator_at_end (&iter);
|
|
188
|
+
* mtk_region_iterator_next (&iter))
|
|
189
|
+
* {
|
|
190
|
+
* [ Use iter.rectangle, iter.line_start, iter.line_end ]
|
|
191
|
+
* }
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
class RegionIterator {
|
|
195
|
+
static $gtype: GObject.GType<RegionIterator>;
|
|
196
|
+
|
|
197
|
+
// Own fields of Mtk.RegionIterator
|
|
198
|
+
|
|
199
|
+
rectangle: Rectangle;
|
|
200
|
+
line_start: boolean;
|
|
201
|
+
line_end: boolean;
|
|
202
|
+
i: number;
|
|
203
|
+
|
|
204
|
+
// Constructors of Mtk.RegionIterator
|
|
205
|
+
|
|
206
|
+
_init(...args: any[]): void;
|
|
207
|
+
|
|
208
|
+
// Own methods of Mtk.RegionIterator
|
|
209
|
+
|
|
210
|
+
at_end(): boolean;
|
|
211
|
+
init(region: Region): void;
|
|
212
|
+
next(): void;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Name of the imported GIR library
|
|
217
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
218
|
+
*/
|
|
219
|
+
const __name__: string;
|
|
220
|
+
/**
|
|
221
|
+
* Version of the imported GIR library
|
|
222
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
223
|
+
*/
|
|
224
|
+
const __version__: string;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export default Mtk;
|
|
228
|
+
|
|
229
|
+
// END
|
package/mtk-15.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@girs/mtk-15",
|
|
3
|
+
"version": "15.0.0-4.0.0-beta.7",
|
|
4
|
+
"description": "GJS TypeScript type definitions for Mtk-15, generated from library version 15.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "mtk-15.js",
|
|
7
|
+
"main": "mtk-15.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./ambient": {
|
|
10
|
+
"types": "./mtk-15-ambient.d.ts",
|
|
11
|
+
"import": "./mtk-15-ambient.js",
|
|
12
|
+
"default": "./mtk-15-ambient.js"
|
|
13
|
+
},
|
|
14
|
+
"./import": {
|
|
15
|
+
"types": "./mtk-15-import.d.ts",
|
|
16
|
+
"import": "./mtk-15-import.js",
|
|
17
|
+
"default": "./mtk-15-import.js"
|
|
18
|
+
},
|
|
19
|
+
"./mtk-15": {
|
|
20
|
+
"types": "./mtk-15.d.ts",
|
|
21
|
+
"import": "./mtk-15.js",
|
|
22
|
+
"default": "./mtk-15.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.7",
|
|
35
|
+
"@girs/glib-2.0": "^2.80.2-4.0.0-beta.7",
|
|
36
|
+
"@girs/gobject-2.0": "^2.80.2-4.0.0-beta.7",
|
|
37
|
+
"@girs/graphene-1.0": "^1.0.0-4.0.0-beta.7"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"typescript": "*"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"Gir",
|
|
44
|
+
"TypeScript",
|
|
45
|
+
"types",
|
|
46
|
+
"GObject-Introspection",
|
|
47
|
+
"GJS",
|
|
48
|
+
"Mtk-15"
|
|
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-15#readme"
|
|
60
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
},
|
|
20
|
+
"include": ["./mtk-15.d.ts"]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|