@moddable/typings 7.0.0 → 7.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/ChatAudioIO.d.ts +2 -1
- package/base64.d.ts +1 -1
- package/commodetto/Bitmap.d.ts +5 -1
- package/commodetto/BufferOut.d.ts +2 -2
- package/commodetto/Convert.d.ts +3 -3
- package/commodetto/ReadGIF.d.ts +1 -1
- package/commodetto/ReadPNG.d.ts +2 -2
- package/commodetto/loadJPEG.d.ts +1 -1
- package/commodetto/parseBMF.d.ts +1 -1
- package/commodetto/parseNFNT.d.ts +1 -1
- package/commodetto/readJPEG.d.ts +2 -2
- package/crc.d.ts +2 -2
- package/deflate.d.ts +1 -1
- package/display.d.ts +1 -1
- package/dns/parser.d.ts +1 -1
- package/embedded/display.d.ts +2 -2
- package/embedded/storage/files.d.ts +2 -2
- package/embedded/storage/flash.d.ts +2 -2
- package/embedded/storage/key-value.d.ts +4 -3
- package/embedded_io/_common.d.ts +0 -1
- package/embedded_io/audio/in.d.ts +1 -3
- package/embedded_io/audio/out.d.ts +1 -3
- package/embedded_io/ble/central.d.ts +3 -4
- package/embedded_io/ble/peripheral.d.ts +6 -7
- package/embedded_io/i2c.d.ts +3 -3
- package/embedded_io/serial.d.ts +3 -3
- package/embedded_io/smbus.d.ts +2 -3
- package/embedded_io/socket/tcp.d.ts +2 -3
- package/embedded_io/socket/udp.d.ts +1 -2
- package/embedded_io/spi.d.ts +4 -4
- package/embedded_network/http/client.d.ts +7 -8
- package/embedded_network/mqtt/client.d.ts +4 -6
- package/embedded_network/websocket/client.d.ts +74 -0
- package/flash.d.ts +1 -1
- package/global.d.ts +10 -7
- package/hex.d.ts +1 -1
- package/inflate.d.ts +1 -1
- package/package.json +1 -1
- package/pebble/accelerometer.d.ts +46 -0
- package/pebble/battery.d.ts +38 -0
- package/pebble/button.d.ts +40 -0
- package/pebble/compass.d.ts +40 -0
- package/pebble/device.d.ts +51 -0
- package/pebble/global.d.ts +128 -0
- package/pebble/location.d.ts +50 -0
- package/pebble/message.d.ts +46 -0
- package/pebble/piu.d.ts +97 -0
- package/pebble/poco.d.ts +79 -0
- package/pins/audioout.d.ts +1 -1
- package/piu/MC-types.d.ts +543 -0
- package/piu/MC.d.ts +78 -526
- package/qrcode.d.ts +6 -4
- package/securesocket.d.ts +1 -1
- package/socket.d.ts +1 -1
- package/web/fetch.d.ts +28 -0
- package/{url.d.ts → web/url.d.ts} +1 -1
- package/web/websocket.d.ts +62 -0
- package/web/webstorage.d.ts +11 -0
- package/xs.d.ts +3 -3
- package/zip.d.ts +1 -1
- /package/{headers.d.ts → web/headers.d.ts} +0 -0
- /package/{structuredClone.d.ts → web/structuredClone.d.ts} +0 -0
- /package/{worker.d.ts → web/worker.d.ts} +0 -0
package/global.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import Device from "embedded:provider/builtin"
|
|
1
|
+
declare module "global" {
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import System_ from "embedded:io/system"
|
|
4
|
+
import Device from "embedded:provider/builtin"
|
|
5
|
+
|
|
6
|
+
export {}
|
|
7
|
+
global {
|
|
8
|
+
// NOTE: `System` is non-standard and temporary to support the IO examples. Breaking changes are possible.
|
|
9
|
+
var System: typeof System_;
|
|
10
|
+
var device: typeof Device;
|
|
11
|
+
}
|
|
9
12
|
}
|
package/hex.d.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
declare module "hex" {
|
|
22
22
|
var Hex: {
|
|
23
23
|
toBuffer: (str: string, separator?: string) => ArrayBuffer;
|
|
24
|
-
toString: (buffer:
|
|
24
|
+
toString: (buffer: ByteBuffer, separator?: string) => string;
|
|
25
25
|
}
|
|
26
26
|
export {Hex as default};
|
|
27
27
|
}
|
package/inflate.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare module "inflate" {
|
|
|
24
24
|
constructor(options?: {windowBits?: number});
|
|
25
25
|
close(): void;
|
|
26
26
|
|
|
27
|
-
push(buffer:
|
|
27
|
+
push(buffer: ByteBuffer, end?: boolean): number;
|
|
28
28
|
|
|
29
29
|
onData: (data: ArrayBuffer) => void;
|
|
30
30
|
onEnd: (status: number) => void;
|
package/package.json
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-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
|
+
type TapDirection = "+x" | "-x" | "+y" | "-y" | "+z" | "-z";
|
|
22
|
+
|
|
23
|
+
interface AccelerometerOptions {
|
|
24
|
+
onSample?: () => void;
|
|
25
|
+
onTap?: (direction: TapDirection) => void;
|
|
26
|
+
onDoubleTap?: (direction: TapDirection) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface AccelerometerConfigureOptions {
|
|
30
|
+
hz?: 10 | 25 | 50 | 100;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface AccelerometerSample {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
z: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare class Accelerometer {
|
|
40
|
+
constructor(options: AccelerometerOptions);
|
|
41
|
+
close(): void;
|
|
42
|
+
configure(options: AccelerometerConfigureOptions): void;
|
|
43
|
+
sample(): AccelerometerSample;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default Accelerometer;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-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
|
+
interface BatteryOptions {
|
|
22
|
+
onSample?: () => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface BatterySample {
|
|
26
|
+
percent: number;
|
|
27
|
+
charging: boolean;
|
|
28
|
+
plugged: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare class Battery {
|
|
32
|
+
constructor(options: BatteryOptions);
|
|
33
|
+
close(): void;
|
|
34
|
+
configure(options: {}): void;
|
|
35
|
+
sample(): BatterySample;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default Battery;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-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
|
+
type ButtonType = "back" | "up" | "down" | "select";
|
|
22
|
+
|
|
23
|
+
interface PebbleButtonSingleOptions {
|
|
24
|
+
type: ButtonType;
|
|
25
|
+
onPush: (pushed: 0 | 1, type: ButtonType) => void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface PebbleButtonMultipleOptions {
|
|
29
|
+
types: ButtonType[];
|
|
30
|
+
onPush: (pushed: 0 | 1, type: ButtonType) => void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type PebbleButtonOptions = PebbleButtonSingleOptions | PebbleButtonMultipleOptions;
|
|
34
|
+
|
|
35
|
+
declare class PebbleButton {
|
|
36
|
+
constructor(options: PebbleButtonOptions);
|
|
37
|
+
close(): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default PebbleButton;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-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
|
+
interface CompassOptions {
|
|
22
|
+
onSample?: () => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface CompassConfigureOptions {
|
|
26
|
+
filter?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface CompassSample {
|
|
30
|
+
heading: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
declare class Compass {
|
|
34
|
+
constructor(options: CompassOptions);
|
|
35
|
+
close(): void;
|
|
36
|
+
configure(options: CompassConfigureOptions): void;
|
|
37
|
+
sample(): CompassSample;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default Compass;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-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:provider/builtin" {
|
|
22
|
+
|
|
23
|
+
const device: {
|
|
24
|
+
readonly network: {
|
|
25
|
+
http: {
|
|
26
|
+
io: typeof import("embedded:network/http/client").default;
|
|
27
|
+
protocol: "http";
|
|
28
|
+
};
|
|
29
|
+
https: {
|
|
30
|
+
io: typeof import("embedded:network/http/client").default;
|
|
31
|
+
protocol: "https";
|
|
32
|
+
};
|
|
33
|
+
ws: {
|
|
34
|
+
io: typeof import("embedded:network/websocket/client").default;
|
|
35
|
+
secure: false;
|
|
36
|
+
};
|
|
37
|
+
wss: {
|
|
38
|
+
io: typeof import("embedded:network/websocket/client").default;
|
|
39
|
+
secure: true;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly info: {
|
|
43
|
+
readonly language: string,
|
|
44
|
+
readonly serialNumber: string,
|
|
45
|
+
}
|
|
46
|
+
readonly files: import("embedded:storage/files").Directory;
|
|
47
|
+
readonly keyValue: typeof import("embedded:storage/key-value").default;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default device;
|
|
51
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-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
|
+
/*
|
|
22
|
+
console
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
interface Console {
|
|
26
|
+
log(...args: any[]): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare const console:Console;
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
watch global
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
interface TimeChangeEvent {
|
|
36
|
+
date: Date;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface ConnectionState {
|
|
40
|
+
app: boolean;
|
|
41
|
+
pebblekit: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
type TimeEventType = "secondchange" | "minutechange" | "hourchange" | "daychange";
|
|
45
|
+
|
|
46
|
+
type PebbleEventType = TimeEventType | "connected" | "resize";
|
|
47
|
+
|
|
48
|
+
type TimeChangeCallback = (event: TimeChangeEvent) => void;
|
|
49
|
+
|
|
50
|
+
type ConnectedCallback = () => void;
|
|
51
|
+
|
|
52
|
+
type ResizeCallback = (progress: number) => void;
|
|
53
|
+
|
|
54
|
+
interface watch {
|
|
55
|
+
addEventListener(event: TimeEventType, callback: TimeChangeCallback): void;
|
|
56
|
+
addEventListener(event: "connected", callback: ConnectedCallback): void;
|
|
57
|
+
addEventListener(event: "resize", callback: ResizeCallback): void;
|
|
58
|
+
removeEventListener(event: TimeEventType, callback: TimeChangeCallback): void;
|
|
59
|
+
removeEventListener(event: "connected", callback: ConnectedCallback): void;
|
|
60
|
+
removeEventListener(event: "resize", callback: ResizeCallback): void;
|
|
61
|
+
readonly connected: ConnectionState;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare const watch: watch;
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
Resource
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
declare const Resource: typeof import('Resource').default;
|
|
71
|
+
|
|
72
|
+
/*
|
|
73
|
+
setTimeout and friends
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
declare function setInterval(callback: () => void, delay: number): number;
|
|
77
|
+
declare function clearInterval(id: number): void;
|
|
78
|
+
declare function setTimeout(callback: () => void, delay: number): number;
|
|
79
|
+
declare function clearTimeout(id: number): void;
|
|
80
|
+
|
|
81
|
+
/*
|
|
82
|
+
Web
|
|
83
|
+
*/
|
|
84
|
+
|
|
85
|
+
declare const URL: typeof import('url').URL;
|
|
86
|
+
declare const URLSearchParams: typeof import('url').URLSearchParams;
|
|
87
|
+
declare const Headers: typeof import('headers').default;
|
|
88
|
+
declare const localStorage: import('web/webstorage').default;
|
|
89
|
+
declare const WebSocket: typeof import('web/websocket').default;
|
|
90
|
+
declare const fetch: typeof import('web/fetch').fetch;
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
Piu
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
declare const Application: ApplicationConstructor;
|
|
97
|
+
declare const Behavior: BehaviorConstructor;
|
|
98
|
+
declare const Column: ColumnConstructor;
|
|
99
|
+
declare const Container: ContainerConstructor;
|
|
100
|
+
declare const Content: ContentConstructor;
|
|
101
|
+
declare const Label: LabelConstructor;
|
|
102
|
+
declare const Link: LinkConstructor;
|
|
103
|
+
declare const Locals: Locals;
|
|
104
|
+
declare const Port: PortConstructor;
|
|
105
|
+
declare const Row: RowConstructor;
|
|
106
|
+
declare const Skin: SkinConstructor;
|
|
107
|
+
declare const Style: StyleConstructor;
|
|
108
|
+
declare const Text: TextConstructor;
|
|
109
|
+
declare const Texture: TextureConstructor;
|
|
110
|
+
declare const Transition: TransitionConstructor;
|
|
111
|
+
|
|
112
|
+
declare const InverterConstructor: InverterConstructor;
|
|
113
|
+
declare const RoundRect: RoundRectConstructor;
|
|
114
|
+
declare const ScreenBufferConstructor: ScreenBufferConstructor;
|
|
115
|
+
declare const SVGImage: SVGImageConsructor;
|
|
116
|
+
|
|
117
|
+
/*
|
|
118
|
+
ECMA-419
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
// device is defined in typings/pebble/device.d.ts
|
|
122
|
+
|
|
123
|
+
declare module "embedded:storage/files" {
|
|
124
|
+
interface DirectoryOpenFileOptions {
|
|
125
|
+
size?: number;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-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
|
+
interface LocationSample {
|
|
22
|
+
latitude: number;
|
|
23
|
+
longitude: number;
|
|
24
|
+
altitude?: number;
|
|
25
|
+
accuracy?: number;
|
|
26
|
+
altitudeAccuracy?: number;
|
|
27
|
+
heading?: number;
|
|
28
|
+
speed?: number;
|
|
29
|
+
timestamp?: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface LocationOptions {
|
|
33
|
+
onSample?: () => void;
|
|
34
|
+
onError?: (error: Error) => void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface LocationConfiguration {
|
|
38
|
+
enableHighAccuracy?: boolean;
|
|
39
|
+
timeout?: number;
|
|
40
|
+
maximumAge?: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare class Location {
|
|
44
|
+
constructor(options: LocationOptions);
|
|
45
|
+
close(): void;
|
|
46
|
+
configure(options: LocationConfiguration): void;
|
|
47
|
+
sample(): LocationSample | undefined;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default Location;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-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
|
+
interface MessageOptions {
|
|
22
|
+
onReadable?: () => void;
|
|
23
|
+
onWritable?: (count: number) => void;
|
|
24
|
+
onSuspend?: () => void;
|
|
25
|
+
format?: "map";
|
|
26
|
+
input?: number;
|
|
27
|
+
output?: number;
|
|
28
|
+
keys?: Map<string, number> | Array<string>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type MessageKey = string | number;
|
|
32
|
+
type MessageReadValue = number | string | ArrayBuffer;
|
|
33
|
+
type MessageWriteValue = number | string | ByteBuffer | boolean;
|
|
34
|
+
|
|
35
|
+
declare class Message {
|
|
36
|
+
constructor(options: MessageOptions);
|
|
37
|
+
close(): void;
|
|
38
|
+
read(): Map<MessageKey, MessageReadValue>;
|
|
39
|
+
write(map: Map<MessageKey, MessageWriteValue>): void;
|
|
40
|
+
get format(): "map";
|
|
41
|
+
set format(value: "map");
|
|
42
|
+
get input(): number;
|
|
43
|
+
get output(): number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default Message;
|
package/pebble/piu.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-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
|
+
/*
|
|
22
|
+
SVGImage
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
interface SVGImageDictionary extends ContentDictionary {
|
|
26
|
+
clip?: boolean;
|
|
27
|
+
id?: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface SVGImage extends Content {
|
|
31
|
+
opacity: number;
|
|
32
|
+
center(x: number, y: number): void;
|
|
33
|
+
cx: number;
|
|
34
|
+
cy: number;
|
|
35
|
+
rotate(a: number): void;
|
|
36
|
+
r: number;
|
|
37
|
+
scale(x: number, y: number): void;
|
|
38
|
+
s: number;
|
|
39
|
+
sx: number;
|
|
40
|
+
sy: number;
|
|
41
|
+
translate(x: number, y: number): void;
|
|
42
|
+
tx: number;
|
|
43
|
+
ty: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface SVGImageConsructor {
|
|
47
|
+
new(behaviorData?: any, dictionary?: SVGImageDictionary): SVGImage;
|
|
48
|
+
template<T>(this: T, fn: (arg: any) => SVGImageDictionary): T;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/*
|
|
52
|
+
RoundRect
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
interface RoundRectDictionary extends ContentDictionary {
|
|
56
|
+
corners?: number;
|
|
57
|
+
radius?: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface RoundRect extends Content {
|
|
61
|
+
corners: number;
|
|
62
|
+
radius: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface RoundRectConstructor {
|
|
66
|
+
new(behaviorData?: any, dictionary?: RoundRectDictionary): RoundRect;
|
|
67
|
+
template<T>(this: T, fn: (arg: any) => RoundRectDictionary): T;
|
|
68
|
+
|
|
69
|
+
readonly topLeft: 1;
|
|
70
|
+
readonly topRight: 2;
|
|
71
|
+
readonly bottomLeft: 4;
|
|
72
|
+
readonly bottomRight: 8;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/*
|
|
76
|
+
Inverter
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
interface Inverter extends Content {
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface InverterConstructor {
|
|
83
|
+
new(behaviorData?: any, dictionary?: ContentDictionary): Inverter;
|
|
84
|
+
template<T>(this: T, fn: (arg: any) => ContentDictionary): T;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/*
|
|
88
|
+
ScreenBuffer
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
interface ScreenBuffer extends Content {
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface ScreenBufferConstructor {
|
|
95
|
+
new(behaviorData?: any, dictionary?: ContentDictionary): ScreenBuffer;
|
|
96
|
+
template<T>(this: T, fn: (arg: any) => ContentDictionary): T;
|
|
97
|
+
}
|
package/pebble/poco.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-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
|
+
/// <reference path="../commodetto/Poco.d.ts" />
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
declare module "commodetto/Poco" {
|
|
25
|
+
import Bitmap from "commodetto/Bitmap";
|
|
26
|
+
|
|
27
|
+
interface FontConstructor {
|
|
28
|
+
new(family: string, size: number): Font;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface PocoPrototype {
|
|
32
|
+
Font: FontConstructor;
|
|
33
|
+
unobstructed: {
|
|
34
|
+
readonly x: number;
|
|
35
|
+
readonly y: number;
|
|
36
|
+
readonly width: number;
|
|
37
|
+
readonly height: number
|
|
38
|
+
};
|
|
39
|
+
drawLine(x0: number, y0: number, x1: number, y1: number, color: number, width: number): void;
|
|
40
|
+
drawRoundRect(x0: number, y0: number, x1: number, y1: number, color: number, radius: number, corners: number): void;
|
|
41
|
+
frameRoundRect(x0: number, y0: number, x1: number, y1: number, color: number, radius: number): void;
|
|
42
|
+
drawCircle(color: number, x: number, y: number, r: number, from: number, to: number): void;
|
|
43
|
+
drawDCI(dci: PebbleDrawCommandImage | PebbleDrawCommandSequence, x: number, y: number): void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
class PebbleBitmap extends Bitmap {
|
|
47
|
+
constructor(id: number | string);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
class PebbleDrawCommandList {
|
|
51
|
+
scale(x: number, y: number): this;
|
|
52
|
+
scale(scale: number): this;
|
|
53
|
+
rotate(angle: number, cx: number, cy: number): this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
class PebbleDrawCommandImage extends PebbleDrawCommandList {
|
|
57
|
+
constructor(id: number | string);
|
|
58
|
+
readonly width: number;
|
|
59
|
+
readonly height: number;
|
|
60
|
+
clone(): PebbleDrawCommandImage;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
class PebbleDrawCommandSequence {
|
|
64
|
+
constructor(id: number | string);
|
|
65
|
+
readonly width: number;
|
|
66
|
+
readonly height: number;
|
|
67
|
+
readonly duration: number;
|
|
68
|
+
readonly frameDuration: number;
|
|
69
|
+
time: number;
|
|
70
|
+
clone(): PebbleDrawCommandSequence;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface PocoConstructor {
|
|
74
|
+
PebbleBitmap: typeof PebbleBitmap;
|
|
75
|
+
PebbleDrawCommandImage: typeof PebbleDrawCommandImage;
|
|
76
|
+
PebbleDrawCommandSequence: typeof PebbleDrawCommandSequence;
|
|
77
|
+
PebbleDrawCommandList: typeof PebbleDrawCommandList;
|
|
78
|
+
}
|
|
79
|
+
}
|
package/pins/audioout.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ declare module 'pins/audioout' {
|
|
|
56
56
|
public enqueue(stream: number, kind: MixerVolume, volume: number): void
|
|
57
57
|
|
|
58
58
|
public mix(samplesNeeded: number): HostBuffer
|
|
59
|
-
public mix(buffer:
|
|
59
|
+
public mix(buffer: ByteBuffer): void
|
|
60
60
|
|
|
61
61
|
public length(stream: number): number
|
|
62
62
|
|