@moddable/typings 8.1.1 → 8.2.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/commodetto/Poco.d.ts +7 -1
- package/embedded/update.d.ts +43 -0
- package/embedded_io/digital.d.ts +2 -0
- package/embedded_io/digitalbank.d.ts +4 -0
- package/embedded_network/dnssd.d.ts +84 -0
- package/embedded_network/http/server.d.ts +67 -0
- package/embedded_network/interface/wifi.d.ts +2 -0
- package/mc/ffi.d.ts +32 -0
- package/package.json +1 -1
- package/piu/MC-types.d.ts +2 -0
- package/piu/MC.d.ts +3 -1
- package/tsconfig.base.json +33 -0
- package/web/websocket.d.ts +10 -0
package/commodetto/Poco.d.ts
CHANGED
|
@@ -102,8 +102,14 @@ declare module "commodetto/Poco" {
|
|
|
102
102
|
|
|
103
103
|
const Poco: PocoConstructor
|
|
104
104
|
|
|
105
|
+
export interface Screen extends PixelsOut {
|
|
106
|
+
command?(id: number, data?: ByteBuffer): void;
|
|
107
|
+
frameRate?: number;
|
|
108
|
+
syncFrames?: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
105
111
|
global {
|
|
106
|
-
const screen:
|
|
112
|
+
const screen: Screen
|
|
107
113
|
}
|
|
108
114
|
|
|
109
115
|
export default Poco
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026 Moddable Tech, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the Moddable SDK Runtime.
|
|
5
|
+
*
|
|
6
|
+
* The Moddable SDK Runtime is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Lesser 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 Runtime 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 Lesser General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
17
|
+
* along with the Moddable SDK Runtime. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
declare module "embedded:update" {
|
|
22
|
+
import type { Flash } from "embedded:storage/flash";
|
|
23
|
+
|
|
24
|
+
export interface UpdateOpenOptions {
|
|
25
|
+
partition: Flash;
|
|
26
|
+
mode?: "a" | "w";
|
|
27
|
+
byteLength?: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface Updater {
|
|
31
|
+
close(): void;
|
|
32
|
+
complete(): void;
|
|
33
|
+
write(bytes: ByteBuffer): void;
|
|
34
|
+
write(bytes: ByteBuffer, byteOffset: number): void;
|
|
35
|
+
format: "buffer";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const Update: {
|
|
39
|
+
open(options: UpdateOpenOptions): Updater;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default Update;
|
|
43
|
+
}
|
package/embedded_io/digital.d.ts
CHANGED
|
@@ -41,6 +41,10 @@ declare module "embedded:io/digitalbank" {
|
|
|
41
41
|
pins: number;
|
|
42
42
|
mode: Mode;
|
|
43
43
|
bank?: number | string;
|
|
44
|
+
activeLow?: boolean;
|
|
45
|
+
initialValue?: number;
|
|
46
|
+
rises?: number;
|
|
47
|
+
falls?: number;
|
|
44
48
|
onReadable?: (this: DigitalBank, trigger: number) => void;
|
|
45
49
|
format?: "number";
|
|
46
50
|
target?: any;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026 Moddable Tech, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the Moddable SDK Runtime.
|
|
5
|
+
*
|
|
6
|
+
* The Moddable SDK Runtime is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Lesser 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 Runtime 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 Lesser General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
17
|
+
* along with the Moddable SDK Runtime. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
declare module "embedded:network/dnssd" {
|
|
22
|
+
import type UDP from "embedded:io/socket/udp";
|
|
23
|
+
|
|
24
|
+
export interface DNSSDSocketOptions {
|
|
25
|
+
io: typeof UDP;
|
|
26
|
+
address?: string;
|
|
27
|
+
multicast?: string;
|
|
28
|
+
timeToLive?: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface DNSSDOptions {
|
|
32
|
+
socket: DNSSDSocketOptions;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ClaimOptions {
|
|
36
|
+
host: string;
|
|
37
|
+
onReady?(): void;
|
|
38
|
+
onError?(): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ClaimHandle {
|
|
42
|
+
close(): void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ServiceObject {
|
|
46
|
+
name: string;
|
|
47
|
+
host: string;
|
|
48
|
+
address: string;
|
|
49
|
+
port: number;
|
|
50
|
+
txt?: Map<string, string | undefined>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface DiscoverOptions {
|
|
54
|
+
serviceType: string;
|
|
55
|
+
onFound?(service: ServiceObject): void;
|
|
56
|
+
onUpdate?(service: ServiceObject): void;
|
|
57
|
+
onLost?(service: ServiceObject): void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface DiscoverHandle {
|
|
61
|
+
close(): void;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface AdvertiseOptions {
|
|
65
|
+
serviceType: string;
|
|
66
|
+
host: string;
|
|
67
|
+
name?: string;
|
|
68
|
+
port: number;
|
|
69
|
+
txt?: Map<string, string | ByteBuffer>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface AdvertiseHandle {
|
|
73
|
+
close(): void;
|
|
74
|
+
updateTXT(txt: Map<string, string | ByteBuffer>): void;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export default class DNSSD {
|
|
78
|
+
constructor(options: DNSSDOptions);
|
|
79
|
+
close(): void;
|
|
80
|
+
claim(options: ClaimOptions): ClaimHandle;
|
|
81
|
+
discover(options: DiscoverOptions): DiscoverHandle;
|
|
82
|
+
advertise(options: AdvertiseOptions): AdvertiseHandle;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026 Moddable Tech, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the Moddable SDK Runtime.
|
|
5
|
+
*
|
|
6
|
+
* The Moddable SDK Runtime is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Lesser 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 Runtime 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 Lesser General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
17
|
+
* along with the Moddable SDK Runtime. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
declare module "embedded:network/http/server" {
|
|
22
|
+
import type Listener from "embedded:io/socket/listener";
|
|
23
|
+
import type TCP from "embedded:io/socket/tcp";
|
|
24
|
+
|
|
25
|
+
export interface HTTPRequest {
|
|
26
|
+
method: string;
|
|
27
|
+
path: string;
|
|
28
|
+
headers: Map<string, string>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface HTTPResponse {
|
|
32
|
+
status: number;
|
|
33
|
+
headers: Map<string, string | number>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface HTTPConnectionHandlers {
|
|
37
|
+
onRequest?(this: HTTPConnection, request: HTTPRequest): void;
|
|
38
|
+
onReadable?(this: HTTPConnection, count: number): void;
|
|
39
|
+
onResponse?(this: HTTPConnection, response: HTTPResponse): void;
|
|
40
|
+
onWritable?(this: HTTPConnection, count: number): void;
|
|
41
|
+
onDone?(this: HTTPConnection): void;
|
|
42
|
+
onError?(this: HTTPConnection): void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface HTTPConnection {
|
|
46
|
+
close(): void;
|
|
47
|
+
detach(): TCP;
|
|
48
|
+
accept(options: HTTPConnectionHandlers): void;
|
|
49
|
+
respond(options: HTTPResponse): void;
|
|
50
|
+
read(count?: number): ArrayBuffer | undefined;
|
|
51
|
+
write(bytes?: ByteBuffer): number;
|
|
52
|
+
route: HTTPConnectionHandlers;
|
|
53
|
+
format: "buffer";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface HTTPServerOptions {
|
|
57
|
+
io: typeof Listener;
|
|
58
|
+
port?: number;
|
|
59
|
+
onConnect(this: HTTPServer, connection: HTTPConnection): void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default class HTTPServer {
|
|
63
|
+
constructor(options: HTTPServerOptions);
|
|
64
|
+
close(): void;
|
|
65
|
+
readonly port: number;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -54,6 +54,8 @@ declare module "embedded:network/interface/wifi" {
|
|
|
54
54
|
readonly connection: number;
|
|
55
55
|
readonly address: string | undefined;
|
|
56
56
|
readonly MAC: string | undefined;
|
|
57
|
+
readonly SSID: string | undefined;
|
|
58
|
+
readonly RSSI: number | undefined;
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
export default WiFi;
|
package/mc/ffi.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026 Moddable Tech, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the Moddable SDK Runtime.
|
|
5
|
+
*
|
|
6
|
+
* The Moddable SDK Runtime is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Lesser 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 Runtime 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 Lesser General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
17
|
+
* along with the Moddable SDK Runtime. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
// Fallback typing for mc/ffi. When a project's manifest declares ffi.functions,
|
|
22
|
+
// mcconfig generates a project-specific mc.ffi.d.ts with the exact signatures
|
|
23
|
+
// of the bound native functions; that generated typing takes precedence via
|
|
24
|
+
// the per-build tsconfig paths map.
|
|
25
|
+
|
|
26
|
+
declare module "mc/ffi" {
|
|
27
|
+
interface FFI {
|
|
28
|
+
[name: string]: (...args: any[]) => any;
|
|
29
|
+
}
|
|
30
|
+
const FFI: { new(): FFI };
|
|
31
|
+
export default FFI;
|
|
32
|
+
}
|
package/package.json
CHANGED
package/piu/MC-types.d.ts
CHANGED
|
@@ -145,6 +145,7 @@ export interface ContentDictionary
|
|
|
145
145
|
name?: string;
|
|
146
146
|
anchor?: string;
|
|
147
147
|
Behavior?: BehaviorConstructor;
|
|
148
|
+
behavior?: Behavior;
|
|
148
149
|
skin?: Skin | SkinDictionary;
|
|
149
150
|
Skin?: SkinConstructor;
|
|
150
151
|
style?: Style | StyleDictionary;
|
|
@@ -424,6 +425,7 @@ export interface Application extends Container {
|
|
|
424
425
|
displayListLength: number;
|
|
425
426
|
commandListLength: number;
|
|
426
427
|
touchCount: number;
|
|
428
|
+
purge(): void;
|
|
427
429
|
}
|
|
428
430
|
export interface ApplicationDictionary extends ContainerDictionary {
|
|
429
431
|
displayListLength?: number;
|
package/piu/MC.d.ts
CHANGED
|
@@ -18,8 +18,10 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
/// <reference path="../easing.d.ts" />
|
|
22
|
+
|
|
21
23
|
declare module "piu/MC" {
|
|
22
|
-
import {} from "commodetto/Poco"; // for global screen
|
|
24
|
+
import { } from "commodetto/Poco"; // for global screen
|
|
23
25
|
import type * as MC from "piu/MC-types";
|
|
24
26
|
|
|
25
27
|
global {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Base tsconfig for projects using @moddable/typings. Project tsconfig.json should `extends` this and add its own outDir, include, sourceMap, etc.",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"lib": ["es2025"],
|
|
5
|
+
"module": "preserve",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"target": "ES2025",
|
|
8
|
+
"baseUrl": ".",
|
|
9
|
+
"paths": {
|
|
10
|
+
"embedded:io/*": ["./embedded_io/*"],
|
|
11
|
+
"embedded:io/socket/*": ["./embedded_io/socket/*"],
|
|
12
|
+
"embedded:io/audio/*": ["./embedded_io/audio/*"],
|
|
13
|
+
"embedded:io/bluetoothle/*": ["./embedded_io/ble/*"],
|
|
14
|
+
"embedded:network/*": ["./embedded_network/*"],
|
|
15
|
+
"embedded:network/http/*": ["./embedded_network/http/*"],
|
|
16
|
+
"embedded:network/interface/*": ["./embedded_network/interface/*"],
|
|
17
|
+
"embedded:network/mqtt/*": ["./embedded_network/mqtt/*"],
|
|
18
|
+
"embedded:network/websocket/*": ["./embedded_network/websocket/*"],
|
|
19
|
+
"embedded:network/dns/resolver/*": ["./embedded_network/dns/resolver/*"],
|
|
20
|
+
"embedded:network/ntp/*": ["./embedded_network/ntp/*"],
|
|
21
|
+
"embedded:storage/*": ["./embedded/storage/*"],
|
|
22
|
+
"embedded:provider/*": ["./embedded_provider/*"],
|
|
23
|
+
"embedded:*": ["./embedded/*"],
|
|
24
|
+
"mc/*": ["./mc/*"],
|
|
25
|
+
"mod/*": ["./mod/*"],
|
|
26
|
+
"pins/*": ["./pins/*"],
|
|
27
|
+
"piu/*": ["./piu/*"],
|
|
28
|
+
"commodetto/*": ["./commodetto/*"],
|
|
29
|
+
"text/*": ["./text/*"],
|
|
30
|
+
"*": ["./*"]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
package/web/websocket.d.ts
CHANGED
|
@@ -55,6 +55,16 @@ declare module "web/websocket" {
|
|
|
55
55
|
constructor(url: string, protocol?: string);
|
|
56
56
|
constructor(options: WebSocketOptions);
|
|
57
57
|
|
|
58
|
+
static readonly CONNECTING: 0;
|
|
59
|
+
static readonly OPEN: 1;
|
|
60
|
+
static readonly CLOSING: 2;
|
|
61
|
+
static readonly CLOSED: 3;
|
|
62
|
+
|
|
63
|
+
readonly CONNECTING: 0;
|
|
64
|
+
readonly OPEN: 1;
|
|
65
|
+
readonly CLOSING: 2;
|
|
66
|
+
readonly CLOSED: 3;
|
|
67
|
+
|
|
58
68
|
binaryType: "arraybuffer";
|
|
59
69
|
readonly bufferedAmount: number;
|
|
60
70
|
readonly extensions: string;
|