@moddable/typings 5.6.0 → 5.7.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/ChatAudioIO.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Moddable Tech, Inc.
|
|
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
|
+
|
|
21
|
+
declare module "ChatAudioIO" {
|
|
22
|
+
type ChatAudioIOOptions = {
|
|
23
|
+
specifier: "googleGeminiLive" | "openAIRealtime" | "humeAIEVI" | "elevenLabsAgent";
|
|
24
|
+
voiceName?: string;
|
|
25
|
+
instructions?: string;
|
|
26
|
+
|
|
27
|
+
onStateChanged?: (this: ChatAudioIO, state: number) => void;
|
|
28
|
+
onInputTranscript?: (this: ChatAudioIO, text: string, more: boolean) => void;
|
|
29
|
+
onOutputTranscript?: (this: ChatAudioIO, text: string, more: boolean) => void;
|
|
30
|
+
onFunctionCall?: (this: ChatAudioIO, call: any, name: string, parameters: any) => void;
|
|
31
|
+
onInputLevelChanged?: (this: ChatAudioIO, level: number) => void;
|
|
32
|
+
onOutputLevelChanged?: (this: ChatAudioIO, level: number) => void;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
class ChatAudioIO {
|
|
36
|
+
static readonly FAILED: number;
|
|
37
|
+
static readonly DISCONNECTED: number;
|
|
38
|
+
static readonly CONNECTING: number;
|
|
39
|
+
static readonly DISCONNECTING: number;
|
|
40
|
+
static readonly SPEAKING: number;
|
|
41
|
+
static readonly LISTENING: number;
|
|
42
|
+
static readonly WAITING: number;
|
|
43
|
+
|
|
44
|
+
readonly error: string;
|
|
45
|
+
readonly state: number;
|
|
46
|
+
readonly microphone: number | boolean;
|
|
47
|
+
readonly volume: number;
|
|
48
|
+
|
|
49
|
+
constructor(options: ChatAudioIOOptions);
|
|
50
|
+
|
|
51
|
+
close(): void;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Controls whether microphone input is sent to AI service.
|
|
55
|
+
* @param microphone true sends audio to cloud, false disables transmission.
|
|
56
|
+
*/
|
|
57
|
+
changeMicrophone(microphone: boolean): void;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Changes the audio output volume.
|
|
61
|
+
* @param volume Number between 0.0 (silent) and 1.0 (maximum volume).
|
|
62
|
+
*/
|
|
63
|
+
changeVolume(volume: number): void;
|
|
64
|
+
|
|
65
|
+
connect(): void;
|
|
66
|
+
disconnect(): void;
|
|
67
|
+
|
|
68
|
+
failed(message: { string: string }): void;
|
|
69
|
+
sendFunctionResult(call: any, name: string, result: any): void;
|
|
70
|
+
sendText(text: string): void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export default ChatAudioIO;
|
|
74
|
+
}
|
package/package.json
CHANGED
package/xs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2025 Moddable Tech, Inc
|
|
3
3
|
*
|
|
4
4
|
* This file is part of the Moddable SDK Tools.
|
|
5
5
|
*
|
|
@@ -80,10 +80,4 @@ interface Math {
|
|
|
80
80
|
mod(a: number, b: number): number
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
// already defined by TypeScript (because Web)
|
|
84
|
-
// interface Error {
|
|
85
|
-
// stack: string
|
|
86
|
-
// }
|
|
87
|
-
|
|
88
|
-
|
|
89
83
|
// Compartment?
|
|
File without changes
|
|
File without changes
|