@moddable/typings 8.2.0 → 8.2.2
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/embedded_network/interface/ethernet.d.ts +17 -3
- package/embedded_network/interface/wifi.d.ts +16 -2
- package/inflate.d.ts +2 -2
- package/mcpack.d.ts +45 -10
- package/modules.d.ts +2 -2
- package/package.json +1 -1
- package/pebble/button.d.ts +1 -1
- package/pebble/global.d.ts +1 -0
- package/pebble/poco.d.ts +9 -0
- package/piu/MC-types.d.ts +6 -6
- package/{tsconfig.base.json → tsconfig.es2024.json} +2 -2
- package/tsconfig.es2025.json +8 -0
- package/web/eventsource.d.ts +76 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2025 Moddable Tech, Inc.
|
|
2
|
+
* Copyright (c) 2025-2026 Moddable Tech, Inc.
|
|
3
3
|
*
|
|
4
4
|
* This file is part of the Moddable SDK Runtime.
|
|
5
5
|
*
|
|
@@ -21,17 +21,31 @@
|
|
|
21
21
|
declare module "embedded:network/interface/ethernet" {
|
|
22
22
|
import type {PortSpecifier} from "embedded:io/_common";
|
|
23
23
|
|
|
24
|
+
export type EthernetChangedProperty = "connection" | "address";
|
|
25
|
+
|
|
24
26
|
export interface EthernetConstructorOptions {
|
|
25
27
|
port?: PortSpecifier;
|
|
26
|
-
onChanged?: () => void;
|
|
28
|
+
onChanged?: (property: EthernetChangedProperty) => void;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface EthernetStaticAddress {
|
|
32
|
+
address: string;
|
|
33
|
+
mask: string;
|
|
34
|
+
gateway: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface EthernetConfigureOptions {
|
|
38
|
+
hostname?: string;
|
|
39
|
+
static?: EthernetStaticAddress | false;
|
|
27
40
|
}
|
|
28
41
|
|
|
29
42
|
class Ethernet {
|
|
30
43
|
constructor(options: EthernetConstructorOptions);
|
|
31
44
|
|
|
32
45
|
close(): void;
|
|
33
|
-
connect(
|
|
46
|
+
connect(): void;
|
|
34
47
|
disconnect(): void;
|
|
48
|
+
configure(options: EthernetConfigureOptions): void;
|
|
35
49
|
|
|
36
50
|
readonly connection: number;
|
|
37
51
|
readonly address: string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2025 Moddable Tech, Inc.
|
|
2
|
+
* Copyright (c) 2025-2026 Moddable Tech, Inc.
|
|
3
3
|
*
|
|
4
4
|
* This file is part of the Moddable SDK Runtime.
|
|
5
5
|
*
|
|
@@ -21,9 +21,11 @@
|
|
|
21
21
|
declare module "embedded:network/interface/wifi" {
|
|
22
22
|
import type {PortSpecifier} from "embedded:io/_common";
|
|
23
23
|
|
|
24
|
+
export type WiFiChangedProperty = "connection" | "address";
|
|
25
|
+
|
|
24
26
|
export interface WiFiConstructorOptions {
|
|
25
27
|
port?: PortSpecifier;
|
|
26
|
-
onChanged?: () => void;
|
|
28
|
+
onChanged?: (property: WiFiChangedProperty) => void;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export interface WiFiScanResult {
|
|
@@ -43,6 +45,17 @@ declare module "embedded:network/interface/wifi" {
|
|
|
43
45
|
password?: string;
|
|
44
46
|
}
|
|
45
47
|
|
|
48
|
+
export interface WiFiStaticAddress {
|
|
49
|
+
address: string;
|
|
50
|
+
mask: string;
|
|
51
|
+
gateway: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface WiFiConfigureOptions {
|
|
55
|
+
hostname?: string;
|
|
56
|
+
static?: WiFiStaticAddress | false;
|
|
57
|
+
}
|
|
58
|
+
|
|
46
59
|
class WiFi {
|
|
47
60
|
constructor(options: WiFiConstructorOptions);
|
|
48
61
|
|
|
@@ -50,6 +63,7 @@ declare module "embedded:network/interface/wifi" {
|
|
|
50
63
|
scan(options: WiFiScanOptions): void;
|
|
51
64
|
connect(options: WiFiConnectOptions): void;
|
|
52
65
|
disconnect(): void;
|
|
66
|
+
configure(options: WiFiConfigureOptions): void;
|
|
53
67
|
|
|
54
68
|
readonly connection: number;
|
|
55
69
|
readonly address: string | undefined;
|
package/inflate.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2025 Moddable Tech, Inc.
|
|
2
|
+
* Copyright (c) 2025-2026 Moddable Tech, Inc.
|
|
3
3
|
*
|
|
4
4
|
* This file is part of the Moddable SDK Tools.
|
|
5
5
|
*
|
|
@@ -24,7 +24,7 @@ declare module "inflate" {
|
|
|
24
24
|
constructor(options?: {windowBits?: number});
|
|
25
25
|
close(): void;
|
|
26
26
|
|
|
27
|
-
push(buffer: ByteBuffer,
|
|
27
|
+
push(buffer: ByteBuffer, flush?: boolean, output?: ByteBuffer): void;
|
|
28
28
|
|
|
29
29
|
onData: (data: ArrayBuffer) => void;
|
|
30
30
|
onEnd: (status: number) => void;
|
package/mcpack.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2026 Moddable Tech, Inc
|
|
3
3
|
*
|
|
4
4
|
* This file is part of the Moddable SDK Tools.
|
|
5
5
|
*
|
|
@@ -18,6 +18,17 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
/// <reference path="./web/eventsource.d.ts" />
|
|
22
|
+
/// <reference path="./web/fetch.d.ts" />
|
|
23
|
+
/// <reference path="./web/headers.d.ts" />
|
|
24
|
+
/// <reference path="./web/structuredClone.d.ts" />
|
|
25
|
+
/// <reference path="./web/url.d.ts" />
|
|
26
|
+
/// <reference path="./web/worker.d.ts" />
|
|
27
|
+
/// <reference path="./web/websocket.d.ts" />
|
|
28
|
+
/// <reference path="./web/webstorage.d.ts" />
|
|
29
|
+
/// <reference path="./text/decoder.d.ts" />
|
|
30
|
+
/// <reference path="./text/encoder.d.ts" />
|
|
31
|
+
|
|
21
32
|
import type Timer from "timer";
|
|
22
33
|
|
|
23
34
|
interface Console {
|
|
@@ -32,14 +43,38 @@ declare global {
|
|
|
32
43
|
const setImmediate: (handler: Function) => Timer;
|
|
33
44
|
const setInterval: (handler: Function, timeout?: number) => Timer;
|
|
34
45
|
const setTimeout: (handler: Function, timeout?: number) => Timer;
|
|
46
|
+
|
|
47
|
+
const EventSource: typeof import("web/eventsource").default;
|
|
48
|
+
type EventSource = import("web/eventsource").default;
|
|
49
|
+
|
|
50
|
+
const localStorage: import("webstorage").default;
|
|
51
|
+
|
|
52
|
+
const WebSocket: typeof import("web/websocket").default;
|
|
53
|
+
type WebSocket = import("web/websocket").default;
|
|
54
|
+
|
|
55
|
+
const Headers: typeof import("headers").default;
|
|
56
|
+
type Headers = import("headers").default;
|
|
57
|
+
|
|
58
|
+
const fetch: typeof import("fetch").fetch;
|
|
59
|
+
|
|
60
|
+
const structuredClone: typeof import("structuredClone").default;
|
|
61
|
+
|
|
62
|
+
const TextDecoder: typeof import("text/decoder").default;
|
|
63
|
+
type TextDecoder = import("text/decoder").default;
|
|
64
|
+
|
|
65
|
+
const TextEncoder: typeof import("text/encoder").default;
|
|
66
|
+
type TextEncoder = import("text/encoder").default;
|
|
67
|
+
|
|
68
|
+
const URL: typeof import("url").URL;
|
|
69
|
+
type URL = import("url").URL;
|
|
70
|
+
|
|
71
|
+
const URLSearchParams: typeof import("url").URLSearchParams;
|
|
72
|
+
type URLSearchParams = import("url").URLSearchParams;
|
|
73
|
+
|
|
74
|
+
const Worker: typeof import("worker").default;
|
|
75
|
+
type Worker = import("worker").default;
|
|
76
|
+
|
|
77
|
+
const SharedWorker: typeof import("worker").SharedWorker;
|
|
78
|
+
type SharedWorker = import("worker").SharedWorker;
|
|
35
79
|
}
|
|
36
80
|
|
|
37
|
-
// import fetch from "fetch";
|
|
38
|
-
// import Headers from "headers";
|
|
39
|
-
// import structuredClone from "structuredClone";
|
|
40
|
-
// import TextDecoder from "text/decoder";
|
|
41
|
-
// import TextEncoder from "text/encoder";
|
|
42
|
-
// import URL from "url";
|
|
43
|
-
// import { URLSearchParams } from "url";
|
|
44
|
-
// import Worker from "worker";
|
|
45
|
-
// import { SharedWorker } from "worker";
|
package/modules.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2022 Chris Midgley
|
|
2
|
+
* Copyright (c) 2022-2026 Chris Midgley
|
|
3
3
|
*
|
|
4
4
|
* This file is part of the Moddable SDK Tools.
|
|
5
5
|
*
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
declare module "modules" {
|
|
22
22
|
export default class Modules {
|
|
23
23
|
static has(name: string): boolean;
|
|
24
|
-
static importNow(name: string): unknown;
|
|
24
|
+
static importNow(name: string, namespace?: boolean): unknown;
|
|
25
25
|
static get host(): string[];
|
|
26
26
|
static get archive(): string[];
|
|
27
27
|
}
|
package/package.json
CHANGED
package/pebble/button.d.ts
CHANGED
package/pebble/global.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ interface watch {
|
|
|
85
85
|
removeEventListener(event: "didFocus", callback: FocusCallback): void;
|
|
86
86
|
removeEventListener(event: "wakeup", callback: WakeupCallback): void;
|
|
87
87
|
light(enable?: boolean): void;
|
|
88
|
+
exit(reason?: number): void;
|
|
88
89
|
readonly connected: ConnectionState;
|
|
89
90
|
readonly hour12: boolean;
|
|
90
91
|
readonly model: number;
|
package/pebble/poco.d.ts
CHANGED
|
@@ -47,10 +47,19 @@ declare module "commodetto/Poco" {
|
|
|
47
47
|
constructor(id: number | string);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
class PebbleDrawCommand {
|
|
51
|
+
readonly type: number;
|
|
52
|
+
strokeWidth: number;
|
|
53
|
+
stroke: number;
|
|
54
|
+
fill: number;
|
|
55
|
+
hidden: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
50
58
|
class PebbleDrawCommandList {
|
|
51
59
|
scale(x: number, y: number): this;
|
|
52
60
|
scale(scale: number): this;
|
|
53
61
|
rotate(angle: number, cx: number, cy: number): this;
|
|
62
|
+
process(callback: (this: PebbleDrawCommandList, command: PebbleDrawCommand) => void): this;
|
|
54
63
|
}
|
|
55
64
|
|
|
56
65
|
class PebbleDrawCommandImage extends PebbleDrawCommandList {
|
package/piu/MC-types.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export type Size = {
|
|
|
34
34
|
height?: number;
|
|
35
35
|
};
|
|
36
36
|
export type Bounds = Position & Size;
|
|
37
|
-
export type Color = string;
|
|
37
|
+
export type Color = string | number;
|
|
38
38
|
export type ContentState = {
|
|
39
39
|
state?: number;
|
|
40
40
|
variant?: number;
|
|
@@ -529,19 +529,19 @@ export interface Locals {
|
|
|
529
529
|
}
|
|
530
530
|
|
|
531
531
|
export interface blendColors {
|
|
532
|
-
(a: number, c1: number, c2: number): Color
|
|
532
|
+
(a: number, c1: number, c2: number): Extract<Color, number>
|
|
533
533
|
}
|
|
534
534
|
export interface hsl {
|
|
535
|
-
(h: number, s: number, l: number): Color
|
|
535
|
+
(h: number, s: number, l: number): Extract<Color, number>
|
|
536
536
|
}
|
|
537
537
|
export interface hsla {
|
|
538
|
-
(h: number, s: number, l: number, a: number): Color
|
|
538
|
+
(h: number, s: number, l: number, a: number): Extract<Color, number>
|
|
539
539
|
}
|
|
540
540
|
export interface rgb {
|
|
541
|
-
(r: number, g: number, b: number): Color
|
|
541
|
+
(r: number, g: number, b: number): Extract<Color, number>
|
|
542
542
|
}
|
|
543
543
|
export interface rgba {
|
|
544
|
-
(r: number, g: number, b: number, a: number): Color
|
|
544
|
+
(r: number, g: number, b: number, a: number): Extract<Color, number>
|
|
545
545
|
}
|
|
546
546
|
|
|
547
547
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "Base tsconfig for projects using @moddable/typings. Project tsconfig.json should `extends` this and add its own outDir, include, sourceMap, etc.",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"lib": ["
|
|
4
|
+
"lib": ["es2024"],
|
|
5
5
|
"module": "preserve",
|
|
6
6
|
"moduleResolution": "bundler",
|
|
7
|
-
"target": "
|
|
7
|
+
"target": "ES2024",
|
|
8
8
|
"baseUrl": ".",
|
|
9
9
|
"paths": {
|
|
10
10
|
"embedded:io/*": ["./embedded_io/*"],
|
|
@@ -0,0 +1,76 @@
|
|
|
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 "web/eventsource" {
|
|
22
|
+
import Headers from "headers"
|
|
23
|
+
|
|
24
|
+
interface EventSourceInit {
|
|
25
|
+
method?: string;
|
|
26
|
+
headers?: Headers | Record<string, string>;
|
|
27
|
+
body?: string | ArrayBuffer;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface EventSourceEvent {
|
|
31
|
+
type: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface EventSourceMessageEvent extends EventSourceEvent {
|
|
35
|
+
data: string;
|
|
36
|
+
origin: string;
|
|
37
|
+
lastEventID: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface EventSourceErrorEvent extends EventSourceEvent {
|
|
41
|
+
status?: number;
|
|
42
|
+
statusText?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type EventSourceEventListener = (event: any) => void;
|
|
46
|
+
|
|
47
|
+
class EventSource {
|
|
48
|
+
constructor(url: string, options?: EventSourceInit);
|
|
49
|
+
|
|
50
|
+
static readonly CONNECTING: 0;
|
|
51
|
+
static readonly OPEN: 1;
|
|
52
|
+
static readonly CLOSED: 2;
|
|
53
|
+
|
|
54
|
+
readonly CONNECTING: 0;
|
|
55
|
+
readonly OPEN: 1;
|
|
56
|
+
readonly CLOSED: 2;
|
|
57
|
+
|
|
58
|
+
readonly readyState: number;
|
|
59
|
+
readonly url: string;
|
|
60
|
+
|
|
61
|
+
onerror?(event: EventSourceErrorEvent): void;
|
|
62
|
+
onopen?(event: EventSourceEvent): void;
|
|
63
|
+
onmessage?(event: EventSourceMessageEvent): void;
|
|
64
|
+
|
|
65
|
+
addEventListener(type: "open", listener: (event: EventSourceEvent) => void): void;
|
|
66
|
+
addEventListener(type: "error", listener: (event: EventSourceErrorEvent) => void): void;
|
|
67
|
+
addEventListener(type: "message", listener: (event: EventSourceMessageEvent) => void): void;
|
|
68
|
+
addEventListener(type: string, listener: (event: EventSourceMessageEvent) => void): void;
|
|
69
|
+
|
|
70
|
+
removeEventListener(type: string, listener: EventSourceEventListener): void;
|
|
71
|
+
|
|
72
|
+
close(): void;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default EventSource;
|
|
76
|
+
}
|