@kmamal/sdl 0.9.2 → 0.9.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/package.json +1 -1
- package/src/types/index.d.ts +125 -128
package/package.json
CHANGED
package/src/types/index.d.ts
CHANGED
|
@@ -3,23 +3,23 @@ export namespace Events {
|
|
|
3
3
|
|
|
4
4
|
interface BaseEvent { readonly type: string }
|
|
5
5
|
|
|
6
|
-
type PreventCallback = () => void
|
|
6
|
+
export type PreventCallback = () => void
|
|
7
7
|
|
|
8
|
-
namespace Display {
|
|
8
|
+
export namespace Display {
|
|
9
9
|
|
|
10
10
|
interface DisplayEvent extends BaseEvent {
|
|
11
11
|
readonly display: Sdl.Video.Display
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
interface Add extends DisplayEvent { readonly type: 'deviceAdd' }
|
|
15
|
-
interface Remove extends DisplayEvent { readonly type: 'deviceRemove' }
|
|
16
|
-
interface Orient extends DisplayEvent { readonly type: 'deviceOrient' }
|
|
14
|
+
export interface Add extends DisplayEvent { readonly type: 'deviceAdd' }
|
|
15
|
+
export interface Remove extends DisplayEvent { readonly type: 'deviceRemove' }
|
|
16
|
+
export interface Orient extends DisplayEvent { readonly type: 'deviceOrient' }
|
|
17
17
|
|
|
18
|
-
type Any = Add | Remove | Orient
|
|
18
|
+
export type Any = Add | Remove | Orient
|
|
19
19
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
namespace Window {
|
|
22
|
+
export namespace Window {
|
|
23
23
|
|
|
24
24
|
interface WindowEvent extends BaseEvent {}
|
|
25
25
|
|
|
@@ -35,13 +35,13 @@ export namespace Events {
|
|
|
35
35
|
readonly numlock: number
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
interface KeyDown extends KeyEvent {
|
|
38
|
+
export interface KeyDown extends KeyEvent {
|
|
39
39
|
readonly type: 'keyDown'
|
|
40
40
|
readonly repeat: number
|
|
41
41
|
}
|
|
42
|
-
interface KeyUp extends KeyEvent { readonly type: 'keyUp' }
|
|
42
|
+
export interface KeyUp extends KeyEvent { readonly type: 'keyUp' }
|
|
43
43
|
|
|
44
|
-
interface TextInput extends WindowEvent {
|
|
44
|
+
export interface TextInput extends WindowEvent {
|
|
45
45
|
readonly type: 'textInput'
|
|
46
46
|
readonly text: string
|
|
47
47
|
}
|
|
@@ -52,62 +52,62 @@ export namespace Events {
|
|
|
52
52
|
readonly touch: boolean
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
interface MouseMove extends MouseEvent { readonly type: 'mouseMove' }
|
|
55
|
+
export interface MouseMove extends MouseEvent { readonly type: 'mouseMove' }
|
|
56
56
|
|
|
57
57
|
interface MouseButtonEvent extends MouseEvent {
|
|
58
58
|
readonly button: number
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
interface MouseButtonDown extends MouseButtonEvent { readonly type: 'mouseButtonDown' }
|
|
62
|
-
interface MouseButtonUp extends MouseButtonEvent { readonly type: 'mouseButtonUp' }
|
|
61
|
+
export interface MouseButtonDown extends MouseButtonEvent { readonly type: 'mouseButtonDown' }
|
|
62
|
+
export interface MouseButtonUp extends MouseButtonEvent { readonly type: 'mouseButtonUp' }
|
|
63
63
|
|
|
64
|
-
interface MouseWheel extends MouseEvent {
|
|
64
|
+
export interface MouseWheel extends MouseEvent {
|
|
65
65
|
readonly type: 'flipped'
|
|
66
66
|
readonly dx: number
|
|
67
67
|
readonly dy: number
|
|
68
68
|
readonly flipped: boolean
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
interface Show extends WindowEvent { readonly type: 'show' }
|
|
72
|
-
interface Hide extends WindowEvent { readonly type: 'hide' }
|
|
73
|
-
interface Expose extends WindowEvent { readonly type: 'expose' }
|
|
74
|
-
interface Minimize extends WindowEvent { readonly type: 'minimize' }
|
|
75
|
-
interface Maximize extends WindowEvent { readonly type: 'maximize' }
|
|
76
|
-
interface Restore extends WindowEvent { readonly type: 'restore' }
|
|
77
|
-
interface Move extends WindowEvent {
|
|
71
|
+
export interface Show extends WindowEvent { readonly type: 'show' }
|
|
72
|
+
export interface Hide extends WindowEvent { readonly type: 'hide' }
|
|
73
|
+
export interface Expose extends WindowEvent { readonly type: 'expose' }
|
|
74
|
+
export interface Minimize extends WindowEvent { readonly type: 'minimize' }
|
|
75
|
+
export interface Maximize extends WindowEvent { readonly type: 'maximize' }
|
|
76
|
+
export interface Restore extends WindowEvent { readonly type: 'restore' }
|
|
77
|
+
export interface Move extends WindowEvent {
|
|
78
78
|
readonly type: 'move'
|
|
79
79
|
readonly x: number,
|
|
80
80
|
readonly y: number
|
|
81
81
|
}
|
|
82
|
-
interface Resize extends WindowEvent {
|
|
82
|
+
export interface Resize extends WindowEvent {
|
|
83
83
|
readonly type: 'resize'
|
|
84
84
|
readonly width: number
|
|
85
85
|
readonly height: number
|
|
86
86
|
readonly pixelWidth: number
|
|
87
87
|
readonly pixelHeight: number
|
|
88
88
|
}
|
|
89
|
-
interface Focus extends WindowEvent { readonly type: 'focus' }
|
|
90
|
-
interface Blur extends WindowEvent { readonly type: 'blur' }
|
|
91
|
-
interface Hover extends WindowEvent { readonly type: 'hover' }
|
|
92
|
-
interface Leave extends WindowEvent { readonly type: 'leave' }
|
|
93
|
-
interface BeforeClose extends WindowEvent {
|
|
89
|
+
export interface Focus extends WindowEvent { readonly type: 'focus' }
|
|
90
|
+
export interface Blur extends WindowEvent { readonly type: 'blur' }
|
|
91
|
+
export interface Hover extends WindowEvent { readonly type: 'hover' }
|
|
92
|
+
export interface Leave extends WindowEvent { readonly type: 'leave' }
|
|
93
|
+
export interface BeforeClose extends WindowEvent {
|
|
94
94
|
readonly type: 'beforeClose'
|
|
95
95
|
readonly prevent: PreventCallback
|
|
96
96
|
}
|
|
97
|
-
interface Close extends WindowEvent { readonly type: 'close' }
|
|
97
|
+
export interface Close extends WindowEvent { readonly type: 'close' }
|
|
98
98
|
|
|
99
|
-
interface DropBegin extends WindowEvent { readonly type: 'dropBegin' }
|
|
100
|
-
interface DropText extends WindowEvent {
|
|
99
|
+
export interface DropBegin extends WindowEvent { readonly type: 'dropBegin' }
|
|
100
|
+
export interface DropText extends WindowEvent {
|
|
101
101
|
readonly type: 'dropText'
|
|
102
102
|
readonly text: string
|
|
103
103
|
}
|
|
104
|
-
interface DropFile extends WindowEvent {
|
|
104
|
+
export interface DropFile extends WindowEvent {
|
|
105
105
|
readonly type: 'dropFile'
|
|
106
106
|
readonly file: string
|
|
107
107
|
}
|
|
108
|
-
interface DropComplete extends WindowEvent { readonly type: 'dropComplete' }
|
|
108
|
+
export interface DropComplete extends WindowEvent { readonly type: 'dropComplete' }
|
|
109
109
|
|
|
110
|
-
type Any
|
|
110
|
+
export type Any
|
|
111
111
|
= KeyDown
|
|
112
112
|
| KeyUp
|
|
113
113
|
| TextInput
|
|
@@ -136,17 +136,17 @@ export namespace Events {
|
|
|
136
136
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
namespace Joystick {
|
|
139
|
+
export namespace Joystick {
|
|
140
140
|
|
|
141
141
|
interface JoystickEvent extends BaseEvent {}
|
|
142
142
|
|
|
143
|
-
interface AxisMotion extends JoystickEvent {
|
|
143
|
+
export interface AxisMotion extends JoystickEvent {
|
|
144
144
|
readonly type: 'axisMotion'
|
|
145
145
|
readonly axis: number,
|
|
146
146
|
readonly value: number
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
interface BallMotion extends JoystickEvent {
|
|
149
|
+
export interface BallMotion extends JoystickEvent {
|
|
150
150
|
readonly type: 'ballMotion'
|
|
151
151
|
readonly ball: number,
|
|
152
152
|
readonly x: number
|
|
@@ -156,18 +156,19 @@ export namespace Events {
|
|
|
156
156
|
interface ButtonEvent extends JoystickEvent {
|
|
157
157
|
readonly button: number
|
|
158
158
|
}
|
|
159
|
-
interface ButtonDown extends ButtonEvent { readonly type: 'buttonDown' }
|
|
160
|
-
interface ButtonUp extends ButtonEvent { readonly type: 'buttonUp' }
|
|
161
159
|
|
|
162
|
-
interface
|
|
160
|
+
export interface ButtonDown extends ButtonEvent { readonly type: 'buttonDown' }
|
|
161
|
+
export interface ButtonUp extends ButtonEvent { readonly type: 'buttonUp' }
|
|
162
|
+
|
|
163
|
+
export interface HatMotion extends JoystickEvent {
|
|
163
164
|
readonly type: 'hatMotion'
|
|
164
165
|
readonly hat: number,
|
|
165
166
|
readonly value: Sdl.Joystick.HatPosition
|
|
166
167
|
}
|
|
167
168
|
|
|
168
|
-
interface Close extends JoystickEvent { readonly type: 'close' }
|
|
169
|
+
export interface Close extends JoystickEvent { readonly type: 'close' }
|
|
169
170
|
|
|
170
|
-
type Any
|
|
171
|
+
export type Any
|
|
171
172
|
= AxisMotion
|
|
172
173
|
| BallMotion
|
|
173
174
|
| ButtonDown
|
|
@@ -177,24 +178,24 @@ export namespace Events {
|
|
|
177
178
|
|
|
178
179
|
}
|
|
179
180
|
|
|
180
|
-
namespace JoystickDevice {
|
|
181
|
+
export namespace JoystickDevice {
|
|
181
182
|
|
|
182
183
|
interface DeviceEvent extends BaseEvent {
|
|
183
184
|
readonly device: Sdl.Joystick.Device
|
|
184
185
|
}
|
|
185
186
|
|
|
186
|
-
interface Add extends DeviceEvent { readonly type: 'deviceAdd' }
|
|
187
|
-
interface Remove extends DeviceEvent { readonly type: 'deviceRemove' }
|
|
187
|
+
export interface Add extends DeviceEvent { readonly type: 'deviceAdd' }
|
|
188
|
+
export interface Remove extends DeviceEvent { readonly type: 'deviceRemove' }
|
|
188
189
|
|
|
189
|
-
type Any = Add | Remove
|
|
190
|
+
export type Any = Add | Remove
|
|
190
191
|
|
|
191
192
|
}
|
|
192
193
|
|
|
193
|
-
namespace Controller {
|
|
194
|
+
export namespace Controller {
|
|
194
195
|
|
|
195
196
|
interface ControllerEvent extends BaseEvent {}
|
|
196
197
|
|
|
197
|
-
interface AxisMotion extends ControllerEvent {
|
|
198
|
+
export interface AxisMotion extends ControllerEvent {
|
|
198
199
|
readonly type: 'axisMotion'
|
|
199
200
|
readonly axis: number,
|
|
200
201
|
readonly value: number
|
|
@@ -203,14 +204,15 @@ export namespace Events {
|
|
|
203
204
|
interface ButtonEvent extends ControllerEvent {
|
|
204
205
|
readonly button: number
|
|
205
206
|
}
|
|
206
|
-
interface ButtonDown extends ButtonEvent { readonly type: 'buttonDown' }
|
|
207
|
-
interface ButtonUp extends ButtonEvent { readonly type: 'buttonUp' }
|
|
208
207
|
|
|
209
|
-
interface
|
|
208
|
+
export interface ButtonDown extends ButtonEvent { readonly type: 'buttonDown' }
|
|
209
|
+
export interface ButtonUp extends ButtonEvent { readonly type: 'buttonUp' }
|
|
210
|
+
|
|
211
|
+
export interface Remap extends ControllerEvent { readonly type: 'remap' }
|
|
210
212
|
|
|
211
|
-
interface Close extends ControllerEvent { readonly type: 'close' }
|
|
213
|
+
export interface Close extends ControllerEvent { readonly type: 'close' }
|
|
212
214
|
|
|
213
|
-
type Any
|
|
215
|
+
export type Any
|
|
214
216
|
= AxisMotion
|
|
215
217
|
| ButtonDown
|
|
216
218
|
| ButtonUp
|
|
@@ -219,71 +221,71 @@ export namespace Events {
|
|
|
219
221
|
|
|
220
222
|
}
|
|
221
223
|
|
|
222
|
-
namespace Sensor {
|
|
224
|
+
export namespace Sensor {
|
|
223
225
|
|
|
224
226
|
interface SensorEvent extends BaseEvent {}
|
|
225
227
|
|
|
226
|
-
interface Update extends SensorEvent {
|
|
228
|
+
export interface Update extends SensorEvent {
|
|
227
229
|
readonly type: 'update'
|
|
228
230
|
}
|
|
229
231
|
|
|
230
|
-
interface Close extends SensorEvent { readonly type: 'close' }
|
|
232
|
+
export interface Close extends SensorEvent { readonly type: 'close' }
|
|
231
233
|
|
|
232
|
-
type Any
|
|
234
|
+
export type Any
|
|
233
235
|
= Update
|
|
234
236
|
| Close
|
|
235
237
|
|
|
236
238
|
}
|
|
237
239
|
|
|
238
|
-
namespace ControllerDevice {
|
|
240
|
+
export namespace ControllerDevice {
|
|
239
241
|
|
|
240
242
|
interface DeviceEvent extends BaseEvent {
|
|
241
243
|
readonly device: Sdl.Controller.Device
|
|
242
244
|
}
|
|
243
245
|
|
|
244
|
-
interface Add extends DeviceEvent { readonly type: 'deviceAdd' }
|
|
245
|
-
interface Remove extends DeviceEvent { readonly type: 'deviceRemove' }
|
|
246
|
+
export interface Add extends DeviceEvent { readonly type: 'deviceAdd' }
|
|
247
|
+
export interface Remove extends DeviceEvent { readonly type: 'deviceRemove' }
|
|
246
248
|
|
|
247
|
-
type Any = Add | Remove
|
|
249
|
+
export type Any = Add | Remove
|
|
248
250
|
|
|
249
251
|
}
|
|
250
252
|
|
|
251
|
-
namespace Audio {
|
|
253
|
+
export namespace Audio {
|
|
252
254
|
|
|
253
255
|
interface AudioEvent extends BaseEvent {}
|
|
254
256
|
|
|
255
|
-
interface Close extends AudioEvent { readonly type: 'close' }
|
|
257
|
+
export interface Close extends AudioEvent { readonly type: 'close' }
|
|
256
258
|
|
|
257
|
-
type Any = Close
|
|
259
|
+
export type Any = Close
|
|
258
260
|
|
|
259
261
|
}
|
|
260
262
|
|
|
261
|
-
namespace AudioDevice {
|
|
263
|
+
export namespace AudioDevice {
|
|
262
264
|
|
|
263
265
|
interface DeviceEvent extends BaseEvent {
|
|
264
266
|
readonly device: Sdl.Audio.Device
|
|
265
267
|
}
|
|
266
268
|
|
|
267
|
-
interface Add extends DeviceEvent { readonly type: 'deviceAdd' }
|
|
268
|
-
interface Remove extends DeviceEvent { readonly type: 'deviceRemove' }
|
|
269
|
+
export interface Add extends DeviceEvent { readonly type: 'deviceAdd' }
|
|
270
|
+
export interface Remove extends DeviceEvent { readonly type: 'deviceRemove' }
|
|
269
271
|
|
|
270
|
-
type Any = Add | Remove
|
|
272
|
+
export type Any = Add | Remove
|
|
271
273
|
|
|
272
274
|
}
|
|
273
275
|
|
|
274
|
-
namespace Clipboard {
|
|
276
|
+
export namespace Clipboard {
|
|
275
277
|
|
|
276
|
-
interface Update extends BaseEvent { readonly type: 'update' }
|
|
278
|
+
export interface Update extends BaseEvent { readonly type: 'update' }
|
|
277
279
|
|
|
278
|
-
type Any = Update
|
|
280
|
+
export type Any = Update
|
|
279
281
|
|
|
280
282
|
}
|
|
281
|
-
}
|
|
282
283
|
|
|
284
|
+
}
|
|
283
285
|
|
|
284
286
|
export namespace Sdl {
|
|
285
287
|
|
|
286
|
-
interface Info {
|
|
288
|
+
export interface Info {
|
|
287
289
|
readonly version: {
|
|
288
290
|
readonly compile: {
|
|
289
291
|
readonly major: number
|
|
@@ -309,9 +311,9 @@ export namespace Sdl {
|
|
|
309
311
|
}
|
|
310
312
|
}
|
|
311
313
|
|
|
312
|
-
namespace Video {
|
|
314
|
+
export namespace Video {
|
|
313
315
|
|
|
314
|
-
type Format
|
|
316
|
+
export type Format
|
|
315
317
|
= 'rgb332'
|
|
316
318
|
| 'rgb444'
|
|
317
319
|
| 'rgb555'
|
|
@@ -349,7 +351,7 @@ export namespace Sdl {
|
|
|
349
351
|
| 'nv12'
|
|
350
352
|
| 'nv21'
|
|
351
353
|
|
|
352
|
-
interface Display {
|
|
354
|
+
export interface Display {
|
|
353
355
|
readonly name: string
|
|
354
356
|
readonly format: Format
|
|
355
357
|
readonly frequency: number
|
|
@@ -372,7 +374,7 @@ export namespace Sdl {
|
|
|
372
374
|
}
|
|
373
375
|
}
|
|
374
376
|
|
|
375
|
-
class Window {
|
|
377
|
+
export class Window {
|
|
376
378
|
on (event: 'show', listener: (event: Events.Window.Show) => void): this
|
|
377
379
|
on (event: 'hide', listener: (event: Events.Window.Hide) => void): this
|
|
378
380
|
on (event: 'expose', listener: (event: Events.Window.Expose) => void): this
|
|
@@ -506,11 +508,11 @@ export namespace Sdl {
|
|
|
506
508
|
}
|
|
507
509
|
}
|
|
508
510
|
|
|
509
|
-
namespace Keyboard {
|
|
511
|
+
export namespace Keyboard {
|
|
510
512
|
|
|
511
|
-
type Scancode = number
|
|
513
|
+
export type Scancode = number
|
|
512
514
|
|
|
513
|
-
type ScancodeNames
|
|
515
|
+
export type ScancodeNames
|
|
514
516
|
= 'A'
|
|
515
517
|
| 'B'
|
|
516
518
|
| 'C'
|
|
@@ -754,7 +756,7 @@ export namespace Sdl {
|
|
|
754
756
|
| 'AUDIOREWIND'
|
|
755
757
|
| 'AUDIOFASTFORWARD'
|
|
756
758
|
|
|
757
|
-
type Key = string
|
|
759
|
+
export type Key = string
|
|
758
760
|
|
|
759
761
|
interface Module {
|
|
760
762
|
readonly SCANCODE: { [name in ScancodeNames]: Scancode }
|
|
@@ -767,16 +769,16 @@ export namespace Sdl {
|
|
|
767
769
|
|
|
768
770
|
}
|
|
769
771
|
|
|
770
|
-
namespace Mouse {
|
|
772
|
+
export namespace Mouse {
|
|
771
773
|
|
|
772
|
-
type Button = number
|
|
774
|
+
export type Button = number
|
|
773
775
|
|
|
774
|
-
type ButtonNames
|
|
776
|
+
export type ButtonNames
|
|
775
777
|
= 'LEFT'
|
|
776
778
|
| 'MIDDLE'
|
|
777
779
|
| 'RIGHT'
|
|
778
780
|
|
|
779
|
-
type Cursor
|
|
781
|
+
export type Cursor
|
|
780
782
|
= 'arrow'
|
|
781
783
|
| 'ibeam'
|
|
782
784
|
| 'wait'
|
|
@@ -802,7 +804,7 @@ export namespace Sdl {
|
|
|
802
804
|
setPosition (x: number, y: number): void
|
|
803
805
|
|
|
804
806
|
setCursor (cursor: Cursor): void
|
|
805
|
-
setCursorImage (width: number, height: number, stride: number, format:
|
|
807
|
+
setCursorImage (width: number, height: number, stride: number, format: Video.Format, buffer: Buffer): void
|
|
806
808
|
|
|
807
809
|
showCursor (show?: boolean): void
|
|
808
810
|
hideCursor (): void
|
|
@@ -813,14 +815,14 @@ export namespace Sdl {
|
|
|
813
815
|
|
|
814
816
|
}
|
|
815
817
|
|
|
816
|
-
namespace Joystick {
|
|
818
|
+
export namespace Joystick {
|
|
817
819
|
|
|
818
|
-
interface BallPosition {
|
|
820
|
+
export interface BallPosition {
|
|
819
821
|
x: number
|
|
820
822
|
y: number
|
|
821
823
|
}
|
|
822
824
|
|
|
823
|
-
type HatPosition
|
|
825
|
+
export type HatPosition
|
|
824
826
|
= 'centered'
|
|
825
827
|
| 'up'
|
|
826
828
|
| 'right'
|
|
@@ -831,7 +833,7 @@ export namespace Sdl {
|
|
|
831
833
|
| 'leftup'
|
|
832
834
|
| 'leftdown'
|
|
833
835
|
|
|
834
|
-
type PowerLevel
|
|
836
|
+
export type PowerLevel
|
|
835
837
|
= 'unknown'
|
|
836
838
|
| 'empty'
|
|
837
839
|
| 'low'
|
|
@@ -840,7 +842,7 @@ export namespace Sdl {
|
|
|
840
842
|
| 'wired'
|
|
841
843
|
| 'max'
|
|
842
844
|
|
|
843
|
-
interface Device {
|
|
845
|
+
export interface Device {
|
|
844
846
|
readonly id: number
|
|
845
847
|
readonly type: string
|
|
846
848
|
readonly name: string
|
|
@@ -852,7 +854,7 @@ export namespace Sdl {
|
|
|
852
854
|
readonly player: number
|
|
853
855
|
}
|
|
854
856
|
|
|
855
|
-
class JoystickInstance {
|
|
857
|
+
export class JoystickInstance {
|
|
856
858
|
on (event: 'axisMotion', listener: (event: Events.Joystick.AxisMotion) => void): this
|
|
857
859
|
on (event: 'ballMotion', listener: (event: Events.Joystick.BallMotion) => void): this
|
|
858
860
|
on (event: 'buttonDown', listener: (event: Events.Joystick.ButtonDown) => void): this
|
|
@@ -901,9 +903,9 @@ export namespace Sdl {
|
|
|
901
903
|
|
|
902
904
|
}
|
|
903
905
|
|
|
904
|
-
namespace Controller {
|
|
906
|
+
export namespace Controller {
|
|
905
907
|
|
|
906
|
-
interface Device {
|
|
908
|
+
export interface Device {
|
|
907
909
|
readonly id: number
|
|
908
910
|
readonly name: string
|
|
909
911
|
readonly path: string
|
|
@@ -915,7 +917,7 @@ export namespace Sdl {
|
|
|
915
917
|
readonly mapping: string
|
|
916
918
|
}
|
|
917
919
|
|
|
918
|
-
class ControllerInstance {
|
|
920
|
+
export class ControllerInstance {
|
|
919
921
|
on (event: 'axisMotion', listener: (event: Events.Controller.AxisMotion) => void): this
|
|
920
922
|
on (event: 'buttonDown', listener: (event: Events.Controller.ButtonDown) => void): this
|
|
921
923
|
on (event: 'buttonUp', listener: (event: Events.Controller.ButtonUp) => void): this
|
|
@@ -991,32 +993,32 @@ export namespace Sdl {
|
|
|
991
993
|
|
|
992
994
|
}
|
|
993
995
|
|
|
994
|
-
namespace Sensor {
|
|
996
|
+
export namespace Sensor {
|
|
995
997
|
|
|
996
|
-
type Type
|
|
998
|
+
export type Type
|
|
997
999
|
= 'unknown'
|
|
998
1000
|
| 'accelerometer'
|
|
999
1001
|
| 'gyroscope'
|
|
1000
1002
|
|
|
1001
|
-
type Side
|
|
1003
|
+
export type Side
|
|
1002
1004
|
= 'left'
|
|
1003
1005
|
| 'right'
|
|
1004
1006
|
|
|
1005
|
-
interface Device {
|
|
1007
|
+
export interface Device {
|
|
1006
1008
|
readonly id: number
|
|
1007
1009
|
readonly name: string
|
|
1008
1010
|
readonly type: Type
|
|
1009
1011
|
readonly side: Side | null
|
|
1010
1012
|
}
|
|
1011
1013
|
|
|
1012
|
-
interface Data {
|
|
1014
|
+
export interface Data {
|
|
1013
1015
|
timestamp: number | null,
|
|
1014
1016
|
x: number,
|
|
1015
1017
|
y: number,
|
|
1016
1018
|
z: number,
|
|
1017
1019
|
}
|
|
1018
1020
|
|
|
1019
|
-
class SensorInstance {
|
|
1021
|
+
export class SensorInstance {
|
|
1020
1022
|
on (event: 'update', listener: (event: Events.Sensor.Update) => void): this
|
|
1021
1023
|
on (event: 'close', listener: (event: Events.Sensor.Close) => void): this
|
|
1022
1024
|
on (event: '*', listener: (event: Events.Sensor.Any) => void): this
|
|
@@ -1039,9 +1041,9 @@ export namespace Sdl {
|
|
|
1039
1041
|
|
|
1040
1042
|
}
|
|
1041
1043
|
|
|
1042
|
-
namespace Audio {
|
|
1044
|
+
export namespace Audio {
|
|
1043
1045
|
|
|
1044
|
-
type Format
|
|
1046
|
+
export type Format
|
|
1045
1047
|
= 's8'
|
|
1046
1048
|
| 'u8'
|
|
1047
1049
|
| 's16lsb'
|
|
@@ -1061,20 +1063,20 @@ export namespace Sdl {
|
|
|
1061
1063
|
| 'f32sys'
|
|
1062
1064
|
| 'f32'
|
|
1063
1065
|
|
|
1064
|
-
interface Device {
|
|
1066
|
+
export interface Device {
|
|
1065
1067
|
readonly type: "recording"|"playback"
|
|
1066
1068
|
readonly name?: string
|
|
1067
1069
|
}
|
|
1068
1070
|
|
|
1069
|
-
interface PlaybackDevice extends Device {
|
|
1071
|
+
export interface PlaybackDevice extends Device {
|
|
1070
1072
|
readonly type: "playback"
|
|
1071
1073
|
}
|
|
1072
1074
|
|
|
1073
|
-
interface RecordingDevice extends Device {
|
|
1075
|
+
export interface RecordingDevice extends Device {
|
|
1074
1076
|
readonly type: "recording"
|
|
1075
1077
|
}
|
|
1076
1078
|
|
|
1077
|
-
class AudioInstance {
|
|
1079
|
+
export class AudioInstance {
|
|
1078
1080
|
on (event: 'close', listener: (event: Events.Audio.Close) => void): this
|
|
1079
1081
|
on (event: '*', listener: (event: Events.Audio.Any) => void): this
|
|
1080
1082
|
|
|
@@ -1104,15 +1106,15 @@ export namespace Sdl {
|
|
|
1104
1106
|
close (): void
|
|
1105
1107
|
}
|
|
1106
1108
|
|
|
1107
|
-
class AudioPlaybackInstance extends AudioInstance {
|
|
1109
|
+
export class AudioPlaybackInstance extends AudioInstance {
|
|
1108
1110
|
enqueue (buffer: Buffer, bytes?: number): void
|
|
1109
1111
|
}
|
|
1110
1112
|
|
|
1111
|
-
class AudioRecordingInstance extends AudioInstance {
|
|
1113
|
+
export class AudioRecordingInstance extends AudioInstance {
|
|
1112
1114
|
dequeue (buffer: Buffer, bytes?: number): number
|
|
1113
1115
|
}
|
|
1114
1116
|
|
|
1115
|
-
interface AudioOptions {
|
|
1117
|
+
export interface AudioOptions {
|
|
1116
1118
|
channels?: 1 | 2 | 4 | 6
|
|
1117
1119
|
frequency?: number
|
|
1118
1120
|
format?: Format
|
|
@@ -1138,7 +1140,7 @@ export namespace Sdl {
|
|
|
1138
1140
|
}
|
|
1139
1141
|
}
|
|
1140
1142
|
|
|
1141
|
-
namespace Clipboard {
|
|
1143
|
+
export namespace Clipboard {
|
|
1142
1144
|
|
|
1143
1145
|
interface Module {
|
|
1144
1146
|
on (event: 'update', listener: (event: Events.Clipboard.Update) => void): this
|
|
@@ -1150,16 +1152,16 @@ export namespace Sdl {
|
|
|
1150
1152
|
|
|
1151
1153
|
}
|
|
1152
1154
|
|
|
1153
|
-
namespace Power {
|
|
1155
|
+
export namespace Power {
|
|
1154
1156
|
|
|
1155
|
-
type PowerState
|
|
1157
|
+
export type PowerState
|
|
1156
1158
|
= 'unknown'
|
|
1157
1159
|
| 'noBattery'
|
|
1158
1160
|
| 'battery'
|
|
1159
1161
|
| 'charging'
|
|
1160
1162
|
| 'charged'
|
|
1161
1163
|
|
|
1162
|
-
interface PowerInfo {
|
|
1164
|
+
export interface PowerInfo {
|
|
1163
1165
|
state: PowerState
|
|
1164
1166
|
seconds: number | null
|
|
1165
1167
|
percent: number | null
|
|
@@ -1171,20 +1173,15 @@ export namespace Sdl {
|
|
|
1171
1173
|
|
|
1172
1174
|
}
|
|
1173
1175
|
|
|
1174
|
-
interface Module {
|
|
1175
|
-
readonly info: Info
|
|
1176
|
-
readonly video: Video.Module
|
|
1177
|
-
readonly keyboard: Keyboard.Module
|
|
1178
|
-
readonly mouse: Mouse.Module
|
|
1179
|
-
readonly joystick: Joystick.Module
|
|
1180
|
-
readonly controller: Controller.Module
|
|
1181
|
-
readonly sensor: Sensor.Module
|
|
1182
|
-
readonly audio: Audio.Module
|
|
1183
|
-
readonly clipboard: Clipboard.Module
|
|
1184
|
-
readonly power: Power.Module
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
1176
|
}
|
|
1188
1177
|
|
|
1189
|
-
|
|
1190
|
-
export
|
|
1178
|
+
export const info: Sdl.Info
|
|
1179
|
+
export const video: Sdl.Video.Module
|
|
1180
|
+
export const keyboard: Sdl.Keyboard.Module
|
|
1181
|
+
export const mouse: Sdl.Mouse.Module
|
|
1182
|
+
export const joystick: Sdl.Joystick.Module
|
|
1183
|
+
export const controller: Sdl.Controller.Module
|
|
1184
|
+
export const sensor: Sdl.Sensor.Module
|
|
1185
|
+
export const audio: Sdl.Audio.Module
|
|
1186
|
+
export const clipboard: Sdl.Clipboard.Module
|
|
1187
|
+
export const power: Sdl.Power.Module
|