@kmamal/sdl 0.7.4 → 0.7.5
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 +1 -1
- package/package.json +7 -7
- package/scripts/build.mjs +1 -1
- package/scripts/install-deps-raspbian.sh +5 -0
- package/scripts/install-deps-ubuntu.sh +5 -0
- package/scripts/release-rpi-qemu.sh +116 -0
- package/scripts/util/common.js +2 -2
- package/src/javascript/controller/index.js +1 -1
- package/src/types/index.d.ts +434 -362
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ SDL bindings for Node.js.
|
|
|
9
9
|
Provides window management, input events (keyboard, mouse, joystick, controller), audio playback and recording, and clipboard manipulation.
|
|
10
10
|
|
|
11
11
|
It should work on Linux, Mac, and Windows.
|
|
12
|
-
Prebuilt binaries are available for x64 architectures,
|
|
12
|
+
Prebuilt binaries are available for x64 architectures, arm-based Macs, and Raspberry Pi.
|
|
13
13
|
|
|
14
14
|
#### Canvas, WebGL, and WebGPU
|
|
15
15
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.7.
|
|
2
|
+
"version": "0.7.5",
|
|
3
3
|
"name": "@kmamal/sdl",
|
|
4
4
|
"description": "SDL bindings for Node.js",
|
|
5
5
|
"keywords": [
|
|
@@ -34,8 +34,9 @@
|
|
|
34
34
|
"type": "git",
|
|
35
35
|
"url": "git://github.com/kmamal/node-sdl.git"
|
|
36
36
|
},
|
|
37
|
-
"main": "src/javascript/index.js",
|
|
38
|
-
"
|
|
37
|
+
"main": "./src/javascript/index.js",
|
|
38
|
+
"exports": "./src/javascript/index.js",
|
|
39
|
+
"types": "./src/types/index.d.ts",
|
|
39
40
|
"gypfile": true,
|
|
40
41
|
"scripts": {
|
|
41
42
|
"test": "cd scripts && node test.mjs",
|
|
@@ -45,11 +46,10 @@
|
|
|
45
46
|
"build": "cd scripts && node build.mjs",
|
|
46
47
|
"upload-release": "cd scripts && node upload-release.mjs",
|
|
47
48
|
"release": "cd scripts && node release.mjs",
|
|
48
|
-
"clean": "cd scripts && node clean.mjs"
|
|
49
|
-
"install-deps-mac": "./scripts/install-deps-mac.sh"
|
|
49
|
+
"clean": "cd scripts && node clean.mjs"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"tar": "^6.1.
|
|
52
|
+
"tar": "^6.1.15"
|
|
53
53
|
},
|
|
54
54
|
"sdl": {
|
|
55
55
|
"owner": "kmamal",
|
|
@@ -57,6 +57,6 @@
|
|
|
57
57
|
"version": "2.26.4"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@types/node": "^
|
|
60
|
+
"@types/node": "^20.2.3"
|
|
61
61
|
}
|
|
62
62
|
}
|
package/scripts/build.mjs
CHANGED
|
@@ -21,7 +21,7 @@ if (process.env.CROSS_COMPILE_ARCH) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
process.chdir(C.dir.root)
|
|
24
|
-
execSync(`npx node-gyp rebuild ${archFlag} -j max --verbose`, {
|
|
24
|
+
execSync(`npx -y node-gyp rebuild ${archFlag} -j max --verbose`, {
|
|
25
25
|
stdio: 'inherit',
|
|
26
26
|
env: {
|
|
27
27
|
...process.env,
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -eEu -o pipefail
|
|
4
|
+
set -x
|
|
5
|
+
|
|
6
|
+
OS="raspios_lite_arm64"
|
|
7
|
+
DATE="2023-05-03"
|
|
8
|
+
IMAGE="$DATE-raspios-bullseye-arm64-lite.img"
|
|
9
|
+
MOUNT="/mnt/raspbian"
|
|
10
|
+
|
|
11
|
+
DIR="/tmp/node-sdl-rpi-qemu"
|
|
12
|
+
rm -rf "$DIR" || true
|
|
13
|
+
mkdir -p "$DIR"
|
|
14
|
+
cd "$DIR"
|
|
15
|
+
echo "Working in $DIR"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
sudo apt-get update
|
|
19
|
+
sudo apt-get install -y xz-utils qemu-system-arm expect
|
|
20
|
+
|
|
21
|
+
CACHED="/home/$USER/Desktop/$IMAGE.xz"
|
|
22
|
+
if test -f "$CACHED"; then
|
|
23
|
+
cp "$CACHED" .
|
|
24
|
+
else
|
|
25
|
+
wget --progress=dot:giga "https://downloads.raspberrypi.org/$OS/images/$OS-$DATE/$IMAGE.xz"
|
|
26
|
+
fi
|
|
27
|
+
unxz "$IMAGE.xz"
|
|
28
|
+
|
|
29
|
+
qemu-img resize "$IMAGE" 4G
|
|
30
|
+
|
|
31
|
+
expect -f - <<- EOF
|
|
32
|
+
set timeout -1
|
|
33
|
+
# exp_internal 1
|
|
34
|
+
|
|
35
|
+
spawn fdisk {$IMAGE}
|
|
36
|
+
|
|
37
|
+
expect -exact {Command (m for help): }
|
|
38
|
+
send -- [string cat {d} "\r"]
|
|
39
|
+
|
|
40
|
+
expect -exact {Partition number (1,2, default 2): }
|
|
41
|
+
send -- [string cat {} "\r"]
|
|
42
|
+
|
|
43
|
+
expect -exact {Command (m for help): }
|
|
44
|
+
send -- [string cat {n} "\r"]
|
|
45
|
+
|
|
46
|
+
expect -exact {Select (default p): }
|
|
47
|
+
send -- [string cat {} "\r"]
|
|
48
|
+
|
|
49
|
+
expect -exact {Partition number (2-4, default 2): }
|
|
50
|
+
send -- [string cat {} "\r"]
|
|
51
|
+
|
|
52
|
+
expect -exact {First sector (2048-8388607, default 2048): }
|
|
53
|
+
send -- [string cat {532480} "\r"]
|
|
54
|
+
|
|
55
|
+
expect -exact {(532480-8388607, default 8388607): }
|
|
56
|
+
send -- [string cat {} "\r"]
|
|
57
|
+
|
|
58
|
+
expect -exact {Do you want to remove the signature?}
|
|
59
|
+
send -- [string cat {N} "\r"]
|
|
60
|
+
|
|
61
|
+
expect -exact {Command (m for help): }
|
|
62
|
+
send -- [string cat {w} "\r"]
|
|
63
|
+
|
|
64
|
+
expect eof
|
|
65
|
+
EOF
|
|
66
|
+
|
|
67
|
+
LOOP="$(sudo losetup -f)"
|
|
68
|
+
sudo losetup -P "$LOOP" "$IMAGE"
|
|
69
|
+
sudo e2fsck -fa "${LOOP}p2" || true
|
|
70
|
+
sudo resize2fs "${LOOP}p2"
|
|
71
|
+
sudo losetup -d "${LOOP}"
|
|
72
|
+
|
|
73
|
+
sudo mkdir -p "$MOUNT"
|
|
74
|
+
sudo mount -o loop,offset=4194304 "$IMAGE" "$MOUNT"
|
|
75
|
+
|
|
76
|
+
printf 'pi:$6$c70VpvPsVNCG0YR5$l5vWWLsLko9Kj65gcQ8qvMkuOoRkEagI90qi3F/Y7rm8eNYZHW8CY6BOIKwMH7a3YYzZYL90zf304cAHLFaZE0' | sudo tee "$MOUNT/userconf" > /dev/null
|
|
77
|
+
|
|
78
|
+
expect -f - <<- EOF
|
|
79
|
+
set timeout -1
|
|
80
|
+
# exp_internal 1
|
|
81
|
+
|
|
82
|
+
spawn qemu-system-aarch64 \
|
|
83
|
+
-machine raspi3b \
|
|
84
|
+
-cpu cortex-a72 \
|
|
85
|
+
-dtb "$MOUNT/bcm2710-rpi-3-b-plus.dtb" \
|
|
86
|
+
-m 1G -smp 4 -nographic -monitor none -serial stdio \
|
|
87
|
+
-kernel "$MOUNT/kernel8.img" \
|
|
88
|
+
-sd "$IMAGE" \
|
|
89
|
+
-netdev user,id=net0 \
|
|
90
|
+
-device usb-net,netdev=net0 \
|
|
91
|
+
-append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1"
|
|
92
|
+
|
|
93
|
+
expect -exact {raspberrypi login: }
|
|
94
|
+
send -- [string cat {pi} "\r"]
|
|
95
|
+
|
|
96
|
+
expect -exact {Password: }
|
|
97
|
+
sleep 5
|
|
98
|
+
send -- [string cat {raspberry} "\r"]
|
|
99
|
+
|
|
100
|
+
expect -exact {pi@raspberrypi}
|
|
101
|
+
send -- [string cat {curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs} "\r"]
|
|
102
|
+
|
|
103
|
+
expect -exact {pi@raspberrypi}
|
|
104
|
+
send -- [string cat {wget --progress=dot https://github.com/kmamal/node-sdl/archive/refs/heads/master.tar.gz && tar xvf master.tar.gz && cd node-sdl-master} "\r"]
|
|
105
|
+
|
|
106
|
+
expect -exact {pi@raspberrypi}
|
|
107
|
+
send -- [string cat {./scripts/install-deps-raspbian.sh && GITHUB_TOKEN="$GITHUB_TOKEN" npm run release} "\r"]
|
|
108
|
+
|
|
109
|
+
expect -exact {pi@raspberrypi}
|
|
110
|
+
send -- [string cat {sudo shutdown -h now} "\r"]
|
|
111
|
+
|
|
112
|
+
expect eof
|
|
113
|
+
EOF
|
|
114
|
+
|
|
115
|
+
# debug
|
|
116
|
+
# sudo mount -o loop,offset=272629760 "$IMAGE" "$MOUNT"
|
package/scripts/util/common.js
CHANGED
|
@@ -14,7 +14,7 @@ for (const controllerDevice of Globals.controllerDevices) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
const validEvents = [ 'deviceAdd', 'deviceRemove'
|
|
17
|
+
const validEvents = [ 'deviceAdd', 'deviceRemove' ]
|
|
18
18
|
|
|
19
19
|
const controller = new class extends EventsViaPoll {
|
|
20
20
|
constructor () { super(validEvents) }
|
package/src/types/index.d.ts
CHANGED
|
@@ -21,11 +21,11 @@ export namespace Events {
|
|
|
21
21
|
readonly numlock: number
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
interface
|
|
24
|
+
interface KeyDown extends KeyEvent {
|
|
25
25
|
readonly type: 'keyDown'
|
|
26
26
|
readonly repeat: number
|
|
27
27
|
}
|
|
28
|
-
interface
|
|
28
|
+
interface KeyUp extends KeyEvent { readonly type: 'keyUp' }
|
|
29
29
|
|
|
30
30
|
interface TextInput extends WindowEvent {
|
|
31
31
|
readonly type: 'textInput'
|
|
@@ -38,16 +38,16 @@ export namespace Events {
|
|
|
38
38
|
readonly touch: boolean
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
interface
|
|
41
|
+
interface MouseMove extends MouseEvent { readonly type: 'mouseMove' }
|
|
42
42
|
|
|
43
43
|
interface MouseButtonEvent extends MouseEvent {
|
|
44
44
|
readonly button: number
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
interface
|
|
48
|
-
interface
|
|
47
|
+
interface MouseButtonDown extends MouseButtonEvent { readonly type: 'mouseButtonDown' }
|
|
48
|
+
interface MouseButtonUp extends MouseButtonEvent { readonly type: 'mouseButtonUp' }
|
|
49
49
|
|
|
50
|
-
interface
|
|
50
|
+
interface MouseWheel extends MouseEvent {
|
|
51
51
|
readonly type: 'flipped'
|
|
52
52
|
readonly dx: number
|
|
53
53
|
readonly dy: number
|
|
@@ -91,17 +91,36 @@ export namespace Events {
|
|
|
91
91
|
}
|
|
92
92
|
interface DropComplete extends WindowEvent { readonly type: 'dropComplete' }
|
|
93
93
|
|
|
94
|
+
type Any
|
|
95
|
+
= KeyDown
|
|
96
|
+
| KeyUp
|
|
97
|
+
| TextInput
|
|
98
|
+
| MouseMove
|
|
99
|
+
| MouseButtonDown
|
|
100
|
+
| MouseButtonUp
|
|
101
|
+
| MouseWheel
|
|
102
|
+
| Show
|
|
103
|
+
| Hide
|
|
104
|
+
| Expose
|
|
105
|
+
| Minimize
|
|
106
|
+
| Maximize
|
|
107
|
+
| Restore
|
|
108
|
+
| Move
|
|
109
|
+
| Resize
|
|
110
|
+
| Focus
|
|
111
|
+
| Blur
|
|
112
|
+
| Hover
|
|
113
|
+
| Leave
|
|
114
|
+
| BeforeClose
|
|
115
|
+
| Close
|
|
116
|
+
| DropBegin
|
|
117
|
+
| DropText
|
|
118
|
+
| DropFile
|
|
119
|
+
| DropComplete
|
|
94
120
|
}
|
|
95
121
|
|
|
96
122
|
namespace Joystick {
|
|
97
123
|
|
|
98
|
-
interface DeviceEvent extends BaseEvent {
|
|
99
|
-
readonly device: Sdl.Joystick.Device
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
interface DeviceAdd extends DeviceEvent { readonly type: 'deviceAdd' }
|
|
103
|
-
interface DeviceRemove extends DeviceEvent { readonly type: 'deviceRemove' }
|
|
104
|
-
|
|
105
124
|
interface JoystickEvent extends BaseEvent {}
|
|
106
125
|
|
|
107
126
|
interface AxisMotion extends JoystickEvent {
|
|
@@ -131,16 +150,30 @@ export namespace Events {
|
|
|
131
150
|
|
|
132
151
|
interface Close extends JoystickEvent { readonly type: 'close' }
|
|
133
152
|
|
|
153
|
+
type Any
|
|
154
|
+
= AxisMotion
|
|
155
|
+
| BallMotion
|
|
156
|
+
| ButtonDown
|
|
157
|
+
| ButtonUp
|
|
158
|
+
| HatMotion
|
|
159
|
+
| Close
|
|
160
|
+
|
|
134
161
|
}
|
|
135
162
|
|
|
136
|
-
namespace
|
|
163
|
+
namespace JoystickDevice {
|
|
137
164
|
|
|
138
165
|
interface DeviceEvent extends BaseEvent {
|
|
139
|
-
readonly device: Sdl.
|
|
166
|
+
readonly device: Sdl.Joystick.Device
|
|
140
167
|
}
|
|
141
168
|
|
|
142
|
-
interface
|
|
143
|
-
interface
|
|
169
|
+
interface Add extends DeviceEvent { readonly type: 'deviceAdd' }
|
|
170
|
+
interface Remove extends DeviceEvent { readonly type: 'deviceRemove' }
|
|
171
|
+
|
|
172
|
+
type Any = Add | Remove
|
|
173
|
+
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
namespace Controller {
|
|
144
177
|
|
|
145
178
|
interface ControllerEvent extends BaseEvent {}
|
|
146
179
|
|
|
@@ -160,26 +193,57 @@ export namespace Events {
|
|
|
160
193
|
|
|
161
194
|
interface Close extends ControllerEvent { readonly type: 'close' }
|
|
162
195
|
|
|
196
|
+
type Any
|
|
197
|
+
= AxisMotion
|
|
198
|
+
| ButtonDown
|
|
199
|
+
| ButtonUp
|
|
200
|
+
| Remap
|
|
201
|
+
| Close
|
|
202
|
+
|
|
163
203
|
}
|
|
164
204
|
|
|
165
|
-
namespace
|
|
205
|
+
namespace ControllerDevice {
|
|
166
206
|
|
|
167
207
|
interface DeviceEvent extends BaseEvent {
|
|
168
|
-
readonly device: Sdl.
|
|
208
|
+
readonly device: Sdl.Controller.Device
|
|
169
209
|
}
|
|
170
210
|
|
|
171
|
-
interface
|
|
172
|
-
interface
|
|
211
|
+
interface Add extends DeviceEvent { readonly type: 'deviceAdd' }
|
|
212
|
+
interface Remove extends DeviceEvent { readonly type: 'deviceRemove' }
|
|
213
|
+
|
|
214
|
+
type Any = Add | Remove
|
|
215
|
+
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
namespace Audio {
|
|
173
219
|
|
|
174
220
|
interface AudioEvent extends BaseEvent {}
|
|
175
221
|
|
|
176
222
|
interface Close extends AudioEvent { readonly type: 'close' }
|
|
223
|
+
|
|
224
|
+
type Any = Close
|
|
225
|
+
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
namespace AudioDevice {
|
|
229
|
+
|
|
230
|
+
interface DeviceEvent extends BaseEvent {
|
|
231
|
+
readonly device: Sdl.Audio.Device
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
interface Add extends DeviceEvent { readonly type: 'deviceAdd' }
|
|
235
|
+
interface Remove extends DeviceEvent { readonly type: 'deviceRemove' }
|
|
236
|
+
|
|
237
|
+
type Any = Add | Remove
|
|
238
|
+
|
|
177
239
|
}
|
|
178
240
|
|
|
179
241
|
namespace Clipboard {
|
|
180
242
|
|
|
181
243
|
interface Update extends BaseEvent { readonly type: 'update' }
|
|
182
244
|
|
|
245
|
+
type Any = Update
|
|
246
|
+
|
|
183
247
|
}
|
|
184
248
|
}
|
|
185
249
|
|
|
@@ -215,42 +279,42 @@ export namespace Sdl {
|
|
|
215
279
|
namespace Video {
|
|
216
280
|
|
|
217
281
|
type Format
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
282
|
+
= 'rgb332'
|
|
283
|
+
| 'rgb444'
|
|
284
|
+
| 'rgb555'
|
|
285
|
+
| 'bgr555'
|
|
286
|
+
| 'argb4444'
|
|
287
|
+
| 'rgba4444'
|
|
288
|
+
| 'abgr4444'
|
|
289
|
+
| 'bgra4444'
|
|
290
|
+
| 'argb1555'
|
|
291
|
+
| 'rgba5551'
|
|
292
|
+
| 'abgr1555'
|
|
293
|
+
| 'bgra5551'
|
|
294
|
+
| 'rgb565'
|
|
295
|
+
| 'bgr565'
|
|
296
|
+
| 'rgb24'
|
|
297
|
+
| 'bgr24'
|
|
298
|
+
| 'rgb888'
|
|
299
|
+
| 'rgbx8888'
|
|
300
|
+
| 'bgr888'
|
|
301
|
+
| 'bgrx8888'
|
|
302
|
+
| 'argb8888'
|
|
303
|
+
| 'rgba8888'
|
|
304
|
+
| 'abgr8888'
|
|
305
|
+
| 'bgra8888'
|
|
306
|
+
| 'argb2101010'
|
|
307
|
+
| 'rgba32'
|
|
308
|
+
| 'argb32'
|
|
309
|
+
| 'bgra32'
|
|
310
|
+
| 'abgr32'
|
|
311
|
+
| 'yv12'
|
|
312
|
+
| 'iyuv'
|
|
313
|
+
| 'yuy2'
|
|
314
|
+
| 'uyvy'
|
|
315
|
+
| 'yvyu'
|
|
316
|
+
| 'nv12'
|
|
317
|
+
| 'nv21'
|
|
254
318
|
|
|
255
319
|
interface Display {
|
|
256
320
|
readonly name: string
|
|
@@ -284,12 +348,12 @@ export namespace Sdl {
|
|
|
284
348
|
on (event: 'restore', listener: (event: Events.Window.Restore) => void): this
|
|
285
349
|
on (event: 'move', listener: (event: Events.Window.Move) => void): this
|
|
286
350
|
on (event: 'resize', listener: (event: Events.Window.Resize) => void): this
|
|
287
|
-
on (event: 'focus', listener: (event:
|
|
288
|
-
on (event: 'blur', listener: (event:
|
|
289
|
-
on (event: 'hover', listener: (event:
|
|
290
|
-
on (event: 'leave', listener: (event:
|
|
351
|
+
on (event: 'focus', listener: (event: Events.Window.Focus) => void): this
|
|
352
|
+
on (event: 'blur', listener: (event: Events.Window.Blur) => void): this
|
|
353
|
+
on (event: 'hover', listener: (event: Events.Window.Hover) => void): this
|
|
354
|
+
on (event: 'leave', listener: (event: Events.Window.Leave) => void): this
|
|
291
355
|
on (event: 'beforeClose', listener: (event: Events.Window.BeforeClose) => void): this
|
|
292
|
-
on (event: 'close', listener: (event:
|
|
356
|
+
on (event: 'close', listener: (event: Events.Window.Close) => void): this
|
|
293
357
|
on (event: 'keyDown', listener: (event: Events.Window.KeyDown) => void): this
|
|
294
358
|
on (event: 'keyUp', listener: (event: Events.Window.KeyUp) => void): this
|
|
295
359
|
on (event: 'textInput', listener: (event: Events.Window.TextInput) => void): this
|
|
@@ -297,10 +361,11 @@ export namespace Sdl {
|
|
|
297
361
|
on (event: 'mouseButtonUp', listener: (event: Events.Window.MouseButtonUp) => void): this
|
|
298
362
|
on (event: 'mouseMove', listener: (event: Events.Window.MouseMove) => void): this
|
|
299
363
|
on (event: 'mouseWheel', listener: (event: Events.Window.MouseWheel) => void): this
|
|
300
|
-
on (event: 'dropBegin', listener: (event:
|
|
364
|
+
on (event: 'dropBegin', listener: (event: Events.Window.DropBegin) => void): this
|
|
301
365
|
on (event: 'dropText', listener: (event: Events.Window.DropText) => void): this
|
|
302
366
|
on (event: 'dropFile', listener: (event: Events.Window.DropFile) => void): this
|
|
303
|
-
on (event: 'dropComplete', listener: (event:
|
|
367
|
+
on (event: 'dropComplete', listener: (event: Events.Window.DropComplete) => void): this
|
|
368
|
+
on (event: '*', listener: (event: Events.Window.Any) => void): this
|
|
304
369
|
|
|
305
370
|
readonly id: number
|
|
306
371
|
|
|
@@ -399,248 +464,248 @@ export namespace Sdl {
|
|
|
399
464
|
type Scancode = number
|
|
400
465
|
|
|
401
466
|
type ScancodeNames
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
467
|
+
= 'A'
|
|
468
|
+
| 'B'
|
|
469
|
+
| 'C'
|
|
470
|
+
| 'D'
|
|
471
|
+
| 'E'
|
|
472
|
+
| 'F'
|
|
473
|
+
| 'G'
|
|
474
|
+
| 'H'
|
|
475
|
+
| 'I'
|
|
476
|
+
| 'J'
|
|
477
|
+
| 'K'
|
|
478
|
+
| 'L'
|
|
479
|
+
| 'M'
|
|
480
|
+
| 'N'
|
|
481
|
+
| 'O'
|
|
482
|
+
| 'P'
|
|
483
|
+
| 'Q'
|
|
484
|
+
| 'R'
|
|
485
|
+
| 'S'
|
|
486
|
+
| 'T'
|
|
487
|
+
| 'U'
|
|
488
|
+
| 'V'
|
|
489
|
+
| 'W'
|
|
490
|
+
| 'X'
|
|
491
|
+
| 'Y'
|
|
492
|
+
| 'Z'
|
|
493
|
+
| '1'
|
|
494
|
+
| '2'
|
|
495
|
+
| '3'
|
|
496
|
+
| '4'
|
|
497
|
+
| '5'
|
|
498
|
+
| '6'
|
|
499
|
+
| '7'
|
|
500
|
+
| '8'
|
|
501
|
+
| '9'
|
|
502
|
+
| '0'
|
|
503
|
+
| 'RETURN'
|
|
504
|
+
| 'ESCAPE'
|
|
505
|
+
| 'BACKSPACE'
|
|
506
|
+
| 'TAB'
|
|
507
|
+
| 'SPACE'
|
|
508
|
+
| 'MINUS'
|
|
509
|
+
| 'EQUALS'
|
|
510
|
+
| 'LEFTBRACKET'
|
|
511
|
+
| 'RIGHTBRACKET'
|
|
512
|
+
| 'BACKSLASH'
|
|
513
|
+
| 'NONUSHASH'
|
|
514
|
+
| 'SEMICOLON'
|
|
515
|
+
| 'APOSTROPHE'
|
|
516
|
+
| 'GRAVE'
|
|
517
|
+
| 'COMMA'
|
|
518
|
+
| 'PERIOD'
|
|
519
|
+
| 'SLASH'
|
|
520
|
+
| 'CAPSLOCK'
|
|
521
|
+
| 'F1'
|
|
522
|
+
| 'F2'
|
|
523
|
+
| 'F3'
|
|
524
|
+
| 'F4'
|
|
525
|
+
| 'F5'
|
|
526
|
+
| 'F6'
|
|
527
|
+
| 'F7'
|
|
528
|
+
| 'F8'
|
|
529
|
+
| 'F9'
|
|
530
|
+
| 'F10'
|
|
531
|
+
| 'F11'
|
|
532
|
+
| 'F12'
|
|
533
|
+
| 'PRINTSCREEN'
|
|
534
|
+
| 'SCROLLLOCK'
|
|
535
|
+
| 'PAUSE'
|
|
536
|
+
| 'INSERT'
|
|
537
|
+
| 'HOME'
|
|
538
|
+
| 'PAGEUP'
|
|
539
|
+
| 'DELETE'
|
|
540
|
+
| 'END'
|
|
541
|
+
| 'PAGEDOWN'
|
|
542
|
+
| 'RIGHT'
|
|
543
|
+
| 'LEFT'
|
|
544
|
+
| 'DOWN'
|
|
545
|
+
| 'UP'
|
|
546
|
+
| 'NUMLOCKCLEAR'
|
|
547
|
+
| 'KP_DIVIDE'
|
|
548
|
+
| 'KP_MULTIPLY'
|
|
549
|
+
| 'KP_MINUS'
|
|
550
|
+
| 'KP_PLUS'
|
|
551
|
+
| 'KP_ENTER'
|
|
552
|
+
| 'KP_1'
|
|
553
|
+
| 'KP_2'
|
|
554
|
+
| 'KP_3'
|
|
555
|
+
| 'KP_4'
|
|
556
|
+
| 'KP_5'
|
|
557
|
+
| 'KP_6'
|
|
558
|
+
| 'KP_7'
|
|
559
|
+
| 'KP_8'
|
|
560
|
+
| 'KP_9'
|
|
561
|
+
| 'KP_0'
|
|
562
|
+
| 'KP_PERIOD'
|
|
563
|
+
| 'NONUSBACKSLASH'
|
|
564
|
+
| 'APPLICATION'
|
|
565
|
+
| 'POWER'
|
|
566
|
+
| 'KP_EQUALS'
|
|
567
|
+
| 'F13'
|
|
568
|
+
| 'F14'
|
|
569
|
+
| 'F15'
|
|
570
|
+
| 'F16'
|
|
571
|
+
| 'F17'
|
|
572
|
+
| 'F18'
|
|
573
|
+
| 'F19'
|
|
574
|
+
| 'F20'
|
|
575
|
+
| 'F21'
|
|
576
|
+
| 'F22'
|
|
577
|
+
| 'F23'
|
|
578
|
+
| 'F24'
|
|
579
|
+
| 'EXECUTE'
|
|
580
|
+
| 'HELP'
|
|
581
|
+
| 'MENU'
|
|
582
|
+
| 'SELECT'
|
|
583
|
+
| 'STOP'
|
|
584
|
+
| 'AGAIN'
|
|
585
|
+
| 'UNDO'
|
|
586
|
+
| 'CUT'
|
|
587
|
+
| 'COPY'
|
|
588
|
+
| 'PASTE'
|
|
589
|
+
| 'FIND'
|
|
590
|
+
| 'MUTE'
|
|
591
|
+
| 'VOLUMEUP'
|
|
592
|
+
| 'VOLUMEDOWN'
|
|
593
|
+
| 'KP_COMMA'
|
|
594
|
+
| 'KP_EQUALSAS400'
|
|
595
|
+
| 'INTERNATIONAL1'
|
|
596
|
+
| 'INTERNATIONAL2'
|
|
597
|
+
| 'INTERNATIONAL3'
|
|
598
|
+
| 'INTERNATIONAL4'
|
|
599
|
+
| 'INTERNATIONAL5'
|
|
600
|
+
| 'INTERNATIONAL6'
|
|
601
|
+
| 'INTERNATIONAL7'
|
|
602
|
+
| 'INTERNATIONAL8'
|
|
603
|
+
| 'INTERNATIONAL9'
|
|
604
|
+
| 'LANG1'
|
|
605
|
+
| 'LANG2'
|
|
606
|
+
| 'LANG3'
|
|
607
|
+
| 'LANG4'
|
|
608
|
+
| 'LANG5'
|
|
609
|
+
| 'LANG6'
|
|
610
|
+
| 'LANG7'
|
|
611
|
+
| 'LANG8'
|
|
612
|
+
| 'LANG9'
|
|
613
|
+
| 'ALTERASE'
|
|
614
|
+
| 'SYSREQ'
|
|
615
|
+
| 'CANCEL'
|
|
616
|
+
| 'CLEAR'
|
|
617
|
+
| 'PRIOR'
|
|
618
|
+
| 'RETURN2'
|
|
619
|
+
| 'SEPARATOR'
|
|
620
|
+
| 'OUT'
|
|
621
|
+
| 'OPER'
|
|
622
|
+
| 'CLEARAGAIN'
|
|
623
|
+
| 'CRSEL'
|
|
624
|
+
| 'EXSEL'
|
|
625
|
+
| 'KP_00'
|
|
626
|
+
| 'KP_000'
|
|
627
|
+
| 'THOUSANDSSEPARATOR'
|
|
628
|
+
| 'DECIMALSEPARATOR'
|
|
629
|
+
| 'CURRENCYUNIT'
|
|
630
|
+
| 'CURRENCYSUBUNIT'
|
|
631
|
+
| 'KP_LEFTPAREN'
|
|
632
|
+
| 'KP_RIGHTPAREN'
|
|
633
|
+
| 'KP_LEFTBRACE'
|
|
634
|
+
| 'KP_RIGHTBRACE'
|
|
635
|
+
| 'KP_TAB'
|
|
636
|
+
| 'KP_BACKSPACE'
|
|
637
|
+
| 'KP_A'
|
|
638
|
+
| 'KP_B'
|
|
639
|
+
| 'KP_C'
|
|
640
|
+
| 'KP_D'
|
|
641
|
+
| 'KP_E'
|
|
642
|
+
| 'KP_F'
|
|
643
|
+
| 'KP_XOR'
|
|
644
|
+
| 'KP_POWER'
|
|
645
|
+
| 'KP_PERCENT'
|
|
646
|
+
| 'KP_LESS'
|
|
647
|
+
| 'KP_GREATER'
|
|
648
|
+
| 'KP_AMPERSAND'
|
|
649
|
+
| 'KP_DBLAMPERSAND'
|
|
650
|
+
| 'KP_VERTICALBAR'
|
|
651
|
+
| 'KP_DBLVERTICALBAR'
|
|
652
|
+
| 'KP_COLON'
|
|
653
|
+
| 'KP_HASH'
|
|
654
|
+
| 'KP_SPACE'
|
|
655
|
+
| 'KP_AT'
|
|
656
|
+
| 'KP_EXCLAM'
|
|
657
|
+
| 'KP_MEMSTORE'
|
|
658
|
+
| 'KP_MEMRECALL'
|
|
659
|
+
| 'KP_MEMCLEAR'
|
|
660
|
+
| 'KP_MEMADD'
|
|
661
|
+
| 'KP_MEMSUBTRACT'
|
|
662
|
+
| 'KP_MEMMULTIPLY'
|
|
663
|
+
| 'KP_MEMDIVIDE'
|
|
664
|
+
| 'KP_PLUSMINUS'
|
|
665
|
+
| 'KP_CLEAR'
|
|
666
|
+
| 'KP_CLEARENTRY'
|
|
667
|
+
| 'KP_BINARY'
|
|
668
|
+
| 'KP_OCTAL'
|
|
669
|
+
| 'KP_DECIMAL'
|
|
670
|
+
| 'KP_HEXADECIMAL'
|
|
671
|
+
| 'LCTRL'
|
|
672
|
+
| 'LSHIFT'
|
|
673
|
+
| 'LALT'
|
|
674
|
+
| 'LGUI'
|
|
675
|
+
| 'RCTRL'
|
|
676
|
+
| 'RSHIFT'
|
|
677
|
+
| 'RALT'
|
|
678
|
+
| 'RGUI'
|
|
679
|
+
| 'MODE'
|
|
680
|
+
| 'AUDIONEXT'
|
|
681
|
+
| 'AUDIOPREV'
|
|
682
|
+
| 'AUDIOSTOP'
|
|
683
|
+
| 'AUDIOPLAY'
|
|
684
|
+
| 'AUDIOMUTE'
|
|
685
|
+
| 'MEDIASELECT'
|
|
686
|
+
| 'WWW'
|
|
687
|
+
| 'MAIL'
|
|
688
|
+
| 'CALCULATOR'
|
|
689
|
+
| 'COMPUTER'
|
|
690
|
+
| 'AC_SEARCH'
|
|
691
|
+
| 'AC_HOME'
|
|
692
|
+
| 'AC_BACK'
|
|
693
|
+
| 'AC_FORWARD'
|
|
694
|
+
| 'AC_STOP'
|
|
695
|
+
| 'AC_REFRESH'
|
|
696
|
+
| 'AC_BOOKMARKS'
|
|
697
|
+
| 'BRIGHTNESSDOWN'
|
|
698
|
+
| 'BRIGHTNESSUP'
|
|
699
|
+
| 'DISPLAYSWITCH'
|
|
700
|
+
| 'KBDILLUMTOGGLE'
|
|
701
|
+
| 'KBDILLUMDOWN'
|
|
702
|
+
| 'KBDILLUMUP'
|
|
703
|
+
| 'EJECT'
|
|
704
|
+
| 'SLEEP'
|
|
705
|
+
| 'APP1'
|
|
706
|
+
| 'APP2'
|
|
707
|
+
| 'AUDIOREWIND'
|
|
708
|
+
| 'AUDIOFASTFORWARD'
|
|
644
709
|
|
|
645
710
|
type Key = string
|
|
646
711
|
|
|
@@ -660,23 +725,23 @@ export namespace Sdl {
|
|
|
660
725
|
type Button = number
|
|
661
726
|
|
|
662
727
|
type ButtonNames
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
728
|
+
= 'LEFT'
|
|
729
|
+
| 'MIDDLE'
|
|
730
|
+
| 'RIGHT'
|
|
666
731
|
|
|
667
732
|
type Cursor
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
733
|
+
= 'arrow'
|
|
734
|
+
| 'ibeam'
|
|
735
|
+
| 'wait'
|
|
736
|
+
| 'crosshair'
|
|
737
|
+
| 'waitarrow'
|
|
738
|
+
| 'sizenwse'
|
|
739
|
+
| 'sizenesw'
|
|
740
|
+
| 'sizewe'
|
|
741
|
+
| 'sizens'
|
|
742
|
+
| 'sizeall'
|
|
743
|
+
| 'no'
|
|
744
|
+
| 'hand'
|
|
680
745
|
|
|
681
746
|
interface Module {
|
|
682
747
|
readonly BUTTON: { [name in ButtonNames]: number }
|
|
@@ -709,24 +774,24 @@ export namespace Sdl {
|
|
|
709
774
|
}
|
|
710
775
|
|
|
711
776
|
type HatPosition
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
777
|
+
= 'centered'
|
|
778
|
+
| 'up'
|
|
779
|
+
| 'right'
|
|
780
|
+
| 'down'
|
|
781
|
+
| 'left'
|
|
782
|
+
| 'rightup'
|
|
783
|
+
| 'rightdown'
|
|
784
|
+
| 'leftup'
|
|
785
|
+
| 'leftdown'
|
|
721
786
|
|
|
722
787
|
type PowerLevel
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
788
|
+
= 'unknown'
|
|
789
|
+
| 'empty'
|
|
790
|
+
| 'low'
|
|
791
|
+
| 'medium'
|
|
792
|
+
| 'full'
|
|
793
|
+
| 'wired'
|
|
794
|
+
| 'max'
|
|
730
795
|
|
|
731
796
|
interface Device {
|
|
732
797
|
readonly id: number
|
|
@@ -747,6 +812,7 @@ export namespace Sdl {
|
|
|
747
812
|
on (event: 'buttonUp', listener: (event: Events.Joystick.ButtonUp) => void): this
|
|
748
813
|
on (event: 'hatMotion', listener: (event: Events.Joystick.HatMotion) => void): this
|
|
749
814
|
on (event: 'close', listener: (event: Events.Joystick.Close) => void): this
|
|
815
|
+
on (event: '*', listener: (event: Events.Joystick.Any) => void): this
|
|
750
816
|
|
|
751
817
|
readonly device: Device
|
|
752
818
|
readonly firmwareVersion: number
|
|
@@ -777,8 +843,9 @@ export namespace Sdl {
|
|
|
777
843
|
}
|
|
778
844
|
|
|
779
845
|
interface Module {
|
|
780
|
-
on (event: 'deviceAdd', listener: (event: Events.
|
|
781
|
-
on (event: 'deviceRemove', listener: (event: Events.
|
|
846
|
+
on (event: 'deviceAdd', listener: (event: Events.JoystickDevice.Add) => void): this
|
|
847
|
+
on (event: 'deviceRemove', listener: (event: Events.JoystickDevice.Remove) => void): this
|
|
848
|
+
on (event: '*', listener: (event: Events.JoystickDevice.Any) => void): this
|
|
782
849
|
|
|
783
850
|
readonly devices: Device[]
|
|
784
851
|
|
|
@@ -807,6 +874,7 @@ export namespace Sdl {
|
|
|
807
874
|
on (event: 'buttonUp', listener: (event: Events.Controller.ButtonUp) => void): this
|
|
808
875
|
on (event: 'remap', listener: (event: Events.Controller.Remap) => void): this
|
|
809
876
|
on (event: 'close', listener: (event: Events.Controller.Close) => void): this
|
|
877
|
+
on (event: '*', listener: (event: Events.Controller.Any) => void): this
|
|
810
878
|
|
|
811
879
|
readonly device: Device
|
|
812
880
|
readonly firmwareVersion: number
|
|
@@ -863,8 +931,9 @@ export namespace Sdl {
|
|
|
863
931
|
}
|
|
864
932
|
|
|
865
933
|
interface Module {
|
|
866
|
-
on (event: 'deviceAdd', listener: (event: Events.
|
|
867
|
-
on (event: 'deviceRemove', listener: (event: Events.
|
|
934
|
+
on (event: 'deviceAdd', listener: (event: Events.ControllerDevice.Add) => void): this
|
|
935
|
+
on (event: 'deviceRemove', listener: (event: Events.ControllerDevice.Remove) => void): this
|
|
936
|
+
on (event: '*', listener: (event: Events.ControllerDevice.Any) => void): this
|
|
868
937
|
|
|
869
938
|
addMappings (mappings: string[]): void
|
|
870
939
|
|
|
@@ -878,24 +947,24 @@ export namespace Sdl {
|
|
|
878
947
|
namespace Audio {
|
|
879
948
|
|
|
880
949
|
type Format
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
950
|
+
= 's8'
|
|
951
|
+
| 'u8'
|
|
952
|
+
| 's16lsb'
|
|
953
|
+
| 's16msb'
|
|
954
|
+
| 's16sys'
|
|
955
|
+
| 's16'
|
|
956
|
+
| 'u16lsb'
|
|
957
|
+
| 'u16msb'
|
|
958
|
+
| 'u16sys'
|
|
959
|
+
| 'u16'
|
|
960
|
+
| 's32lsb'
|
|
961
|
+
| 's32msb'
|
|
962
|
+
| 's32sys'
|
|
963
|
+
| 's32'
|
|
964
|
+
| 'f32lsb'
|
|
965
|
+
| 'f32msb'
|
|
966
|
+
| 'f32sys'
|
|
967
|
+
| 'f32'
|
|
899
968
|
|
|
900
969
|
interface Device {
|
|
901
970
|
readonly type: "recording"|"playback"
|
|
@@ -912,6 +981,7 @@ export namespace Sdl {
|
|
|
912
981
|
|
|
913
982
|
class AudioInstance {
|
|
914
983
|
on (event: 'close', listener: (event: Events.Audio.Close) => void): this
|
|
984
|
+
on (event: '*', listener: (event: Events.Audio.Any) => void): this
|
|
915
985
|
|
|
916
986
|
readonly id: number
|
|
917
987
|
readonly device: Device
|
|
@@ -955,8 +1025,9 @@ export namespace Sdl {
|
|
|
955
1025
|
}
|
|
956
1026
|
|
|
957
1027
|
interface Module {
|
|
958
|
-
on (event: 'deviceAdd', listener: (event: Events.
|
|
959
|
-
on (event: 'deviceRemove', listener: (event: Events.
|
|
1028
|
+
on (event: 'deviceAdd', listener: (event: Events.AudioDevice.Add) => void): this
|
|
1029
|
+
on (event: 'deviceRemove', listener: (event: Events.AudioDevice.Remove) => void): this
|
|
1030
|
+
on (event: '*', listener: (event: Events.AudioDevice.Any) => void): this
|
|
960
1031
|
|
|
961
1032
|
readonly devices: Device[]
|
|
962
1033
|
|
|
@@ -976,6 +1047,7 @@ export namespace Sdl {
|
|
|
976
1047
|
|
|
977
1048
|
interface Module {
|
|
978
1049
|
on (event: 'update', listener: (event: Events.Clipboard.Update) => void): this
|
|
1050
|
+
on (event: '*', listener: (event: Events.Clipboard.Any) => void): this
|
|
979
1051
|
|
|
980
1052
|
readonly text: string
|
|
981
1053
|
setText (text: string): void
|
|
@@ -995,5 +1067,5 @@ export namespace Sdl {
|
|
|
995
1067
|
}
|
|
996
1068
|
}
|
|
997
1069
|
|
|
998
|
-
const sdl: Sdl.Module
|
|
1070
|
+
declare const sdl: Sdl.Module
|
|
999
1071
|
export = sdl
|