@moonbit/moonc-worker 0.1.202411270 → 0.1.202412020

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/moonc-web.d.ts ADDED
@@ -0,0 +1,87 @@
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
+ warnAsError?: boolean
29
+ };
30
+
31
+ type checkResult = {
32
+ mi: Uint8Array;
33
+ diagnostics: string[];
34
+ };
35
+
36
+ type buildPackageParams = {
37
+ mbtFiles: [string, string][];
38
+ miFiles: [string, Uint8Array][];
39
+ stdMiFiles: [string, Uint8Array][];
40
+ target: Target;
41
+ pkg: string;
42
+ pkgSources: string[];
43
+ isMain: boolean;
44
+ errorFormat: "human" | "json";
45
+ };
46
+
47
+ type buildPackageResult = {
48
+ core?: Uint8Array;
49
+ mi?: Uint8Array;
50
+ diagnostics: string[];
51
+ };
52
+
53
+ type linkCoreParams = {
54
+ coreFiles: Uint8Array[];
55
+ main: string;
56
+ pkgSources: string[];
57
+ target: Target;
58
+ exportedFunctions: string[];
59
+ outputFormat: "wasm" | "wat";
60
+ testMode: boolean;
61
+ debug: boolean;
62
+ sourceMap: boolean;
63
+ sources: { [key: string]: string };
64
+ };
65
+
66
+ type linkCoreResult = {
67
+ wasm: Uint8Array;
68
+ sourceMap?: string;
69
+ };
70
+
71
+ type genTestInfoParams = {
72
+ mbtFiles: [string, string][];
73
+ };
74
+
75
+ declare function check(params: checkParams): checkResult;
76
+ declare function buildPackage(params: buildPackageParams): buildPackageResult;
77
+ declare function linkCore(params: linkCoreParams): linkCoreResult;
78
+ declare function genTestInfo(params: genTestInfoParams): string;
79
+
80
+ export { check, buildPackage, linkCore, genTestInfo };
81
+ export type {
82
+ checkParams,
83
+ buildPackageParams,
84
+ linkCoreParams,
85
+ genTestInfoParams,
86
+ patches,
87
+ };