@moonbit/moonpad-monaco 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.
@@ -0,0 +1,47 @@
1
+ declare function compile(content: string): Promise<CompileResult>;
2
+
3
+ declare type CompileResult = {
4
+ kind: "success";
5
+ wasm: Uint8Array;
6
+ } | {
7
+ kind: "error";
8
+ diagnostics: Diagnostic[];
9
+ };
10
+
11
+ declare type Diagnostic = {
12
+ level: "warning" | "error";
13
+ loc: {
14
+ path: string;
15
+ start: Position;
16
+ end: Position;
17
+ };
18
+ message: string;
19
+ error_code: number;
20
+ };
21
+
22
+ export declare function init(params: initParams): typeof moon;
23
+
24
+ declare function init_2(factory: () => Worker): void;
25
+
26
+ declare type initParams = {
27
+ onigWasmUrl: string;
28
+ lspWorker: Worker;
29
+ mooncWorkerFactory: () => Worker;
30
+ };
31
+
32
+ declare namespace moon {
33
+ export {
34
+ compile,
35
+ init_2 as init,
36
+ run
37
+ }
38
+ }
39
+
40
+ declare type Position = {
41
+ line: number;
42
+ col: number;
43
+ };
44
+
45
+ declare function run(wasm: Uint8Array): Promise<ReadableStream<Uint16Array>>;
46
+
47
+ export { }