@altronix/webtobin 0.6.0 → 0.7.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/package.json +5 -6
- package/webtobin.d.ts +44 -2
package/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altronix/webtobin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "./webtobin.mjs",
|
|
7
7
|
"types": "./webtobin.d.ts",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules npx jest"
|
|
10
|
-
},
|
|
11
8
|
"files": [
|
|
12
9
|
"webtobin.d.ts",
|
|
13
10
|
"webtobin.mjs",
|
|
@@ -16,9 +13,11 @@
|
|
|
16
13
|
"keywords": [],
|
|
17
14
|
"author": "",
|
|
18
15
|
"license": "ISC",
|
|
19
|
-
"packageManager": "pnpm@10.5.2",
|
|
20
16
|
"devDependencies": {
|
|
21
17
|
"cross-env": "^10.0.0",
|
|
22
18
|
"jest": "^30.1.3"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules npx jest"
|
|
23
22
|
}
|
|
24
|
-
}
|
|
23
|
+
}
|
package/webtobin.d.ts
CHANGED
|
@@ -1,7 +1,49 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface McubootVersion {
|
|
2
|
+
major: number;
|
|
3
|
+
minor: number;
|
|
4
|
+
revision: number;
|
|
5
|
+
build: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface McubootHeader {
|
|
9
|
+
magic: number;
|
|
10
|
+
loadAddr: number;
|
|
11
|
+
hdrSize: number;
|
|
12
|
+
protectTlvSize: number;
|
|
13
|
+
imgSize: number;
|
|
14
|
+
flags: number;
|
|
15
|
+
version: McubootVersion;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface McubootTlv {
|
|
19
|
+
type: number;
|
|
20
|
+
value: Uint8Array;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface McubootImage {
|
|
24
|
+
header: McubootHeader;
|
|
25
|
+
image: Uint8Array;
|
|
26
|
+
protectedTlvs: McubootTlv[];
|
|
27
|
+
tlvs: McubootTlv[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function parseMcubootImages(bin: Buffer | Uint8Array): McubootImage[];
|
|
31
|
+
|
|
32
|
+
export class AltronixImage {
|
|
33
|
+
partitionIndex: number;
|
|
34
|
+
partitionName: string;
|
|
35
|
+
constructor(mcubootImage: McubootImage);
|
|
36
|
+
static fromMcubootImage(img: McubootImage): AltronixImage;
|
|
37
|
+
readTlv(type: number): Uint8Array | null;
|
|
38
|
+
get header(): McubootHeader;
|
|
39
|
+
get image(): Uint8Array;
|
|
40
|
+
get version(): McubootVersion;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default class Webtobin {
|
|
2
44
|
constructor();
|
|
3
45
|
files: { path: string; data: Uint8Array }[];
|
|
4
|
-
static from(bin: Uint8Array):
|
|
46
|
+
static from(bin: Uint8Array): Webtobin;
|
|
5
47
|
append(path: string, data: string | Uint8Array): this;
|
|
6
48
|
remove(path: string): this;
|
|
7
49
|
print(): Uint8Array;
|