@moddable/typings 9.5.0 → 10.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/DS18X20.d.ts +40 -0
- package/{embedded_io/system.d.ts → ResourceIterator.d.ts} +4 -9
- package/ble/bleclient.d.ts +1 -0
- package/ble/bleserver.d.ts +1 -0
- package/ble/btutils.d.ts +3 -0
- package/ble/connection.d.ts +1 -0
- package/ble/gap.d.ts +2 -0
- package/ble/gatt.d.ts +4 -0
- package/ble/hidclient.d.ts +5 -0
- package/ble/sm.d.ts +3 -0
- package/captiveportal.d.ts +5 -5
- package/commodetto/Poco.d.ts +10 -2
- package/commodetto/ReadGIF.d.ts +1 -1
- package/commodetto/outline.d.ts +4 -1
- package/commodetto/parseRLE.d.ts +1 -1
- package/commodetto/readJPEG.d.ts +1 -1
- package/config/analog.d.ts +31 -0
- package/config/digital.d.ts +32 -0
- package/config/dns.d.ts +33 -0
- package/config/dnssd.d.ts +31 -0
- package/config/files.d.ts +27 -0
- package/config/flash.d.ts +27 -0
- package/config/httpclient.d.ts +34 -0
- package/config/httpsclient.d.ts +34 -0
- package/config/httpserver.d.ts +33 -0
- package/config/i2c.d.ts +33 -0
- package/config/mqtt.d.ts +27 -0
- package/config/mqttclient.d.ts +31 -0
- package/config/mqttsclient.d.ts +32 -0
- package/config/ntp.d.ts +34 -0
- package/config/pulsecount.d.ts +30 -0
- package/config/pwm.d.ts +30 -0
- package/config/serial.d.ts +31 -0
- package/config/socket.d.ts +34 -0
- package/config/spi.d.ts +31 -0
- package/config/storage.d.ts +27 -0
- package/config/system.d.ts +27 -0
- package/config/tls.d.ts +30 -0
- package/config/update.d.ts +27 -0
- package/config/wsclient.d.ts +31 -0
- package/config/wssclient.d.ts +32 -0
- package/crc.d.ts +1 -1
- package/dns/server.d.ts +1 -0
- package/embedded/RTC/zephyr-builtin.d.ts +48 -0
- package/embedded/RTC.d.ts +18 -7
- package/embedded/display.d.ts +8 -3
- package/embedded/storage/files.d.ts +10 -7
- package/embedded/storage/flash.d.ts +2 -2
- package/embedded/storage/key-value.d.ts +27 -6
- package/embedded/system.d.ts +49 -0
- package/embedded_io/_common.d.ts +42 -3
- package/embedded_io/analog.d.ts +7 -7
- package/embedded_io/audio/in.d.ts +3 -2
- package/embedded_io/audio/out.d.ts +12 -4
- package/embedded_io/ble/central.d.ts +5 -4
- package/embedded_io/ble/peripheral.d.ts +6 -5
- package/embedded_io/crypt/digest.d.ts +2 -2
- package/embedded_io/digital.d.ts +4 -3
- package/embedded_io/digitalbank.d.ts +9 -5
- package/embedded_io/i2c.d.ts +9 -6
- package/embedded_io/image/in/camera.d.ts +82 -0
- package/embedded_io/pulsecount.d.ts +7 -5
- package/embedded_io/pwm.d.ts +11 -5
- package/embedded_io/serial.d.ts +33 -16
- package/embedded_io/socket/listener.d.ts +3 -2
- package/embedded_io/socket/tcp/tls.d.ts +41 -12
- package/embedded_io/socket/tcp.d.ts +26 -12
- package/embedded_io/socket/udp.d.ts +17 -12
- package/embedded_io/spi.d.ts +8 -6
- package/embedded_network/dns/resolver/udp.d.ts +13 -6
- package/embedded_network/dns/server/udp.d.ts +39 -0
- package/embedded_network/dnssd.d.ts +9 -7
- package/embedded_network/http/client.d.ts +21 -7
- package/embedded_network/http/server/route/serversentevents.d.ts +48 -0
- package/embedded_network/http/server/route/static.d.ts +41 -0
- package/embedded_network/http/server/route/webdav.d.ts +42 -0
- package/embedded_network/http/server/route/ws/handshake.d.ts +28 -0
- package/embedded_network/http/server.d.ts +27 -6
- package/embedded_network/interface/ethernet.d.ts +3 -3
- package/embedded_network/interface/wifi/accesspoint.d.ts +2 -2
- package/embedded_network/interface/wifi.d.ts +21 -12
- package/embedded_network/mdns.d.ts +2 -2
- package/embedded_network/mqtt/client.d.ts +55 -16
- package/embedded_network/ntp/client.d.ts +16 -8
- package/embedded_network/websocket/client.d.ts +47 -28
- package/embedded_provider/builtin.d.ts +40 -34
- package/file.d.ts +4 -0
- package/flash.d.ts +1 -0
- package/global.d.ts +0 -3
- package/host/default.d.ts +31 -0
- package/host/esp32/moddable_six.d.ts +50 -0
- package/host/esp32/moddable_two.d.ts +55 -0
- package/host/generic.d.ts +47 -0
- package/host/index.d.ts +24 -0
- package/host/lin.d.ts +30 -0
- package/host/mac.d.ts +30 -0
- package/host/pebble.d.ts +70 -0
- package/host/win.d.ts +30 -0
- package/http.d.ts +2 -0
- package/mcpack.d.ts +20 -0
- package/mdns.d.ts +1 -0
- package/modules.d.ts +1 -1
- package/mqtt/js.d.ts +22 -4
- package/neopixel.d.ts +2 -2
- package/onewire.d.ts +31 -0
- package/package.json +14 -4
- package/pebble/accelerometer.d.ts +5 -5
- package/pebble/battery.d.ts +3 -3
- package/pebble/button.d.ts +2 -2
- package/pebble/compass.d.ts +3 -3
- package/pebble/dictation.d.ts +2 -2
- package/pebble/global.d.ts +37 -3
- package/pebble/health.d.ts +2 -2
- package/pebble/location.d.ts +2 -2
- package/pebble/message.d.ts +5 -5
- package/pebble/piu.d.ts +2 -57
- package/pebble/poco.d.ts +2 -2
- package/pebble/texture.d.ts +33 -0
- package/pebble/touch.d.ts +47 -0
- package/ping.d.ts +1 -0
- package/pins/analog.d.ts +1 -0
- package/pins/audioin.d.ts +1 -0
- package/pins/digital.d.ts +1 -0
- package/pins/i2c.d.ts +1 -0
- package/pins/pwm.d.ts +1 -0
- package/pins/rmt.d.ts +1 -0
- package/pins/servo.d.ts +1 -0
- package/pins/smbus.d.ts +1 -0
- package/piu/MC-types.d.ts +231 -97
- package/piu/MC.d.ts +2 -1
- package/piu/QRCode.d.ts +5 -0
- package/piu/RoundRect.d.ts +53 -0
- package/piu/SVGImage.d.ts +62 -0
- package/piu/Timeline.d.ts +17 -21
- package/pococolorcell.d.ts +25 -0
- package/pocoqrcode.d.ts +25 -0
- package/pocostatic.d.ts +25 -0
- package/preference.d.ts +1 -0
- package/securesocket.d.ts +1 -0
- package/sntp.d.ts +1 -0
- package/socket.d.ts +6 -0
- package/ssl/session.d.ts +60 -0
- package/time.d.ts +1 -1
- package/tsconfig.es2024.json +0 -1
- package/tsconfig.es2025.json +1 -1
- package/web/bluetooth.d.ts +112 -0
- package/web/decompressionstream.d.ts +1 -1
- package/web/eventsource.d.ts +12 -7
- package/web/fetch-streams.d.ts +57 -0
- package/web/fetch.d.ts +1 -1
- package/web/serial.d.ts +58 -0
- package/web/websocket.d.ts +18 -13
- package/web/webstorage.d.ts +3 -0
- package/web/worker.d.ts +2 -0
- package/websocket.d.ts +2 -0
- package/wifi.d.ts +1 -0
- package/xs.d.ts +52 -5
- package/data/location/nmea.d.ts +0 -103
- package/data/location/ubx.d.ts +0 -78
- package/display.d.ts +0 -68
- package/embedded/sensor/Barometer-Humidity-Temperature/BME280.d.ts +0 -102
- package/embedded/sensor/Location/GPS.d.ts +0 -96
- package/embedded/sensor/Location/IP.d.ts +0 -67
- package/pebble/device.d.ts +0 -51
package/web/websocket.d.ts
CHANGED
|
@@ -23,15 +23,15 @@ declare module "web/websocket" {
|
|
|
23
23
|
|
|
24
24
|
interface WebSocketClientOptions {
|
|
25
25
|
url: string;
|
|
26
|
-
protocol?: string;
|
|
26
|
+
protocol?: string | string[];
|
|
27
27
|
keepalive?: number;
|
|
28
|
-
headers?: Headers |
|
|
28
|
+
headers?: Headers | Map<string, string>;
|
|
29
29
|
ws?: any;
|
|
30
30
|
wss?: any;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
interface WebSocketAttachOptions {
|
|
34
|
-
attach:
|
|
34
|
+
attach: import("embedded:io/socket/tcp").default;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
interface WebSocketCloseEvent {
|
|
@@ -55,7 +55,7 @@ declare module "web/websocket" {
|
|
|
55
55
|
type WebSocketEventListener = (event: any) => void;
|
|
56
56
|
|
|
57
57
|
class WebSocket {
|
|
58
|
-
constructor(url: string,
|
|
58
|
+
constructor(url: string, protocols?: string | string[]);
|
|
59
59
|
constructor(options: WebSocketClientOptions);
|
|
60
60
|
constructor(options: WebSocketAttachOptions);
|
|
61
61
|
|
|
@@ -76,15 +76,15 @@ declare module "web/websocket" {
|
|
|
76
76
|
readonly readyState: number;
|
|
77
77
|
readonly url: string;
|
|
78
78
|
|
|
79
|
-
onclose
|
|
80
|
-
onerror
|
|
81
|
-
onmessage
|
|
82
|
-
onopen
|
|
79
|
+
onclose: ((this: WebSocket, event: WebSocketCloseEvent) => void) | null;
|
|
80
|
+
onerror: ((this: WebSocket, event: WebSocketErrorEvent) => void) | null;
|
|
81
|
+
onmessage: ((this: WebSocket, event: WebSocketMessageEvent) => void) | null;
|
|
82
|
+
onopen: ((this: WebSocket, event: WebSocketEvent) => void) | null;
|
|
83
83
|
|
|
84
|
-
addEventListener(event: "close", listener: (event: WebSocketCloseEvent) => void): void;
|
|
85
|
-
addEventListener(event: "error", listener: (event: WebSocketErrorEvent) => void): void;
|
|
86
|
-
addEventListener(event: "message", listener: (event: WebSocketMessageEvent) => void): void;
|
|
87
|
-
addEventListener(event: "open", listener: (event: WebSocketEvent) => void): void;
|
|
84
|
+
addEventListener(event: "close", listener: (this: WebSocket, event: WebSocketCloseEvent) => void): void;
|
|
85
|
+
addEventListener(event: "error", listener: (this: WebSocket, event: WebSocketErrorEvent) => void): void;
|
|
86
|
+
addEventListener(event: "message", listener: (this: WebSocket, event: WebSocketMessageEvent) => void): void;
|
|
87
|
+
addEventListener(event: "open", listener: (this: WebSocket, event: WebSocketEvent) => void): void;
|
|
88
88
|
|
|
89
89
|
removeEventListener(event: "close" | "error" | "message" | "open", listener: WebSocketEventListener): void;
|
|
90
90
|
|
|
@@ -93,4 +93,9 @@ declare module "web/websocket" {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
export default WebSocket;
|
|
96
|
-
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// the specifier of the module in the Moddable SDK runtime
|
|
99
|
+
declare module "WebSocket" {
|
|
100
|
+
export { default } from "web/websocket";
|
|
101
|
+
}
|
package/web/webstorage.d.ts
CHANGED
package/web/worker.d.ts
CHANGED
package/websocket.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ declare module "websocket" {
|
|
|
28
28
|
}
|
|
29
29
|
export type WebSocketClientCallback = (message: number, value?: any) => void;
|
|
30
30
|
|
|
31
|
+
/** @deprecated Use WebSocket, or the ECMA-419 embedded:network/websocket/client and the embedded:network/http/server/route/ws/handshake route */
|
|
31
32
|
export class Client {
|
|
32
33
|
static readonly connect: number;
|
|
33
34
|
static readonly handshake: number;
|
|
@@ -43,6 +44,7 @@ declare module "websocket" {
|
|
|
43
44
|
export type WebSocketServerOptions = ListenerOptions
|
|
44
45
|
export type WebSocketServerCallback = (message: number, value?: any) => void;
|
|
45
46
|
|
|
47
|
+
/** @deprecated Use WebSocket, or the ECMA-419 embedded:network/websocket/client and the embedded:network/http/server/route/ws/handshake route */
|
|
46
48
|
export class Server {
|
|
47
49
|
static readonly connect: number;
|
|
48
50
|
static readonly handshake: number;
|
package/wifi.d.ts
CHANGED
package/xs.d.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
interface Trace {
|
|
22
|
-
(...log:
|
|
22
|
+
(...log: unknown[]):void;
|
|
23
23
|
left(log: string | ArrayBufferLike, conversation?: string):void;
|
|
24
24
|
center(log: string | ArrayBufferLike, conversation?: string):void;
|
|
25
25
|
right(log: string | ArrayBufferLike, conversation?: string):void;
|
|
@@ -53,7 +53,7 @@ interface JSON {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
interface StringConstructor {
|
|
56
|
-
fromArrayBuffer(buffer: ArrayBufferLike): string;
|
|
56
|
+
fromArrayBuffer(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): string;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
interface ArrayBufferConstructor {
|
|
@@ -63,17 +63,26 @@ interface ArrayBufferConstructor {
|
|
|
63
63
|
|
|
64
64
|
interface ArrayBuffer {
|
|
65
65
|
concat(...buffers: ArrayBufferLike[]): ArrayBuffer;
|
|
66
|
+
|
|
67
|
+
// immutable ArrayBuffers (not yet in every XS deployment: only where mxImmutableArrayBuffers is enabled)
|
|
68
|
+
readonly immutable: boolean;
|
|
69
|
+
sliceToImmutable(start?: number, end?: number): ArrayBuffer;
|
|
70
|
+
transferToImmutable(newByteLength?: number): ArrayBuffer;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface ToBase64Options {
|
|
74
|
+
alphabet?: "base64url" | "base64";
|
|
75
|
+
omitPadding?: boolean;
|
|
66
76
|
}
|
|
67
77
|
|
|
68
78
|
interface Uint8Array {
|
|
69
79
|
toHex(): string;
|
|
70
|
-
toBase64(): string
|
|
80
|
+
toBase64(options?: ToBase64Options): string
|
|
71
81
|
}
|
|
72
82
|
|
|
73
83
|
interface FromBase64Options {
|
|
74
84
|
alphabet?: "base64url" | "base64";
|
|
75
85
|
lastChunkHandling?: "stop-before-partial" | "strict" | "loose";
|
|
76
|
-
omitPadding?: boolean;
|
|
77
86
|
}
|
|
78
87
|
|
|
79
88
|
interface Uint8ArrayConstructor {
|
|
@@ -101,4 +110,42 @@ interface Math {
|
|
|
101
110
|
declare function Native(name: string): new (...args: any[]) => any;
|
|
102
111
|
declare function native(name: string): (...args: any[]) => any;
|
|
103
112
|
|
|
104
|
-
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
Compartment (see documentation/xs/XS Compartment.md)
|
|
116
|
+
*/
|
|
117
|
+
interface ModuleDescriptor {
|
|
118
|
+
source?: string | ModuleSource | object;
|
|
119
|
+
importMeta?: object;
|
|
120
|
+
specifier?: string;
|
|
121
|
+
namespace?: string | object;
|
|
122
|
+
compartment?: Compartment;
|
|
123
|
+
archive?: object;
|
|
124
|
+
path?: string;
|
|
125
|
+
}
|
|
126
|
+
interface CompartmentOptions {
|
|
127
|
+
globals?: object;
|
|
128
|
+
globalLexicals?: object;
|
|
129
|
+
modules?: Record<string, ModuleDescriptor>;
|
|
130
|
+
loadHook?: (specifier: string) => Promise<ModuleDescriptor>;
|
|
131
|
+
loadNowHook?: (specifier: string) => ModuleDescriptor;
|
|
132
|
+
resolveHook?: (importSpecifier: string, referrerSpecifier: string) => string;
|
|
133
|
+
}
|
|
134
|
+
declare class Compartment {
|
|
135
|
+
constructor(options?: CompartmentOptions);
|
|
136
|
+
readonly globalThis: Record<PropertyKey, any>;
|
|
137
|
+
evaluate(script: string): any;
|
|
138
|
+
import(specifier: string): Promise<any>;
|
|
139
|
+
importNow(specifier: string): any;
|
|
140
|
+
}
|
|
141
|
+
declare class ModuleSource {
|
|
142
|
+
constructor(source: string);
|
|
143
|
+
readonly bindings: object[];
|
|
144
|
+
readonly needsImport: boolean;
|
|
145
|
+
readonly needsImportMeta: boolean;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/*
|
|
149
|
+
abort hook: when a function, XS calls it before aborting. Returning false ignores the abort.
|
|
150
|
+
*/
|
|
151
|
+
declare var abort: ((message: string, exception?: any) => boolean | void) | undefined;
|
package/data/location/nmea.d.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026 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 "data/location/nmea" {
|
|
22
|
-
interface NMEATalker {
|
|
23
|
-
readonly GP: "GPS";
|
|
24
|
-
readonly GN: "GNSS";
|
|
25
|
-
readonly GL: "GLONASS";
|
|
26
|
-
readonly GA: "Galileo";
|
|
27
|
-
readonly GB: "BeiDou";
|
|
28
|
-
readonly BD: "BeiDou";
|
|
29
|
-
readonly QZ: "QZSS";
|
|
30
|
-
readonly P: "Proprietary";
|
|
31
|
-
readonly [id: string]: string | undefined;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface NMEASatellite {
|
|
35
|
-
prn: number;
|
|
36
|
-
elevation: number | null;
|
|
37
|
-
azimuth: number | null;
|
|
38
|
-
snr: number | null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
interface NMEASentence {
|
|
42
|
-
type: string;
|
|
43
|
-
talker: string;
|
|
44
|
-
system: string;
|
|
45
|
-
raw: string;
|
|
46
|
-
time?: string | null;
|
|
47
|
-
date?: string | null;
|
|
48
|
-
latitude?: number | null;
|
|
49
|
-
longitude?: number | null;
|
|
50
|
-
altitude?: number | null;
|
|
51
|
-
geoidSeparation?: number | null;
|
|
52
|
-
quality?: number;
|
|
53
|
-
satellites?: number | NMEASatellite[];
|
|
54
|
-
hdop?: number | null;
|
|
55
|
-
pdop?: number | null;
|
|
56
|
-
vdop?: number | null;
|
|
57
|
-
speed?: number | null;
|
|
58
|
-
course?: number | null;
|
|
59
|
-
status?: string | null;
|
|
60
|
-
mode?: string | null;
|
|
61
|
-
fix?: boolean;
|
|
62
|
-
fixType?: number;
|
|
63
|
-
satellitesUsed?: number[];
|
|
64
|
-
totalMessages?: number;
|
|
65
|
-
messageNumber?: number;
|
|
66
|
-
satellitesInView?: number;
|
|
67
|
-
day?: number | null;
|
|
68
|
-
month?: number | null;
|
|
69
|
-
year?: number | null;
|
|
70
|
-
fields?: string[];
|
|
71
|
-
[key: string]: unknown;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
interface NMEALocationUpdate {
|
|
75
|
-
latitude?: number;
|
|
76
|
-
longitude?: number;
|
|
77
|
-
altitude?: number;
|
|
78
|
-
accuracy?: number;
|
|
79
|
-
heading?: number;
|
|
80
|
-
speed?: number;
|
|
81
|
-
fix?: boolean;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
class NMEA {
|
|
85
|
-
constructor(onParsed?: (parsed: NMEASentence) => void);
|
|
86
|
-
push(data: number | ArrayBuffer | ArrayBufferView): NMEASentence | undefined;
|
|
87
|
-
|
|
88
|
-
static readonly Talker: NMEATalker;
|
|
89
|
-
static readonly identification: {
|
|
90
|
-
readonly model: string;
|
|
91
|
-
readonly classification: string;
|
|
92
|
-
readonly description: string;
|
|
93
|
-
};
|
|
94
|
-
static parse(sentence: string | ArrayBuffer | ArrayBufferView): NMEASentence | null;
|
|
95
|
-
static validateChecksum(sentence: string | ArrayBuffer | ArrayBufferView): Uint8Array | null;
|
|
96
|
-
static toDecimalDegrees(value: string, hemi: string): number | null;
|
|
97
|
-
static checksum(payload: string): string;
|
|
98
|
-
static format(payload: string): string;
|
|
99
|
-
static location(parsed: NMEASentence | null | undefined): NMEALocationUpdate | undefined;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export { NMEA as default, NMEA };
|
|
103
|
-
}
|
package/data/location/ubx.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026 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 "data/location/ubx" {
|
|
22
|
-
interface UBXMessage {
|
|
23
|
-
type: string;
|
|
24
|
-
class?: number;
|
|
25
|
-
id?: number;
|
|
26
|
-
payloadLength?: number;
|
|
27
|
-
latitude?: number;
|
|
28
|
-
longitude?: number;
|
|
29
|
-
altitude?: number;
|
|
30
|
-
accuracy?: number;
|
|
31
|
-
altitudeAccuracy?: number;
|
|
32
|
-
speed?: number;
|
|
33
|
-
course?: number;
|
|
34
|
-
pdop?: number;
|
|
35
|
-
satellites?: number;
|
|
36
|
-
fixType?: number;
|
|
37
|
-
fix?: boolean;
|
|
38
|
-
status?: string;
|
|
39
|
-
quality?: number;
|
|
40
|
-
[key: string]: unknown;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
interface UBXLocationUpdate {
|
|
44
|
-
latitude?: number;
|
|
45
|
-
longitude?: number;
|
|
46
|
-
altitude?: number;
|
|
47
|
-
accuracy?: number;
|
|
48
|
-
altitudeAccuracy?: number;
|
|
49
|
-
heading?: number;
|
|
50
|
-
speed?: number;
|
|
51
|
-
fix: boolean;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
class UBX {
|
|
55
|
-
constructor(onParsed?: (parsed: UBXMessage) => void);
|
|
56
|
-
push(data: number | ArrayBuffer | ArrayBufferView): UBXMessage | undefined;
|
|
57
|
-
|
|
58
|
-
static readonly SYNC1: 0xb5;
|
|
59
|
-
static readonly SYNC2: 0x62;
|
|
60
|
-
static readonly CLASS_NAV: 0x01;
|
|
61
|
-
static readonly ID_NAV_PVT: 0x07;
|
|
62
|
-
static readonly CLASS_CFG: 0x06;
|
|
63
|
-
static readonly ID_CFG_MSG: 0x01;
|
|
64
|
-
static readonly identification: {
|
|
65
|
-
readonly model: string;
|
|
66
|
-
readonly classification: string;
|
|
67
|
-
readonly description: string;
|
|
68
|
-
};
|
|
69
|
-
static checksum(bytes: Uint8Array, offset: number, length: number): [number, number];
|
|
70
|
-
static format(msgClass: number, msgId: number, payload?: ArrayBuffer | ArrayBufferView): ArrayBuffer;
|
|
71
|
-
static parse(frame: ArrayBuffer | ArrayBufferView): UBXMessage | null;
|
|
72
|
-
static parseNAVPVT(view: DataView): UBXMessage | null;
|
|
73
|
-
static location(parsed: UBXMessage | null | undefined): UBXLocationUpdate | undefined;
|
|
74
|
-
static setup(): ArrayBuffer[];
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export { UBX as default, UBX };
|
|
78
|
-
}
|
package/display.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025 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:display" {
|
|
22
|
-
export interface DisplayConstructorOptions {
|
|
23
|
-
format?: number;
|
|
24
|
-
rotation?: number;
|
|
25
|
-
brightness?: number;
|
|
26
|
-
flip?: "h" | "v" | "hv";
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface DisplayConfigureOptions {
|
|
30
|
-
brightness?: number;
|
|
31
|
-
format?: number;
|
|
32
|
-
rotation?: number;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface DisplayConfiguration {
|
|
36
|
-
brightness?: number;
|
|
37
|
-
format?: number;
|
|
38
|
-
rotation?: number;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface DisplayBeginOptions {
|
|
42
|
-
x: number;
|
|
43
|
-
y: number;
|
|
44
|
-
width: number;
|
|
45
|
-
height: number;
|
|
46
|
-
continue?: boolean;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface DisplayRectangle {
|
|
50
|
-
x: number;
|
|
51
|
-
y: number;
|
|
52
|
-
width: number;
|
|
53
|
-
height: number;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export default class Display {
|
|
57
|
-
constructor(options: DisplayConstructorOptions);
|
|
58
|
-
close(): void;
|
|
59
|
-
configure(options: DisplayConfigureOptions): void;
|
|
60
|
-
get configuration(): DisplayConfiguration;
|
|
61
|
-
begin(options?: DisplayBeginOptions): void;
|
|
62
|
-
send(buffer: ByteBuffer): void;
|
|
63
|
-
end(): void;
|
|
64
|
-
adapInvalid(options: DisplayRectangle): void;
|
|
65
|
-
get width(): number;
|
|
66
|
-
get height(): number;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026 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 "embedded:sensor/Barometer-Humidity-Temperature/BME280" {
|
|
22
|
-
interface BME280IO {
|
|
23
|
-
write(buffer: ArrayBuffer | ArrayBufferView, stop?: boolean): void;
|
|
24
|
-
read(buffer: ArrayBuffer | ArrayBufferView): void;
|
|
25
|
-
close(): void;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface BME280SensorOptions {
|
|
29
|
-
io: new (options: object) => BME280IO;
|
|
30
|
-
address?: number;
|
|
31
|
-
hz?: number;
|
|
32
|
-
data?: number | string;
|
|
33
|
-
clock?: number | string;
|
|
34
|
-
[key: string]: unknown;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface BME280Options {
|
|
38
|
-
sensor: BME280SensorOptions;
|
|
39
|
-
target?: unknown;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
interface BME280Configuration {
|
|
43
|
-
mode?: number;
|
|
44
|
-
temperatureSampling?: number;
|
|
45
|
-
pressureSampling?: number;
|
|
46
|
-
humiditySampling?: number;
|
|
47
|
-
filter?: number;
|
|
48
|
-
standbyDuration?: number;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
interface BME280Sample {
|
|
52
|
-
thermometer: { temperature: number };
|
|
53
|
-
hygrometer: { humidity?: number };
|
|
54
|
-
barometer: { pressure: number };
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
interface BME280ConfigConstants {
|
|
58
|
-
readonly Sampling: {
|
|
59
|
-
readonly SKIPPED: 0x00;
|
|
60
|
-
readonly X1: 0x01;
|
|
61
|
-
readonly X2: 0x02;
|
|
62
|
-
readonly X4: 0x03;
|
|
63
|
-
readonly X8: 0x04;
|
|
64
|
-
readonly X16: 0x05;
|
|
65
|
-
};
|
|
66
|
-
readonly Filter: {
|
|
67
|
-
readonly OFF: 0x00;
|
|
68
|
-
readonly X2: 0x01;
|
|
69
|
-
readonly X4: 0x02;
|
|
70
|
-
readonly X8: 0x03;
|
|
71
|
-
readonly X16: 0x04;
|
|
72
|
-
};
|
|
73
|
-
readonly Mode: {
|
|
74
|
-
readonly SLEEP: 0x00;
|
|
75
|
-
readonly FORCED: 0x01;
|
|
76
|
-
readonly NORMAL: 0x03;
|
|
77
|
-
};
|
|
78
|
-
readonly Standby: {
|
|
79
|
-
readonly MS_0_5: 0x00;
|
|
80
|
-
readonly MS_62_5: 0x01;
|
|
81
|
-
readonly MS_125: 0x02;
|
|
82
|
-
readonly MS_250: 0x03;
|
|
83
|
-
readonly MS_500: 0x04;
|
|
84
|
-
readonly MS_1000: 0x05;
|
|
85
|
-
readonly MS_10: 0x06;
|
|
86
|
-
readonly MS_20: 0x07;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
class BME280 {
|
|
91
|
-
constructor(options: BME280Options);
|
|
92
|
-
configure(options: BME280Configuration): void;
|
|
93
|
-
sample(): BME280Sample;
|
|
94
|
-
close(): void;
|
|
95
|
-
target?: unknown;
|
|
96
|
-
}
|
|
97
|
-
interface BME280 extends Disposable {}
|
|
98
|
-
|
|
99
|
-
const Config: BME280ConfigConstants;
|
|
100
|
-
|
|
101
|
-
export { BME280 as default, BME280, Config };
|
|
102
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2026 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 "embedded:sensor/Location/GPS" {
|
|
22
|
-
interface GPSSensorIO {
|
|
23
|
-
write(value: ByteBuffer, stop?: boolean): void;
|
|
24
|
-
writeRead?(writeBuffer: ByteBuffer, readByteLength: number, stop?: boolean): ArrayBuffer;
|
|
25
|
-
read?(byteLength?: number): number | ArrayBuffer | undefined;
|
|
26
|
-
close(): void;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface GPSSensorOptions {
|
|
30
|
-
io: new (options: object) => GPSSensorIO;
|
|
31
|
-
address?: number;
|
|
32
|
-
hz?: number;
|
|
33
|
-
data?: number | string;
|
|
34
|
-
clock?: number | string;
|
|
35
|
-
receive?: number | string;
|
|
36
|
-
transmit?: number | string;
|
|
37
|
-
baud?: number;
|
|
38
|
-
port?: number | string;
|
|
39
|
-
[key: string]: unknown;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
interface GPSProtocol {
|
|
43
|
-
new (onParsed?: (parsed: object) => void): {
|
|
44
|
-
push(data: number | ArrayBuffer | ArrayBufferView): object | undefined;
|
|
45
|
-
};
|
|
46
|
-
location(parsed: object | null | undefined): object | undefined;
|
|
47
|
-
identification: {
|
|
48
|
-
model: string;
|
|
49
|
-
classification: string;
|
|
50
|
-
description: string;
|
|
51
|
-
};
|
|
52
|
-
setup?(): ArrayBuffer[];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
interface GPSOptions {
|
|
56
|
-
sensor: GPSSensorOptions;
|
|
57
|
-
protocol: GPSProtocol;
|
|
58
|
-
onSample?: (this: GPS) => void;
|
|
59
|
-
onError?: (this: GPS, error: Error) => void;
|
|
60
|
-
target?: unknown;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/** enableHighAccuracy is accepted for Location API alignment; currently a no-op. */
|
|
64
|
-
interface GPSConfiguration {
|
|
65
|
-
enableHighAccuracy?: boolean;
|
|
66
|
-
timeout?: number;
|
|
67
|
-
maximumAge?: number;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface GPSSample {
|
|
71
|
-
latitude: number;
|
|
72
|
-
longitude: number;
|
|
73
|
-
altitude?: number;
|
|
74
|
-
accuracy?: number;
|
|
75
|
-
altitudeAccuracy?: number;
|
|
76
|
-
heading?: number;
|
|
77
|
-
speed?: number;
|
|
78
|
-
timestamp?: number;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
class GPS {
|
|
82
|
-
constructor(options: GPSOptions);
|
|
83
|
-
configure(options: GPSConfiguration): void;
|
|
84
|
-
sample(): GPSSample | undefined;
|
|
85
|
-
close(): void;
|
|
86
|
-
readonly identification: {
|
|
87
|
-
model: string;
|
|
88
|
-
classification: string;
|
|
89
|
-
description: string;
|
|
90
|
-
};
|
|
91
|
-
target?: unknown;
|
|
92
|
-
}
|
|
93
|
-
interface GPS extends Disposable {}
|
|
94
|
-
|
|
95
|
-
export { GPS as default, GPS };
|
|
96
|
-
}
|