@moddable/typings 1.0.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/Resource.d.ts +30 -0
- package/base64.d.ts +27 -0
- package/ble/hidclient.d.ts +95 -0
- package/ble/index.d.ts +1 -0
- package/ble.d.ts +732 -0
- package/commodetto/Bitmap.d.ts +53 -0
- package/commodetto/PixelsOut.d.ts +67 -0
- package/commodetto/Poco.d.ts +104 -0
- package/commodetto/index.d.ts +1 -0
- package/commodetto/outline.d.ts +101 -0
- package/commodetto/parseBMF.d.ts +34 -0
- package/commodetto/parseBMP.d.ts +25 -0
- package/commodetto/parseRLE.d.ts +25 -0
- package/commodetto/readJPEG.d.ts +39 -0
- package/console.d.ts +39 -0
- package/crc.d.ts +35 -0
- package/debug.d.ts +26 -0
- package/deepEqual.d.ts +23 -0
- package/dns/index.d.ts +1 -0
- package/dns/parser.d.ts +37 -0
- package/dns/serializer.d.ts +41 -0
- package/dns/server.d.ts +27 -0
- package/dns.d.ts +55 -0
- package/embedded_io/_common.d.ts +27 -0
- package/embedded_io/analog.d.ts +39 -0
- package/embedded_io/digital.d.ts +65 -0
- package/embedded_io/digitalbank.d.ts +56 -0
- package/embedded_io/i2c.d.ts +44 -0
- package/embedded_io/index.d.ts +1 -0
- package/embedded_io/pulsecount.d.ts +39 -0
- package/embedded_io/pwm.d.ts +38 -0
- package/embedded_io/serial.d.ts +61 -0
- package/embedded_io/smbus.d.ts +43 -0
- package/embedded_io/socket/listener.d.ts +36 -0
- package/embedded_io/socket/tcp.d.ts +51 -0
- package/embedded_io/socket/udp.d.ts +46 -0
- package/embedded_io/spi.d.ts +45 -0
- package/embedded_io/system.d.ts +36 -0
- package/embedded_provider/builtin.d.ts +57 -0
- package/embedded_provider/index.d.ts +1 -0
- package/file.d.ts +67 -0
- package/flash.d.ts +33 -0
- package/global.d.ts +9 -0
- package/hex.d.ts +27 -0
- package/http.d.ts +125 -0
- package/instrumentation.d.ts +60 -0
- package/mc/config.d.ts +24 -0
- package/mc/index.d.ts +1 -0
- package/mcpack.d.ts +41 -0
- package/mdns.d.ts +47 -0
- package/modules.d.ts +28 -0
- package/net.d.ts +67 -0
- package/package.json +14 -0
- package/ping.d.ts +38 -0
- package/pins/analog.d.ts +26 -0
- package/pins/audioin.d.ts +31 -0
- package/pins/audioout.d.ts +85 -0
- package/pins/digital/monitor.d.ts +41 -0
- package/pins/digital.d.ts +46 -0
- package/pins/i2c.d.ts +40 -0
- package/pins/index.d.ts +1 -0
- package/pins/pwm.d.ts +28 -0
- package/pins/rmt.d.ts +48 -0
- package/pins/servo.d.ts +28 -0
- package/pins/smbus.d.ts +47 -0
- package/piu/CombTransition.d.ts +25 -0
- package/piu/MC.d.ts +580 -0
- package/piu/Sound.d.ts +43 -0
- package/piu/Timeline.d.ts +50 -0
- package/piu/WipeTransition.d.ts +25 -0
- package/piu/index.d.ts +1 -0
- package/piu/shape.d.ts +43 -0
- package/preference.d.ts +29 -0
- package/securesocket.d.ts +38 -0
- package/sntp.d.ts +42 -0
- package/socket.d.ts +97 -0
- package/structuredClone.d.ts +23 -0
- package/telnet.d.ts +27 -0
- package/text/decoder.d.ts +46 -0
- package/text/encoder.d.ts +38 -0
- package/text/index.d.ts +1 -0
- package/time.d.ts +31 -0
- package/timer.d.ts +47 -0
- package/uuid.d.ts +24 -0
- package/websocket.d.ts +58 -0
- package/wifi.d.ts +61 -0
- package/worker.d.ts +44 -0
- package/xs.d.ts +89 -0
- package/zip.d.ts +29 -0
package/dns/server.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2019-2020 Bradley Farias
|
|
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 "dns/server" {
|
|
22
|
+
class Server {
|
|
23
|
+
constructor(callback: (message: number, value?: string) => string);
|
|
24
|
+
close(): void;
|
|
25
|
+
}
|
|
26
|
+
export {Server as default};
|
|
27
|
+
}
|
package/dns.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2019-2020 Bradley Farias
|
|
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 "dns" {
|
|
22
|
+
// pulled from
|
|
23
|
+
// const impl: typeof import('../modules/network/dns/dns'),
|
|
24
|
+
var DNS: {
|
|
25
|
+
CLASS: {
|
|
26
|
+
IN: number,
|
|
27
|
+
NONE: number,
|
|
28
|
+
ANY: number,
|
|
29
|
+
},
|
|
30
|
+
OPCODE: {
|
|
31
|
+
QUERY: number,
|
|
32
|
+
UPDATE: number,
|
|
33
|
+
},
|
|
34
|
+
RR: {
|
|
35
|
+
A: number,
|
|
36
|
+
PTR: number,
|
|
37
|
+
TXT: number,
|
|
38
|
+
AAAA: number,
|
|
39
|
+
SRV: number,
|
|
40
|
+
OPT: number,
|
|
41
|
+
NSEC: number,
|
|
42
|
+
ANY: number,
|
|
43
|
+
},
|
|
44
|
+
SECTION: {
|
|
45
|
+
QUESTION: number,
|
|
46
|
+
ANSWER: number,
|
|
47
|
+
AUTHORITATIVE: number,
|
|
48
|
+
ADDITIONAL: number,
|
|
49
|
+
ZONE: number,
|
|
50
|
+
PREREQUISITE: number,
|
|
51
|
+
UPDATE: number,
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
export {DNS as default};
|
|
55
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Shinya Ishikawa
|
|
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
|
+
|
|
22
|
+
declare module "embedded:io/_common" {
|
|
23
|
+
// This should be extended for future specification
|
|
24
|
+
export type PinSpecifier = number
|
|
25
|
+
export type PortSpecifier = number
|
|
26
|
+
export type Buffer = ArrayBuffer | HostBuffer | Uint8Array | Uint8ClampedArray | Int8Array | SharedArrayBuffer | DataView
|
|
27
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Shinya Ishikawa
|
|
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
|
+
|
|
22
|
+
declare module "embedded:io/analog" {
|
|
23
|
+
import { PinSpecifier } from "embedded:io/_common";
|
|
24
|
+
class Analog {
|
|
25
|
+
constructor(options: {
|
|
26
|
+
pin: PinSpecifier;
|
|
27
|
+
resolution?: number;
|
|
28
|
+
onReadable?: (this: Analog) => void;
|
|
29
|
+
format?: "number";
|
|
30
|
+
});
|
|
31
|
+
readonly resolution: number;
|
|
32
|
+
onReadable?: () => void;
|
|
33
|
+
read(): number;
|
|
34
|
+
get format(): "number"
|
|
35
|
+
set format(value: "number")
|
|
36
|
+
target?: any;
|
|
37
|
+
}
|
|
38
|
+
export default Analog;
|
|
39
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Shinya Ishikawa
|
|
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 "embedded:io/digital" {
|
|
22
|
+
import type { PinSpecifier } from "embedded:io/_common";
|
|
23
|
+
|
|
24
|
+
type Edge = number;
|
|
25
|
+
|
|
26
|
+
type Mode =
|
|
27
|
+
| typeof Digital.Input
|
|
28
|
+
| typeof Digital.InputPullUp
|
|
29
|
+
| typeof Digital.InputPullDown
|
|
30
|
+
| typeof Digital.InputPullUpDown
|
|
31
|
+
| typeof Digital.Output
|
|
32
|
+
| typeof Digital.OutputOpenDrain
|
|
33
|
+
|
|
34
|
+
class Digital {
|
|
35
|
+
static readonly Input: unknown
|
|
36
|
+
static readonly InputPullUp: unknown
|
|
37
|
+
static readonly InputPullDown: unknown
|
|
38
|
+
static readonly InputPullUpDown: unknown
|
|
39
|
+
static readonly Output: unknown
|
|
40
|
+
static readonly OutputOpenDrain: unknown
|
|
41
|
+
static readonly Rising: Edge;
|
|
42
|
+
static readonly Falling: Edge;
|
|
43
|
+
|
|
44
|
+
constructor(options: {
|
|
45
|
+
pin: PinSpecifier;
|
|
46
|
+
mode: Mode;
|
|
47
|
+
format?: "number";
|
|
48
|
+
target?: any;
|
|
49
|
+
} & ({
|
|
50
|
+
onReadable: (this: Digital) => void;
|
|
51
|
+
edge: Edge;
|
|
52
|
+
} | {
|
|
53
|
+
edge?: Edge;
|
|
54
|
+
}));
|
|
55
|
+
|
|
56
|
+
write(value: 0 | 1): void;
|
|
57
|
+
read(): 0 | 1;
|
|
58
|
+
close(): void;
|
|
59
|
+
|
|
60
|
+
get format(): "number"
|
|
61
|
+
set format(value: "number")
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default Digital;
|
|
65
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Shinya Ishikawa
|
|
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 "embedded:io/digitalbank" {
|
|
22
|
+
type Mode =
|
|
23
|
+
| typeof DigitalBank.Input
|
|
24
|
+
| typeof DigitalBank.InputPullUp
|
|
25
|
+
| typeof DigitalBank.InputPullDown
|
|
26
|
+
| typeof DigitalBank.InputPullUpDown
|
|
27
|
+
| typeof DigitalBank.Output
|
|
28
|
+
| typeof DigitalBank.OutputOpenDrain
|
|
29
|
+
|
|
30
|
+
class DigitalBank {
|
|
31
|
+
static readonly Input: unknown
|
|
32
|
+
static readonly InputPullUp: unknown
|
|
33
|
+
static readonly InputPullDown: unknown
|
|
34
|
+
static readonly InputPullUpDown: unknown
|
|
35
|
+
static readonly Output: unknown
|
|
36
|
+
static readonly OutputOpenDrain: unknown
|
|
37
|
+
|
|
38
|
+
constructor(dictionary: {
|
|
39
|
+
pins: number;
|
|
40
|
+
mode: Mode;
|
|
41
|
+
bank?: number | string;
|
|
42
|
+
onReadable?: (this: DigitalBank, trigger: number) => void;
|
|
43
|
+
format?: "number";
|
|
44
|
+
target?: any;
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
close(): void;
|
|
48
|
+
read(): number;
|
|
49
|
+
write(value: number): void;
|
|
50
|
+
|
|
51
|
+
get format(): "number"
|
|
52
|
+
set format(value: "number")
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default DigitalBank;
|
|
56
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Shinya Ishikawa
|
|
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
|
+
|
|
22
|
+
declare module "embedded:io/i2c" {
|
|
23
|
+
import { Buffer, PinSpecifier, PortSpecifier } from "embedded:io/_common";
|
|
24
|
+
class I2C {
|
|
25
|
+
constructor(options: {
|
|
26
|
+
data: PinSpecifier;
|
|
27
|
+
clock: PinSpecifier;
|
|
28
|
+
hz: number;
|
|
29
|
+
address: number;
|
|
30
|
+
port?: PortSpecifier;
|
|
31
|
+
format?: "buffer";
|
|
32
|
+
target?: any;
|
|
33
|
+
});
|
|
34
|
+
readonly resolution: number;
|
|
35
|
+
|
|
36
|
+
write(value: Buffer, stop?: boolean): void;
|
|
37
|
+
read(byteLength: number, stop?: boolean): ArrayBuffer;
|
|
38
|
+
read(buffer: Buffer, stop?: boolean): ArrayBuffer;
|
|
39
|
+
get format(): "buffer"
|
|
40
|
+
set format(value: "buffer")
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default I2C;
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Blank
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Shinya Ishikawa
|
|
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 "embedded:io/pulsecount" {
|
|
22
|
+
import { PinSpecifier } from "embedded:io/_common";
|
|
23
|
+
class PulseCount {
|
|
24
|
+
constructor (options: {
|
|
25
|
+
signal: PinSpecifier;
|
|
26
|
+
control: PinSpecifier;
|
|
27
|
+
onReadable?: (this: PulseCount) => void;
|
|
28
|
+
onError?: (this: PulseCount) => void;
|
|
29
|
+
format?: "number";
|
|
30
|
+
target?: any;
|
|
31
|
+
});
|
|
32
|
+
read(): number;
|
|
33
|
+
write(count: number): void;
|
|
34
|
+
get format(): "number";
|
|
35
|
+
set format(value: "number");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default PulseCount;
|
|
39
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Shinya Ishikawa
|
|
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
|
+
|
|
22
|
+
declare module "embedded:io/pwm" {
|
|
23
|
+
import { PinSpecifier } from "embedded:io/_common";
|
|
24
|
+
class PWM {
|
|
25
|
+
constructor(options: {
|
|
26
|
+
pin: PinSpecifier;
|
|
27
|
+
hz?: number;
|
|
28
|
+
format?: "number";
|
|
29
|
+
target?: any;
|
|
30
|
+
});
|
|
31
|
+
readonly resolution: number;
|
|
32
|
+
readonly hz: number;
|
|
33
|
+
write(value: number): void;
|
|
34
|
+
get format(): "number"
|
|
35
|
+
set format(value: "number")
|
|
36
|
+
}
|
|
37
|
+
export default PWM;
|
|
38
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Shinya Ishikawa
|
|
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 "embedded:io/serial" {
|
|
22
|
+
import { Buffer, PinSpecifier, PortSpecifier } from "embedded:io/_common";
|
|
23
|
+
class Serial {
|
|
24
|
+
constructor(options: ({
|
|
25
|
+
receive: PinSpecifier;
|
|
26
|
+
transmit?: PinSpecifier;
|
|
27
|
+
} | {
|
|
28
|
+
recevice?: PinSpecifier;
|
|
29
|
+
transmit: PinSpecifier;
|
|
30
|
+
}) & {
|
|
31
|
+
baud: number;
|
|
32
|
+
flowControl?: "hardware" | "none";
|
|
33
|
+
dataTerminalReady?: PinSpecifier;
|
|
34
|
+
requestToSend?: PinSpecifier;
|
|
35
|
+
clearToSend?: PinSpecifier;
|
|
36
|
+
dataSetReady?: PinSpecifier;
|
|
37
|
+
port: PortSpecifier;
|
|
38
|
+
onReadable?: (this: Serial, bytes: number) => void;
|
|
39
|
+
onWritable?: (this: Serial, bytes: number) => void;
|
|
40
|
+
format?: "number" | "buffer";
|
|
41
|
+
target?: any;
|
|
42
|
+
});
|
|
43
|
+
readonly resolution: number;
|
|
44
|
+
close(): void;
|
|
45
|
+
read(): number | ArrayBuffer | undefined;
|
|
46
|
+
read(byteLength: number): ArrayBuffer | undefined;
|
|
47
|
+
read(buffer: Buffer): number | undefined;
|
|
48
|
+
write(value: number | Buffer): void;
|
|
49
|
+
flush(): void;
|
|
50
|
+
flush(input: number, output: number): void;
|
|
51
|
+
set(options: {
|
|
52
|
+
dataTerminalReady?: PinSpecifier;
|
|
53
|
+
requestToSend?: PinSpecifier;
|
|
54
|
+
break?: boolean;
|
|
55
|
+
})
|
|
56
|
+
get format(): "number" | "buffer"
|
|
57
|
+
set format(value: "number" | "buffer")
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export default Serial;
|
|
61
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Shinya Ishikawa
|
|
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 "embedded:io/smbus" {
|
|
22
|
+
import I2C from "embedded:io/i2c"
|
|
23
|
+
import { Buffer } from "embedded:io/_common";
|
|
24
|
+
|
|
25
|
+
class SMBus extends I2C {
|
|
26
|
+
constructor(options: ConstructorParameters<typeof I2C> & {
|
|
27
|
+
stop?: boolean;
|
|
28
|
+
});
|
|
29
|
+
readUint8(register: number): number;
|
|
30
|
+
writeUint8(register: number, value: number): void;
|
|
31
|
+
readUint16(register: number, bigEndian?: boolean): number;
|
|
32
|
+
writeUint16(register: number, value: number, bigEndian?: boolean): void;
|
|
33
|
+
readBuffer(register: number, byteLength: number): ArrayBuffer;
|
|
34
|
+
readBuffer(register: number, buffer: Buffer): void;
|
|
35
|
+
writeBuffer(register: number, buffer: Buffer): void;
|
|
36
|
+
readQuick();
|
|
37
|
+
writeQuick();
|
|
38
|
+
receiveByte(): number;
|
|
39
|
+
sendByte(command: number);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default SMBus;
|
|
43
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Shinya Ishikawa
|
|
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 "embedded:io/socket/listener" {
|
|
22
|
+
import TCP from "embedded:io/socket/tcp"
|
|
23
|
+
class Listener {
|
|
24
|
+
constructor(options: {
|
|
25
|
+
port?: number;
|
|
26
|
+
address?: string;
|
|
27
|
+
onReadable?: (this: Listener, requests: number) => void;
|
|
28
|
+
format?: "socket/tcp";
|
|
29
|
+
target?: any;
|
|
30
|
+
})
|
|
31
|
+
read(): TCP
|
|
32
|
+
get format(): "socket/tcp"
|
|
33
|
+
set format(value: "socket/tcp")
|
|
34
|
+
}
|
|
35
|
+
export default Listener;
|
|
36
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Shinya Ishikawa
|
|
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 "embedded:io/socket/tcp" {
|
|
22
|
+
import type { Buffer } from "embedded:io/_common";
|
|
23
|
+
class TCP {
|
|
24
|
+
constructor(options: ((({
|
|
25
|
+
address: string;
|
|
26
|
+
} | {
|
|
27
|
+
host: string;
|
|
28
|
+
}) & {
|
|
29
|
+
port: number;
|
|
30
|
+
}) | {
|
|
31
|
+
from: TCP;
|
|
32
|
+
}) & {
|
|
33
|
+
nodelay?: boolean;
|
|
34
|
+
onReadable?: (this: TCP, bytes: number) => void;
|
|
35
|
+
onWritable?: (this: TCP, bytes: number) => void;
|
|
36
|
+
onError?: (this: TCP) => void;
|
|
37
|
+
format?: "number" | "buffer";
|
|
38
|
+
target?: any;
|
|
39
|
+
})
|
|
40
|
+
readonly remoteAddress: string | undefined;
|
|
41
|
+
readonly remotePort: number | undefined;
|
|
42
|
+
read(byteLength?: number): number | ArrayBuffer;
|
|
43
|
+
read(buffer: Buffer): void;
|
|
44
|
+
write(value: number | Buffer): void;
|
|
45
|
+
close(): void;
|
|
46
|
+
get format(): "number" | "buffer"
|
|
47
|
+
set format(value: "number" | "buffer")
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default TCP;
|
|
51
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Shinya Ishikawa
|
|
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 "embedded:io/socket/udp" {
|
|
22
|
+
import type { Buffer } from "embedded:io/_common";
|
|
23
|
+
class UDP {
|
|
24
|
+
constructor(options: {
|
|
25
|
+
port?: number;
|
|
26
|
+
address?: string;
|
|
27
|
+
onReadable?: (this: UDP, packets: number) => void;
|
|
28
|
+
onError?: () => void;
|
|
29
|
+
format?: "buffer";
|
|
30
|
+
target?: any;
|
|
31
|
+
} & ({} | {
|
|
32
|
+
multicast: string;
|
|
33
|
+
timeToLive: number;
|
|
34
|
+
}))
|
|
35
|
+
write(buffer: Buffer, address: string, port: number): void;
|
|
36
|
+
read(): ArrayBuffer & {
|
|
37
|
+
address: string;
|
|
38
|
+
port: number;
|
|
39
|
+
};
|
|
40
|
+
read(buffer: Buffer);
|
|
41
|
+
get format(): "buffer"
|
|
42
|
+
set format(value: "buffer")
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default UDP
|
|
46
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Shinya Ishikawa
|
|
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 "embedded:io/spi" {
|
|
22
|
+
import { Buffer, PinSpecifier, PortSpecifier } from "embedded:io/_common";
|
|
23
|
+
class SPI {
|
|
24
|
+
constructor(options: {
|
|
25
|
+
out?: PinSpecifier;
|
|
26
|
+
in?: PinSpecifier;
|
|
27
|
+
clock: PinSpecifier;
|
|
28
|
+
select?: PinSpecifier;
|
|
29
|
+
active?: 1 | 0;
|
|
30
|
+
hz: number;
|
|
31
|
+
mode?: number;
|
|
32
|
+
port?: PortSpecifier;
|
|
33
|
+
format?: "buffer";
|
|
34
|
+
target?: any;
|
|
35
|
+
})
|
|
36
|
+
read(byteLength: number): ArrayBuffer;
|
|
37
|
+
read(buffer: Buffer): void;
|
|
38
|
+
write(buffer: Buffer): void;
|
|
39
|
+
transfer(buffer: Buffer): void;
|
|
40
|
+
flush(deselect?: boolean): void;
|
|
41
|
+
get format(): "buffer";
|
|
42
|
+
set format(value: "buffer");
|
|
43
|
+
}
|
|
44
|
+
export default SPI;
|
|
45
|
+
}
|