@moonbit/moonc-worker 0.1.202411270 → 0.1.202411271

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.
Files changed (2) hide show
  1. package/moonc-web.d.ts +86 -0
  2. package/package.json +3 -1
package/moonc-web.d.ts ADDED
@@ -0,0 +1,86 @@
1
+ type Target = "wasm-gc" | "wasm" | "js";
2
+
3
+ type patchAdd = {
4
+ name: string;
5
+ content: string;
6
+ };
7
+
8
+ type patchDrop = {
9
+ file: string;
10
+ index: number;
11
+ };
12
+
13
+ type patches = {
14
+ drops: patchDrop[];
15
+ patches: patchAdd[];
16
+ };
17
+
18
+ type checkParams = {
19
+ mbtFiles: [string, string][];
20
+ miFiles: [string, Uint8Array][];
21
+ stdMiFiles: [string, Uint8Array][];
22
+ target: Target;
23
+ pkg: string;
24
+ pkgSources: string[];
25
+ isMain: boolean;
26
+ patches?: patches;
27
+ errorFormat: "human" | "json";
28
+ };
29
+
30
+ type checkResult = {
31
+ mi: Uint8Array;
32
+ diagnostics: string[];
33
+ };
34
+
35
+ type buildPackageParams = {
36
+ mbtFiles: [string, string][];
37
+ miFiles: [string, Uint8Array][];
38
+ stdMiFiles: [string, Uint8Array][];
39
+ target: Target;
40
+ pkg: string;
41
+ pkgSources: string[];
42
+ isMain: boolean;
43
+ errorFormat: "human" | "json";
44
+ };
45
+
46
+ type buildPackageResult = {
47
+ core?: Uint8Array;
48
+ mi?: Uint8Array;
49
+ diagnostics: string[];
50
+ };
51
+
52
+ type linkCoreParams = {
53
+ coreFiles: Uint8Array[];
54
+ main: string;
55
+ pkgSources: string[];
56
+ target: Target;
57
+ exportedFunctions: string[];
58
+ outputFormat: "wasm" | "wat";
59
+ testMode: boolean;
60
+ debug: boolean;
61
+ sourceMap: boolean;
62
+ sources: { [key: string]: string };
63
+ };
64
+
65
+ type linkCoreResult = {
66
+ wasm: Uint8Array;
67
+ sourceMap?: string;
68
+ };
69
+
70
+ type genTestInfoParams = {
71
+ mbtFiles: [string, string][];
72
+ };
73
+
74
+ declare function check(params: checkParams): checkResult;
75
+ declare function buildPackage(params: buildPackageParams): buildPackageResult;
76
+ declare function linkCore(params: linkCoreParams): linkCoreResult;
77
+ declare function genTestInfo(params: genTestInfoParams): string;
78
+
79
+ export { check, buildPackage, linkCore, genTestInfo };
80
+ export type {
81
+ checkParams,
82
+ buildPackageParams,
83
+ linkCoreParams,
84
+ genTestInfoParams,
85
+ patches,
86
+ };
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@moonbit/moonc-worker",
3
- "version": "0.1.202411270+d1e1b6b86",
3
+ "version": "0.1.202411271+d1e1b6b86",
4
4
  "description": "browser compiler in worker for moonbit language",
5
+ "types": "moonc-web.d.ts",
5
6
  "files": [
7
+ "moonc-web.d.ts",
6
8
  "moonc-worker.js"
7
9
  ],
8
10
  "keywords": [