@leaningtech/cheerpx 0.9.0 → 0.9.1
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/index.d.ts +51 -0
- package/index.js +1 -1
- package/package.json +2 -2
package/index.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export class Device {
|
|
2
|
+
delete(): void;
|
|
3
|
+
}
|
|
4
|
+
export class CheerpOSDevice extends Device {
|
|
5
|
+
}
|
|
6
|
+
export class DataDevice extends CheerpOSDevice {
|
|
7
|
+
static create(): Promise<DataDevice>;
|
|
8
|
+
writeFile(path: string, data: string): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export class IDBDevice extends CheerpOSDevice {
|
|
11
|
+
static create(devName: string): Promise<IDBDevice>;
|
|
12
|
+
}
|
|
13
|
+
export class BlockDevice extends Device {
|
|
14
|
+
}
|
|
15
|
+
export class FileDevice extends BlockDevice {
|
|
16
|
+
static create(parent: CheerpOSDevice, fileName: string): Promise<FileDevice>;
|
|
17
|
+
}
|
|
18
|
+
export class GitHubDevice extends BlockDevice {
|
|
19
|
+
static create(url: string): Promise<GitHubDevice>;
|
|
20
|
+
}
|
|
21
|
+
export class HttpBytesDevice extends BlockDevice {
|
|
22
|
+
static create(url: string): Promise<HttpBytesDevice>;
|
|
23
|
+
}
|
|
24
|
+
export class Linux {
|
|
25
|
+
static create(optionals?: {mounts?: MountPointConfiguration[], networkInterface?: NetworkInterface}): Promise<Linux>;
|
|
26
|
+
delete(): void;
|
|
27
|
+
run(fileName: string, args: Array<string>, optionals?: { env?: string[]; cwd?: string; uid?: number; gid?: number; }): Promise<{ status: number }>;
|
|
28
|
+
setActivateConsole(activateFunc: (_: number) => void): EventListener;
|
|
29
|
+
setConsole(e: HTMLElement): void;
|
|
30
|
+
setCustomConsole(writeFunc: (buffer: Uint8Array, bufferLength: number) => void, columns: number, rows: number): EventListener;
|
|
31
|
+
registerCallback(eventName: string, cb: EventListener): void;
|
|
32
|
+
unregisterCallback(eventName: string, cb: EventListener): void;
|
|
33
|
+
}
|
|
34
|
+
export class OverlayDevice extends BlockDevice {
|
|
35
|
+
static create(src: BlockDevice, idb: IDBDevice): Promise<OverlayDevice>;
|
|
36
|
+
}
|
|
37
|
+
export class WebDevice extends CheerpOSDevice {
|
|
38
|
+
static create(url: string): Promise<WebDevice>;
|
|
39
|
+
}
|
|
40
|
+
interface MountPointConfiguration {
|
|
41
|
+
type: "ext2" | "dir" | "devs" | "proc";
|
|
42
|
+
path: string;
|
|
43
|
+
dev: Device;
|
|
44
|
+
}
|
|
45
|
+
interface NetworkInterface {
|
|
46
|
+
authKey?: string;
|
|
47
|
+
controlUrl?: string;
|
|
48
|
+
loginUrlCb?: (url: string) => void;
|
|
49
|
+
stateUpdateCb?: (state: number) => void;
|
|
50
|
+
netmapUpdateCb?: (map: any) => void;
|
|
51
|
+
}
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leaningtech/cheerpx",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"leaningtech"
|
|
26
26
|
],
|
|
27
27
|
"scripts": {
|
|
28
|
-
"prepack": "cp ../../README.md ../../LICENSE.txt ../../src/index.js ."
|
|
28
|
+
"prepack": "cp ../../README.md ../../LICENSE.txt ../../src/index.js ../../src/index.d.ts ."
|
|
29
29
|
},
|
|
30
30
|
"author": "Leaning Technologies",
|
|
31
31
|
"license": "SEE LICENSE IN LICENSE.txt",
|