@moddable/typings 5.5.0 → 5.6.0
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/embedded_io/audioin.d.ts +52 -0
- package/embedded_io/audioout.d.ts +52 -0
- package/package.json +1 -1
- package/worker.d.ts +2 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Satoshi Tanaka
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the Moddable SDK Tools.
|
|
5
|
+
*
|
|
6
|
+
* The Moddable SDK Tools is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* The Moddable SDK Tools is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with the Moddable SDK Tools. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
declare module "embedded:io/audio/in" {
|
|
21
|
+
import { Buffer } from "embedded:io/_common";
|
|
22
|
+
|
|
23
|
+
type AudioType = "LPCM";
|
|
24
|
+
|
|
25
|
+
interface AudioInOptions {
|
|
26
|
+
bitsPerSample?: 8 | 16;
|
|
27
|
+
channels?: 1 | 2;
|
|
28
|
+
sampleRate?: number;
|
|
29
|
+
audioType?: AudioType;
|
|
30
|
+
format?: "buffer";
|
|
31
|
+
target?: any;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
class AudioIn {
|
|
35
|
+
constructor(options: AudioInOptions & {
|
|
36
|
+
onReadable?: (this: AudioIn, byteLength: number, sampleCount?: number) => void;
|
|
37
|
+
});
|
|
38
|
+
read(byteLength?: number): ArrayBuffer
|
|
39
|
+
read(buffer: Buffer): number
|
|
40
|
+
start(): void;
|
|
41
|
+
stop(options?: { flush?: boolean }): void
|
|
42
|
+
close(): void;
|
|
43
|
+
readonly bitsPerSample: 8 | 16;
|
|
44
|
+
readonly channels: 1 | 2;
|
|
45
|
+
readonly sampleRate: number;
|
|
46
|
+
readonly audioType: AudioType;
|
|
47
|
+
get format(): "buffer"
|
|
48
|
+
set format(value: "buffer")
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { AudioIn as default };
|
|
52
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Satoshi Tanaka
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the Moddable SDK Tools.
|
|
5
|
+
*
|
|
6
|
+
* The Moddable SDK Tools is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* The Moddable SDK Tools is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with the Moddable SDK Tools. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
declare module "embedded:io/audio/out" {
|
|
21
|
+
import { Buffer } from "embedded:io/_common";
|
|
22
|
+
|
|
23
|
+
type AudioType = "LPCM";
|
|
24
|
+
|
|
25
|
+
interface AudioOutOptions {
|
|
26
|
+
bitsPerSample?: 8 | 16;
|
|
27
|
+
channels?: 1 | 2;
|
|
28
|
+
sampleRate?: number;
|
|
29
|
+
audioType?: AudioType;
|
|
30
|
+
format?: "buffer";
|
|
31
|
+
target?: any;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
class AudioOut {
|
|
35
|
+
constructor(options?: AudioOutOptions & {
|
|
36
|
+
onWritable?: (this: AudioOut, byteLength: number, sampleCount?: number) => void;
|
|
37
|
+
});
|
|
38
|
+
write(buffer: Buffer): void;
|
|
39
|
+
start(): void;
|
|
40
|
+
stop(options?: { flush?: boolean }): void;
|
|
41
|
+
|
|
42
|
+
readonly audioType: AudioType;
|
|
43
|
+
readonly bitsPerSample: 8 | 16;
|
|
44
|
+
readonly channels: 1 | 2;
|
|
45
|
+
readonly sampleRate: number;
|
|
46
|
+
get format(): "buffer"
|
|
47
|
+
set format(value: "buffer")
|
|
48
|
+
volume: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { AudioOut as default };
|
|
52
|
+
}
|
package/package.json
CHANGED
package/worker.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2020 Moddable Tech, Inc
|
|
2
|
+
* Copyright (c) 2020-2025 Moddable Tech, Inc
|
|
3
3
|
*
|
|
4
4
|
* This file is part of the Moddable SDK Tools.
|
|
5
5
|
*
|
|
@@ -36,6 +36,7 @@ declare module "worker" {
|
|
|
36
36
|
name?: number;
|
|
37
37
|
symbol?: number;
|
|
38
38
|
};
|
|
39
|
+
nativeStack?: number;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
interface MessagePort {
|