@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/ping.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
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 "ping" {
|
|
22
|
+
class Ping {
|
|
23
|
+
constructor(
|
|
24
|
+
options: {
|
|
25
|
+
host: string,
|
|
26
|
+
id: number,
|
|
27
|
+
interval?: number
|
|
28
|
+
},
|
|
29
|
+
callback: (
|
|
30
|
+
message: number,
|
|
31
|
+
value?: number,
|
|
32
|
+
etc?: any
|
|
33
|
+
) => void
|
|
34
|
+
);
|
|
35
|
+
close(): void;
|
|
36
|
+
}
|
|
37
|
+
export {Ping as default};
|
|
38
|
+
}
|
package/pins/analog.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020 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 'pins/analog' {
|
|
22
|
+
class Analog {
|
|
23
|
+
static read(pin: number): number
|
|
24
|
+
}
|
|
25
|
+
export { Analog as default }
|
|
26
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020 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 'pins/audioin' {
|
|
22
|
+
class AudioIn {
|
|
23
|
+
public constructor()
|
|
24
|
+
public close(): void
|
|
25
|
+
public read(samples: number): number
|
|
26
|
+
public readonly sampleRate: number
|
|
27
|
+
public readonly bitsPerSample: number
|
|
28
|
+
public readonly numChannels: number
|
|
29
|
+
}
|
|
30
|
+
export { AudioIn as default }
|
|
31
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020 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 'pins/audioout' {
|
|
22
|
+
type MixerSamples = 1;
|
|
23
|
+
type MixerFlush = 2;
|
|
24
|
+
type MixerCallback = 3;
|
|
25
|
+
type MixerVolume = 4;
|
|
26
|
+
type MixerRawSamples = 5;
|
|
27
|
+
type MixerTone = 6;
|
|
28
|
+
type MixerSilence = 7;
|
|
29
|
+
type MixerKind = (
|
|
30
|
+
MixerSamples |
|
|
31
|
+
MixerFlush |
|
|
32
|
+
MixerCallback |
|
|
33
|
+
MixerVolume |
|
|
34
|
+
MixerRawSamples |
|
|
35
|
+
MixerTone |
|
|
36
|
+
MixerSilence
|
|
37
|
+
)
|
|
38
|
+
type MixerOptions = {
|
|
39
|
+
sampleRate?: number,
|
|
40
|
+
bitsPerSample?: number,
|
|
41
|
+
numChannels?: number,
|
|
42
|
+
streams?: number,
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export class Mixer {
|
|
46
|
+
public constructor(options: MixerOptions)
|
|
47
|
+
public close(): void
|
|
48
|
+
public enqueue(stream: number, kind: MixerKind): void
|
|
49
|
+
public enqueue(stream: number, kind: MixerKind, buffer: HostBuffer): void
|
|
50
|
+
public enqueue(stream: number, kind: MixerCallback, value: number): void
|
|
51
|
+
public enqueue(stream: number, kind: MixerKind, buffer: HostBuffer, repeat: number): void
|
|
52
|
+
public enqueue(stream: number, kind: MixerKind, buffer: HostBuffer, repeat: number, offset: number): void
|
|
53
|
+
public enqueue(stream: number, kind: MixerKind, buffer: HostBuffer, repeat: number, offset: number, count: number): void
|
|
54
|
+
public enqueue(stream: number, kind: MixerTone, frequency: number, samples: number): void
|
|
55
|
+
public enqueue(stream: number, kind: MixerSilence, samples: number): void
|
|
56
|
+
|
|
57
|
+
public mix(samplesNeeded: number): HostBuffer
|
|
58
|
+
public mix(buffer: BufferLike): void
|
|
59
|
+
|
|
60
|
+
public length(stream: number): number
|
|
61
|
+
|
|
62
|
+
public readonly sampleRate: number
|
|
63
|
+
public readonly bitsPerSample: number
|
|
64
|
+
public readonly numChannels: number
|
|
65
|
+
public readonly streams: number
|
|
66
|
+
|
|
67
|
+
public static readonly Samples: MixerSamples
|
|
68
|
+
public static readonly Flush: MixerFlush
|
|
69
|
+
public static readonly Callback: MixerCallback
|
|
70
|
+
public static readonly Volume: MixerVolume
|
|
71
|
+
public static readonly RawSamples: MixerRawSamples
|
|
72
|
+
public static readonly Tone: MixerTone
|
|
73
|
+
public static readonly Silence: MixerSilence
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
type AudioOutCallback = (value: number) => void
|
|
77
|
+
class AudioOut extends Mixer {
|
|
78
|
+
start(): void
|
|
79
|
+
stop(): void
|
|
80
|
+
callback: AudioOutCallback
|
|
81
|
+
callbacks: AudioOutCallback[]
|
|
82
|
+
readonly mix: undefined
|
|
83
|
+
}
|
|
84
|
+
export { AudioOut as default }
|
|
85
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020 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 'pins/digital/monitor' {
|
|
22
|
+
type Input = 0
|
|
23
|
+
type InputPullUp = 1
|
|
24
|
+
type InputPullDown = 2
|
|
25
|
+
type InputPullUpDown = 3
|
|
26
|
+
type Output = 8
|
|
27
|
+
type OutputOpenDrain = 9
|
|
28
|
+
type Mode = Input | InputPullUp | InputPullDown | InputPullUpDown | Output | OutputOpenDrain
|
|
29
|
+
type Rising = 1
|
|
30
|
+
type Falling = 2
|
|
31
|
+
type Edge = Rising | Falling
|
|
32
|
+
class Monitor {
|
|
33
|
+
public constructor(dictionary: { pin: number; port?: string; mode: Mode; edge: Edge })
|
|
34
|
+
public onChanged(callback: () => void): void
|
|
35
|
+
public read(): number
|
|
36
|
+
public close(): void
|
|
37
|
+
public readonly rises: number
|
|
38
|
+
public readonly falls: number
|
|
39
|
+
}
|
|
40
|
+
export { Monitor as default }
|
|
41
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020 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 'pins/digital' {
|
|
22
|
+
type Input = 0
|
|
23
|
+
type InputPullUp = 1
|
|
24
|
+
type InputPullDown = 2
|
|
25
|
+
type InputPullUpDown = 3
|
|
26
|
+
type Output = 8
|
|
27
|
+
type OutputOpenDrain = 9
|
|
28
|
+
type Mode = Input | InputPullUp | InputPullDown | InputPullUpDown | Output | OutputOpenDrain
|
|
29
|
+
export class Digital {
|
|
30
|
+
public constructor(dictionary: { pin: number; mode: number; port?: string })
|
|
31
|
+
public constructor(pin: number, mode: number)
|
|
32
|
+
public constructor(port: string, pin: number, mode: number)
|
|
33
|
+
public read(): number
|
|
34
|
+
public write(value: number): void
|
|
35
|
+
public mode(mode: Mode): void
|
|
36
|
+
public static read(pin: number): number
|
|
37
|
+
public static write(pin: number, value: number): void
|
|
38
|
+
public static readonly Input: Input
|
|
39
|
+
public static readonly InputPullUp: InputPullUp
|
|
40
|
+
public static readonly InputPullDown: InputPullDown
|
|
41
|
+
public static readonly InputPullUpDown: InputPullUpDown
|
|
42
|
+
public static readonly Output: Output
|
|
43
|
+
public static readonly OutputOpenDrain: OutputOpenDrain
|
|
44
|
+
}
|
|
45
|
+
export { Digital as default }
|
|
46
|
+
}
|
package/pins/i2c.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020 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 'pins/i2c' {
|
|
22
|
+
type TypedArray =
|
|
23
|
+
| Int8Array
|
|
24
|
+
| Uint8Array
|
|
25
|
+
| Int16Array
|
|
26
|
+
| Uint16Array
|
|
27
|
+
| Int32Array
|
|
28
|
+
| Uint32Array
|
|
29
|
+
| Uint8ClampedArray
|
|
30
|
+
| Float32Array
|
|
31
|
+
| Float64Array
|
|
32
|
+
class I2C {
|
|
33
|
+
public constructor(dictionary: { address: number; scl?: number; sda?: number; hz?: number; timeout?: number })
|
|
34
|
+
public constructor(port: number[], pin: number, mode: number)
|
|
35
|
+
public close(): void
|
|
36
|
+
public read(count: number, buffer?: ArrayBuffer): void
|
|
37
|
+
public write(first: any, ...valuesOrStop: (number | string | (number | string)[] | TypedArray | boolean)[]): void
|
|
38
|
+
}
|
|
39
|
+
export { I2C as default }
|
|
40
|
+
}
|
package/pins/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Blank
|
package/pins/pwm.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020 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 'pins/pwm' {
|
|
22
|
+
class PWM {
|
|
23
|
+
public constructor(dictionary: { pin: number; port?: string })
|
|
24
|
+
public write(value: number): void
|
|
25
|
+
public close(): void
|
|
26
|
+
}
|
|
27
|
+
export { PWM as default }
|
|
28
|
+
}
|
package/pins/rmt.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021 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 'pins/rmt' {
|
|
21
|
+
class RMT {
|
|
22
|
+
public constructor(
|
|
23
|
+
dictionary: {
|
|
24
|
+
pin: number,
|
|
25
|
+
channel?: number,
|
|
26
|
+
divider?: number,
|
|
27
|
+
direction?: "tx" | "rx",
|
|
28
|
+
filter?: number,
|
|
29
|
+
timeout?: number,
|
|
30
|
+
ringbufferSize?: number,
|
|
31
|
+
tx_config?: {
|
|
32
|
+
loop_en: 0 | 1,
|
|
33
|
+
carrier_freq_hz: number,
|
|
34
|
+
carrier_duty_percent: number,
|
|
35
|
+
carrier_level:0 | 1,
|
|
36
|
+
carrier_en: 0 | 1,
|
|
37
|
+
idle_level: 0 | 1,
|
|
38
|
+
idle_output_en: 0 | 1
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
public write(firstValue: 0 | 1, durations: number[]): void;
|
|
43
|
+
public onWritable: () => void;
|
|
44
|
+
public read(buffer: ArrayBuffer | ArrayBufferLike): {buffer: ArrayBuffer, count: number, phase: 0 | 1};
|
|
45
|
+
public close();
|
|
46
|
+
}
|
|
47
|
+
export { RMT as default }
|
|
48
|
+
}
|
package/pins/servo.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020 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 'pins/servo' {
|
|
22
|
+
class Servo {
|
|
23
|
+
public constructor(dictionary: { pin: number; min?: number; max?: number })
|
|
24
|
+
public write(degrees: number): void
|
|
25
|
+
public writeMicroseconds(us: number): void
|
|
26
|
+
}
|
|
27
|
+
export { Servo as default }
|
|
28
|
+
}
|
package/pins/smbus.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020 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 'pins/smbus' {
|
|
22
|
+
type TypedArray =
|
|
23
|
+
| Int8Array
|
|
24
|
+
| Uint8Array
|
|
25
|
+
| Int16Array
|
|
26
|
+
| Uint16Array
|
|
27
|
+
| Int32Array
|
|
28
|
+
| Uint32Array
|
|
29
|
+
| Uint8ClampedArray
|
|
30
|
+
| Float32Array
|
|
31
|
+
| Float64Array
|
|
32
|
+
class SMBus {
|
|
33
|
+
public constructor(dictionary: { address: number; scl?: number; sda?: number; hz?: number; timeout?: number })
|
|
34
|
+
public constructor(port: number[], pin: number, mode: number)
|
|
35
|
+
public close(): void
|
|
36
|
+
public read(count: number, buffer?: ArrayBuffer): void
|
|
37
|
+
public write(first: any, ...valuesOrStop: (number | string | (number | string)[] | TypedArray | boolean)[]): void
|
|
38
|
+
public readByte(register: number): number
|
|
39
|
+
public readWord(register: number): number;
|
|
40
|
+
public readWord(register: number, bigEndian: boolean): number;
|
|
41
|
+
public readBlock(register: number, count: number, buffer?: ArrayBuffer): Uint8Array
|
|
42
|
+
public writeByte(register: number, value: number): void
|
|
43
|
+
public writeWord(register: number, value: number): void
|
|
44
|
+
public writeBlock(register: number, first: any, ...valuesOrStop: (any | boolean)[]): void
|
|
45
|
+
}
|
|
46
|
+
export { SMBus as default }
|
|
47
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020 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 "piu/CombTransition" {
|
|
22
|
+
class CombTransition extends Transition {
|
|
23
|
+
}
|
|
24
|
+
export { CombTransition as default }
|
|
25
|
+
}
|