@moddable/typings 5.6.0 → 5.8.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.
@@ -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/crypt.d.ts ADDED
@@ -0,0 +1,34 @@
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
+
21
+ declare module "crypt" {
22
+ type DigestType = "MD5" | "SHA1" | "SHA224" | "SHA256" | "SHA384" | "SHA512";
23
+
24
+ export class Digest {
25
+ constructor(type: DigestType);
26
+
27
+ write(message: string | ArrayBuffer): void;
28
+ close(): ArrayBuffer;
29
+ reset(): void;
30
+ get blockSize(): number;
31
+ get outputSize(): number;
32
+ update(message: string | ArrayBuffer): void;
33
+ }
34
+ }
package/net.d.ts CHANGED
@@ -26,11 +26,11 @@ declare module "net" {
26
26
  /**
27
27
  * The IP address of the network connection as a `String`, e.g. "10.0.1.4"
28
28
  */
29
- get(what: "IP"): string;
29
+ get(what: "IP", mode?: "station" | "ap" | "ethernet"): string;
30
30
  /**
31
31
  * The MAC address of the device as a `String`, e.g. "A4:D1:8C:DB:C0:20"
32
32
  */
33
- get(what: "MAC"): string;
33
+ get(what: "MAC", mode?: "station" | "ap"| "ethernet"): string;
34
34
  /**
35
35
  * The name of the Wi-Fi access point as a `String`, e.g. "Moddable Wi-Fi"
36
36
  */
@@ -64,4 +64,4 @@ declare module "net" {
64
64
  ): void;
65
65
  }
66
66
  export {Net as default};
67
- }
67
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moddable/typings",
3
- "version": "5.6.0",
3
+ "version": "5.8.0",
4
4
  "main": "",
5
5
  "types": [
6
6
  "xs.d.ts",
package/xs.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2020-2023 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
  *
@@ -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