@girs/sugargestures-1.0 1.0.0-4.0.0-beta.3

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
+ # SugarGestures-1.0
3
+
4
+ ![version](https://img.shields.io/npm/v/@girs/sugargestures-1.0)
5
+ ![downloads/week](https://img.shields.io/npm/dw/@girs/sugargestures-1.0)
6
+
7
+
8
+ GJS TypeScript type definitions for SugarGestures-1.0, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.3.
9
+
10
+
11
+ ## Install
12
+
13
+ To use this type definitions, install them with NPM:
14
+ ```bash
15
+ npm install @girs/sugargestures-1.0
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ You can import this package into your project like this:
21
+ ```ts
22
+ import SugarGestures from '@girs/sugargestures-1.0';
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/sugargestures-1.0` or `@girs/sugargestures-1.0/ambient` in your `tsconfig` or entry point Typescript file:
29
+
30
+ `index.ts`:
31
+ ```ts
32
+ import '@girs/sugargestures-1.0'
33
+ ```
34
+
35
+ `tsconfig.json`:
36
+ ```json
37
+ {
38
+ "compilerOptions": {
39
+ ...
40
+ },
41
+ "include": ["@girs/sugargestures-1.0"],
42
+ ...
43
+ }
44
+ ```
45
+
46
+ Now you can import the ambient module with TypeScript support:
47
+
48
+ ```ts
49
+ import SugarGestures from 'gi://SugarGestures?version=1.0';
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/sugargestures-1.0` or `@girs/sugargestures-1.0/import` in your `tsconfig` or entry point Typescript file:
56
+
57
+ `index.ts`:
58
+ ```ts
59
+ import '@girs/sugargestures-1.0'
60
+ ```
61
+
62
+ `tsconfig.json`:
63
+ ```json
64
+ {
65
+ "compilerOptions": {
66
+ ...
67
+ },
68
+ "include": ["@girs/sugargestures-1.0"],
69
+ ...
70
+ }
71
+ ```
72
+
73
+ Now you have also type support for this, too:
74
+
75
+ ```ts
76
+ const SugarGestures = imports.gi.SugarGestures;
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/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@girs/sugargestures-1.0",
3
+ "version": "1.0.0-4.0.0-beta.3",
4
+ "description": "GJS TypeScript type definitions for SugarGestures-1.0, generated from library version 1.0.0",
5
+ "type": "module",
6
+ "module": "sugargestures-1.0.js",
7
+ "main": "sugargestures-1.0.js",
8
+ "exports": {
9
+ "./ambient": {
10
+ "types": "./sugargestures-1.0-ambient.d.ts",
11
+ "import": "./sugargestures-1.0-ambient.js",
12
+ "default": "./sugargestures-1.0-ambient.js"
13
+ },
14
+ "./import": {
15
+ "types": "./sugargestures-1.0-import.d.ts",
16
+ "import": "./sugargestures-1.0-import.js",
17
+ "default": "./sugargestures-1.0-import.js"
18
+ },
19
+ ".": {
20
+ "types": "./sugargestures-1.0.d.ts",
21
+ "import": "./sugargestures-1.0.js",
22
+ "default": "./sugargestures-1.0.js"
23
+ }
24
+ },
25
+ "scripts": {
26
+ "test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit sugargestures-1.0.d.ts"
27
+ },
28
+ "dependencies": {
29
+ "@girs/atk-1.0": "^2.52.0-4.0.0-beta.3",
30
+ "@girs/cairo-1.0": "^1.0.0-4.0.0-beta.3",
31
+ "@girs/freetype2-2.0": "^2.0.0-4.0.0-beta.3",
32
+ "@girs/gdk-3.0": "^3.24.41-4.0.0-beta.3",
33
+ "@girs/gdkpixbuf-2.0": "^2.0.0-4.0.0-beta.3",
34
+ "@girs/gio-2.0": "^2.80.0-4.0.0-beta.3",
35
+ "@girs/gjs": "^4.0.0-beta.3",
36
+ "@girs/glib-2.0": "^2.80.0-4.0.0-beta.3",
37
+ "@girs/gmodule-2.0": "^2.0.0-4.0.0-beta.3",
38
+ "@girs/gobject-2.0": "^2.80.0-4.0.0-beta.3",
39
+ "@girs/gtk-3.0": "^3.24.41-4.0.0-beta.3",
40
+ "@girs/harfbuzz-0.0": "^8.3.1-4.0.0-beta.3",
41
+ "@girs/pango-1.0": "^1.51.0-4.0.0-beta.3",
42
+ "@girs/xlib-2.0": "^2.0.0-4.0.0-beta.3"
43
+ },
44
+ "devDependencies": {
45
+ "typescript": "*"
46
+ },
47
+ "keywords": [
48
+ "Gir",
49
+ "TypeScript",
50
+ "types",
51
+ "GObject-Introspection",
52
+ "GJS",
53
+ "SugarGestures-1.0"
54
+ ],
55
+ "author": "ts-for-gir",
56
+ "license": "MIT",
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "git+https://github.com/gjsify/ts-for-gir.git"
60
+ },
61
+ "bugs": {
62
+ "url": "https://github.com/gjsify/ts-for-gir/issues"
63
+ },
64
+ "homepage": "https://github.com/gjsify/types/tree/main/sugargestures-1.0#readme"
65
+ }
@@ -0,0 +1,12 @@
1
+
2
+ declare module 'gi://SugarGestures?version=1.0' {
3
+ import SugarGestures from '@girs/sugargestures-1.0';
4
+ export default SugarGestures;
5
+ }
6
+
7
+ declare module 'gi://SugarGestures' {
8
+ import SugarGestures10 from 'gi://SugarGestures?version=1.0';
9
+ export default SugarGestures10;
10
+ }
11
+
12
+
@@ -0,0 +1,2 @@
1
+ export {}
2
+
@@ -0,0 +1,12 @@
1
+
2
+ import SugarGestures10 from '@girs/sugargestures-1.0';
3
+
4
+ declare global {
5
+ export interface GjsGiImports {
6
+ SugarGestures: typeof SugarGestures10;
7
+ }
8
+ }
9
+
10
+ export default GjsGiImports;
11
+
12
+
@@ -0,0 +1,3 @@
1
+ const gi = globalThis.imports?.gi || {};
2
+ export default gi;
3
+
@@ -0,0 +1,390 @@
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
+
8
+ import './sugargestures-1.0-ambient.d.ts';
9
+
10
+ /**
11
+ * SugarGestures-1.0
12
+ */
13
+
14
+ import type Gtk from '@girs/gtk-3.0';
15
+ import type xlib from '@girs/xlib-2.0';
16
+ import type Gdk from '@girs/gdk-3.0';
17
+ import type cairo from '@girs/cairo-1.0';
18
+ import type GObject from '@girs/gobject-2.0';
19
+ import type GLib from '@girs/glib-2.0';
20
+ import type Pango from '@girs/pango-1.0';
21
+ import type HarfBuzz from '@girs/harfbuzz-0.0';
22
+ import type freetype2 from '@girs/freetype2-2.0';
23
+ import type Gio from '@girs/gio-2.0';
24
+ import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
25
+ import type GModule from '@girs/gmodule-2.0';
26
+ import type Atk from '@girs/atk-1.0';
27
+
28
+ export namespace SugarGestures {
29
+ enum EventControllerState {
30
+ NONE,
31
+ COLLECTING,
32
+ RECOGNIZED,
33
+ NOT_RECOGNIZED,
34
+ }
35
+ enum SwipeDirection {
36
+ LEFT,
37
+ RIGHT,
38
+ UP,
39
+ DOWN,
40
+ }
41
+ enum EventControllerFlags {
42
+ NONE,
43
+ EXCLUSIVE,
44
+ }
45
+ enum SwipeDirectionFlags {
46
+ LEFT,
47
+ RIGHT,
48
+ UP,
49
+ DOWN,
50
+ }
51
+ module EventController {
52
+ // Signal callback interfaces
53
+
54
+ interface Began {
55
+ (): void;
56
+ }
57
+
58
+ interface Ended {
59
+ (): void;
60
+ }
61
+
62
+ interface Updated {
63
+ (): void;
64
+ }
65
+
66
+ // Constructor properties interface
67
+
68
+ interface ConstructorProps extends GObject.Object.ConstructorProps {
69
+ state: EventControllerState;
70
+ widget: Gtk.Widget;
71
+ }
72
+ }
73
+
74
+ abstract class EventController extends GObject.Object {
75
+ static $gtype: GObject.GType<EventController>;
76
+
77
+ // Own properties of SugarGestures.EventController
78
+
79
+ get state(): EventControllerState;
80
+ get widget(): Gtk.Widget;
81
+ set widget(val: Gtk.Widget);
82
+
83
+ // Constructors of SugarGestures.EventController
84
+
85
+ constructor(properties?: Partial<EventController.ConstructorProps>, ...args: any[]);
86
+
87
+ _init(...args: any[]): void;
88
+
89
+ // Own signals of SugarGestures.EventController
90
+
91
+ connect(id: string, callback: (...args: any[]) => any): number;
92
+ connect_after(id: string, callback: (...args: any[]) => any): number;
93
+ emit(id: string, ...args: any[]): void;
94
+ connect(signal: 'began', callback: (_source: this) => void): number;
95
+ connect_after(signal: 'began', callback: (_source: this) => void): number;
96
+ emit(signal: 'began'): void;
97
+ connect(signal: 'ended', callback: (_source: this) => void): number;
98
+ connect_after(signal: 'ended', callback: (_source: this) => void): number;
99
+ emit(signal: 'ended'): void;
100
+ connect(signal: 'updated', callback: (_source: this) => void): number;
101
+ connect_after(signal: 'updated', callback: (_source: this) => void): number;
102
+ emit(signal: 'updated'): void;
103
+
104
+ // Own virtual methods of SugarGestures.EventController
105
+
106
+ vfunc_began(): void;
107
+ vfunc_ended(): void;
108
+ vfunc_get_state(): EventControllerState;
109
+ vfunc_handle_event(event: Gdk.Event): boolean;
110
+ vfunc_reset(): void;
111
+ vfunc_updated(): void;
112
+
113
+ // Own methods of SugarGestures.EventController
114
+
115
+ attach(widget: Gtk.Widget, flags: EventControllerFlags): boolean;
116
+ detach(widget: Gtk.Widget): boolean;
117
+ get_state(): EventControllerState;
118
+ handle_event(event: Gdk.Event): boolean;
119
+ reset(): boolean;
120
+ }
121
+
122
+ module LongPressController {
123
+ // Signal callback interfaces
124
+
125
+ interface Pressed {
126
+ (object: number, p0: number): void;
127
+ }
128
+
129
+ // Constructor properties interface
130
+
131
+ interface ConstructorProps extends EventController.ConstructorProps {
132
+ threshold: number;
133
+ trigger_delay: number;
134
+ triggerDelay: number;
135
+ }
136
+ }
137
+
138
+ class LongPressController extends EventController {
139
+ static $gtype: GObject.GType<LongPressController>;
140
+
141
+ // Own properties of SugarGestures.LongPressController
142
+
143
+ get threshold(): number;
144
+ set threshold(val: number);
145
+ get trigger_delay(): number;
146
+ set trigger_delay(val: number);
147
+ get triggerDelay(): number;
148
+ set triggerDelay(val: number);
149
+
150
+ // Constructors of SugarGestures.LongPressController
151
+
152
+ constructor(properties?: Partial<LongPressController.ConstructorProps>, ...args: any[]);
153
+
154
+ _init(...args: any[]): void;
155
+
156
+ static ['new'](): LongPressController;
157
+
158
+ // Own signals of SugarGestures.LongPressController
159
+
160
+ connect(id: string, callback: (...args: any[]) => any): number;
161
+ connect_after(id: string, callback: (...args: any[]) => any): number;
162
+ emit(id: string, ...args: any[]): void;
163
+ connect(signal: 'pressed', callback: (_source: this, object: number, p0: number) => void): number;
164
+ connect_after(signal: 'pressed', callback: (_source: this, object: number, p0: number) => void): number;
165
+ emit(signal: 'pressed', object: number, p0: number): void;
166
+
167
+ // Own virtual methods of SugarGestures.LongPressController
168
+
169
+ vfunc_pressed(x: number, y: number): void;
170
+ }
171
+
172
+ module RotateController {
173
+ // Signal callback interfaces
174
+
175
+ interface AngleChanged {
176
+ (angle: number, angle_delta: number): void;
177
+ }
178
+
179
+ // Constructor properties interface
180
+
181
+ interface ConstructorProps extends TouchController.ConstructorProps {}
182
+ }
183
+
184
+ class RotateController extends TouchController {
185
+ static $gtype: GObject.GType<RotateController>;
186
+
187
+ // Constructors of SugarGestures.RotateController
188
+
189
+ constructor(properties?: Partial<RotateController.ConstructorProps>, ...args: any[]);
190
+
191
+ _init(...args: any[]): void;
192
+
193
+ static ['new'](): RotateController;
194
+
195
+ // Own signals of SugarGestures.RotateController
196
+
197
+ connect(id: string, callback: (...args: any[]) => any): number;
198
+ connect_after(id: string, callback: (...args: any[]) => any): number;
199
+ emit(id: string, ...args: any[]): void;
200
+ connect(signal: 'angle-changed', callback: (_source: this, angle: number, angle_delta: number) => void): number;
201
+ connect_after(
202
+ signal: 'angle-changed',
203
+ callback: (_source: this, angle: number, angle_delta: number) => void,
204
+ ): number;
205
+ emit(signal: 'angle-changed', angle: number, angle_delta: number): void;
206
+
207
+ // Own virtual methods of SugarGestures.RotateController
208
+
209
+ vfunc_angle_changed(angle: number, delta: number): void;
210
+
211
+ // Own methods of SugarGestures.RotateController
212
+
213
+ /**
214
+ * If `controller` is on state %SUGAR_EVENT_CONTROLLER_STATE_RECOGNIZED,
215
+ * this function returns %TRUE and fills in `delta` with the angle difference
216
+ * in radians since the gesture was first recognized.
217
+ * @returns %TRUE if @controller is recognizing a rotate gesture
218
+ */
219
+ get_angle_delta(): [boolean, number];
220
+ }
221
+
222
+ module SwipeController {
223
+ // Signal callback interfaces
224
+
225
+ interface SwipeEnded {
226
+ (object: SwipeDirection): void;
227
+ }
228
+
229
+ // Constructor properties interface
230
+
231
+ interface ConstructorProps extends EventController.ConstructorProps {
232
+ directions: SwipeDirectionFlags;
233
+ }
234
+ }
235
+
236
+ class SwipeController extends EventController {
237
+ static $gtype: GObject.GType<SwipeController>;
238
+
239
+ // Own properties of SugarGestures.SwipeController
240
+
241
+ get directions(): SwipeDirectionFlags;
242
+
243
+ // Constructors of SugarGestures.SwipeController
244
+
245
+ constructor(properties?: Partial<SwipeController.ConstructorProps>, ...args: any[]);
246
+
247
+ _init(...args: any[]): void;
248
+
249
+ static ['new'](directions: SwipeDirectionFlags): SwipeController;
250
+
251
+ // Own signals of SugarGestures.SwipeController
252
+
253
+ connect(id: string, callback: (...args: any[]) => any): number;
254
+ connect_after(id: string, callback: (...args: any[]) => any): number;
255
+ emit(id: string, ...args: any[]): void;
256
+ connect(signal: 'swipe-ended', callback: (_source: this, object: SwipeDirection) => void): number;
257
+ connect_after(signal: 'swipe-ended', callback: (_source: this, object: SwipeDirection) => void): number;
258
+ emit(signal: 'swipe-ended', object: SwipeDirection): void;
259
+
260
+ // Own virtual methods of SugarGestures.SwipeController
261
+
262
+ vfunc_swipe_ended(direction: SwipeDirection): void;
263
+ }
264
+
265
+ module TouchController {
266
+ // Constructor properties interface
267
+
268
+ interface ConstructorProps extends EventController.ConstructorProps {
269
+ max_touches: number;
270
+ maxTouches: number;
271
+ min_touches: number;
272
+ minTouches: number;
273
+ }
274
+ }
275
+
276
+ abstract class TouchController extends EventController {
277
+ static $gtype: GObject.GType<TouchController>;
278
+
279
+ // Own properties of SugarGestures.TouchController
280
+
281
+ get max_touches(): number;
282
+ set max_touches(val: number);
283
+ get maxTouches(): number;
284
+ set maxTouches(val: number);
285
+ get min_touches(): number;
286
+ set min_touches(val: number);
287
+ get minTouches(): number;
288
+ set minTouches(val: number);
289
+
290
+ // Constructors of SugarGestures.TouchController
291
+
292
+ constructor(properties?: Partial<TouchController.ConstructorProps>, ...args: any[]);
293
+
294
+ _init(...args: any[]): void;
295
+
296
+ // Own methods of SugarGestures.TouchController
297
+
298
+ /**
299
+ * If a gesture is ongoing, this function returns the center of
300
+ * the bounding box containing all ongoing touches.
301
+ * @returns %TRUE if a gesture is in progress
302
+ */
303
+ get_center(): [boolean, number, number];
304
+ /**
305
+ * If `sequence` is operating on `controller,` this function returns %TRUE and
306
+ * fills in `x` and `y` with the latest coordinates for that `sequence`.
307
+ * @param sequence a #GdkEventSequence
308
+ * @returns %TRUE if @sequence operates on @controller
309
+ */
310
+ get_coords(sequence: Gdk.EventSequence): [boolean, number, number];
311
+ /**
312
+ * Returns the number of touches currently operating on `controller`
313
+ * @returns The number of touches
314
+ */
315
+ get_num_touches(): number;
316
+ /**
317
+ * Returns the touch sequences currently operating on `controller`
318
+ * @returns The list of sequences
319
+ */
320
+ get_sequences(): Gdk.EventSequence[];
321
+ }
322
+
323
+ module ZoomController {
324
+ // Signal callback interfaces
325
+
326
+ interface ScaleChanged {
327
+ (scale: number): void;
328
+ }
329
+
330
+ // Constructor properties interface
331
+
332
+ interface ConstructorProps extends TouchController.ConstructorProps {}
333
+ }
334
+
335
+ class ZoomController extends TouchController {
336
+ static $gtype: GObject.GType<ZoomController>;
337
+
338
+ // Constructors of SugarGestures.ZoomController
339
+
340
+ constructor(properties?: Partial<ZoomController.ConstructorProps>, ...args: any[]);
341
+
342
+ _init(...args: any[]): void;
343
+
344
+ static ['new'](): ZoomController;
345
+
346
+ // Own signals of SugarGestures.ZoomController
347
+
348
+ connect(id: string, callback: (...args: any[]) => any): number;
349
+ connect_after(id: string, callback: (...args: any[]) => any): number;
350
+ emit(id: string, ...args: any[]): void;
351
+ connect(signal: 'scale-changed', callback: (_source: this, scale: number) => void): number;
352
+ connect_after(signal: 'scale-changed', callback: (_source: this, scale: number) => void): number;
353
+ emit(signal: 'scale-changed', scale: number): void;
354
+
355
+ // Own virtual methods of SugarGestures.ZoomController
356
+
357
+ vfunc_scale_changed(scale: number): void;
358
+
359
+ // Own methods of SugarGestures.ZoomController
360
+
361
+ /**
362
+ * If `controller` is on state %SUGAR_EVENT_CONTROLLER_STATE_RECOGNIZED,
363
+ * this function returns %TRUE and fills in `scale` with the zooming
364
+ * difference since the gesture was recognized (hence the starting point
365
+ * is considered 1x).
366
+ * @returns %TRUE if @controller is recognizing a zoom gesture
367
+ */
368
+ get_scale_delta(): [boolean, number];
369
+ }
370
+
371
+ type EventControllerClass = typeof EventController;
372
+ type LongPressControllerClass = typeof LongPressController;
373
+ type RotateControllerClass = typeof RotateController;
374
+ type SwipeControllerClass = typeof SwipeController;
375
+ type TouchControllerClass = typeof TouchController;
376
+ type ZoomControllerClass = typeof ZoomController;
377
+ /**
378
+ * Name of the imported GIR library
379
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
380
+ */
381
+ const __name__: string;
382
+ /**
383
+ * Version of the imported GIR library
384
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
385
+ */
386
+ const __version__: string;
387
+ }
388
+
389
+ export default SugarGestures;
390
+ // END
@@ -0,0 +1,6 @@
1
+
2
+ // @ts-expect-error
3
+ import SugarGestures from 'gi://SugarGestures?version=1.0';
4
+ export { SugarGestures };
5
+ export default SugarGestures;
6
+
package/tsconfig.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ // General settings for code interpretation
4
+ "target": "ESNext",
5
+ "module": "ESNext",
6
+ "lib": ["ESNext"],
7
+ "types": [],
8
+ "experimentalDecorators": true,
9
+ "moduleResolution": "node",
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": ["./sugargestures-1.0.d.ts"]
21
+ }
22
+
23
+
package/typedoc.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "entryPoints": ["./sugargestures-1.0.d.ts"],
3
+ "readme": "./README.md",
4
+ "name": "SugarGestures-1.0",
5
+ "tsconfig": "./tsconfig.json"
6
+ }
7
+