autolang-compiler 0.0.5 → 0.0.6
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/dist/index.d.mts +23 -10
- package/dist/index.d.ts +23 -10
- package/dist/index.js +5 -7
- package/dist/index.mjs +5 -7
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
|
-
type
|
|
2
|
-
type AutolangType = number | null | undefined | string | boolean | void |
|
|
3
|
-
type
|
|
4
|
-
|
|
1
|
+
type AObject = number;
|
|
2
|
+
type AutolangType = number | null | undefined | string | boolean | void | AObject;
|
|
3
|
+
type AutolangNativeFunc = (thisArg: AutolangType, ...args: AutolangType[]) => (number | null | string | boolean | void);
|
|
4
|
+
interface LibraryConfig {
|
|
5
|
+
autoImport?: boolean;
|
|
6
|
+
allowLateinitKeyword?: boolean;
|
|
7
|
+
allowNonNullAssertion?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface AException {
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
5
12
|
declare class ACompiler {
|
|
6
13
|
private instance;
|
|
7
|
-
outputBuffer: string;
|
|
8
14
|
private constructor();
|
|
9
15
|
static create(customWasmUrl?: string): Promise<ACompiler>;
|
|
10
|
-
|
|
16
|
+
getOutput(): any;
|
|
17
|
+
clearOutput(): void;
|
|
18
|
+
registerBuiltInLibrary(name: string, source: string, config?: LibraryConfig, methods?: Record<string, AutolangNativeFunc>): void;
|
|
19
|
+
setMainSourceConfig(config: LibraryConfig): void;
|
|
20
|
+
setLimitOpcodeCount(limit: number): void;
|
|
11
21
|
compileAndRun(path: string, code: string): boolean;
|
|
12
22
|
compile(path: string, code: string): boolean;
|
|
13
23
|
run(): boolean;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
hasCompilerError(): boolean;
|
|
25
|
+
throwException(message: string): boolean;
|
|
26
|
+
hasException(): boolean;
|
|
27
|
+
getException(): AException | null;
|
|
28
|
+
setOnError(callback: ((error: string) => void) | null): void;
|
|
29
|
+
setOnWarning(callback: ((warning: string) => void) | null): void;
|
|
17
30
|
refresh(): void;
|
|
18
31
|
}
|
|
19
32
|
|
|
20
|
-
export { ACompiler, type
|
|
33
|
+
export { ACompiler, type AException, type AObject, type AutolangNativeFunc, type AutolangType, type LibraryConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
|
-
type
|
|
2
|
-
type AutolangType = number | null | undefined | string | boolean | void |
|
|
3
|
-
type
|
|
4
|
-
|
|
1
|
+
type AObject = number;
|
|
2
|
+
type AutolangType = number | null | undefined | string | boolean | void | AObject;
|
|
3
|
+
type AutolangNativeFunc = (thisArg: AutolangType, ...args: AutolangType[]) => (number | null | string | boolean | void);
|
|
4
|
+
interface LibraryConfig {
|
|
5
|
+
autoImport?: boolean;
|
|
6
|
+
allowLateinitKeyword?: boolean;
|
|
7
|
+
allowNonNullAssertion?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface AException {
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
5
12
|
declare class ACompiler {
|
|
6
13
|
private instance;
|
|
7
|
-
outputBuffer: string;
|
|
8
14
|
private constructor();
|
|
9
15
|
static create(customWasmUrl?: string): Promise<ACompiler>;
|
|
10
|
-
|
|
16
|
+
getOutput(): any;
|
|
17
|
+
clearOutput(): void;
|
|
18
|
+
registerBuiltInLibrary(name: string, source: string, config?: LibraryConfig, methods?: Record<string, AutolangNativeFunc>): void;
|
|
19
|
+
setMainSourceConfig(config: LibraryConfig): void;
|
|
20
|
+
setLimitOpcodeCount(limit: number): void;
|
|
11
21
|
compileAndRun(path: string, code: string): boolean;
|
|
12
22
|
compile(path: string, code: string): boolean;
|
|
13
23
|
run(): boolean;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
hasCompilerError(): boolean;
|
|
25
|
+
throwException(message: string): boolean;
|
|
26
|
+
hasException(): boolean;
|
|
27
|
+
getException(): AException | null;
|
|
28
|
+
setOnError(callback: ((error: string) => void) | null): void;
|
|
29
|
+
setOnWarning(callback: ((warning: string) => void) | null): void;
|
|
17
30
|
refresh(): void;
|
|
18
31
|
}
|
|
19
32
|
|
|
20
|
-
export { ACompiler, type
|
|
33
|
+
export { ACompiler, type AException, type AObject, type AutolangNativeFunc, type AutolangType, type LibraryConfig };
|