autolang-compiler 0.0.5

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,20 @@
1
+ type AutolangPointer = number;
2
+ type AutolangType = number | null | undefined | string | boolean | void | AutolangPointer;
3
+ type AutolangArgs = AutolangType[];
4
+ type AutolangNativeFunc = (args: AutolangArgs) => AutolangType;
5
+ declare class ACompiler {
6
+ private instance;
7
+ outputBuffer: string;
8
+ private constructor();
9
+ static create(customWasmUrl?: string): Promise<ACompiler>;
10
+ registerBuiltInLibrary(name: string, source: string, autoImport: boolean | undefined, methods: Record<string, AutolangNativeFunc>): void;
11
+ compileAndRun(path: string, code: string): boolean;
12
+ compile(path: string, code: string): boolean;
13
+ run(): boolean;
14
+ hasError(): boolean;
15
+ setOnError(callback: (error: string) => void): void;
16
+ setOnWarning(callback: (warning: string) => void): void;
17
+ refresh(): void;
18
+ }
19
+
20
+ export { ACompiler, type AutolangArgs, type AutolangNativeFunc, type AutolangPointer, type AutolangType };
@@ -0,0 +1,20 @@
1
+ type AutolangPointer = number;
2
+ type AutolangType = number | null | undefined | string | boolean | void | AutolangPointer;
3
+ type AutolangArgs = AutolangType[];
4
+ type AutolangNativeFunc = (args: AutolangArgs) => AutolangType;
5
+ declare class ACompiler {
6
+ private instance;
7
+ outputBuffer: string;
8
+ private constructor();
9
+ static create(customWasmUrl?: string): Promise<ACompiler>;
10
+ registerBuiltInLibrary(name: string, source: string, autoImport: boolean | undefined, methods: Record<string, AutolangNativeFunc>): void;
11
+ compileAndRun(path: string, code: string): boolean;
12
+ compile(path: string, code: string): boolean;
13
+ run(): boolean;
14
+ hasError(): boolean;
15
+ setOnError(callback: (error: string) => void): void;
16
+ setOnWarning(callback: (warning: string) => void): void;
17
+ refresh(): void;
18
+ }
19
+
20
+ export { ACompiler, type AutolangArgs, type AutolangNativeFunc, type AutolangPointer, type AutolangType };