autolang-compiler 0.0.8 → 0.0.10

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 CHANGED
@@ -1,6 +1,12 @@
1
1
  type AObject = number;
2
2
  type AutolangType = number | null | undefined | string | boolean | void | AObject;
3
3
  type AutolangNativeFunc = (thisArg: AutolangType, ...args: AutolangType[]) => (number | null | string | boolean | void);
4
+ interface ACompilerConfig {
5
+ addStdFile?: boolean;
6
+ addStdRegex?: boolean;
7
+ addStdJson?: boolean;
8
+ addStdMath?: boolean;
9
+ }
4
10
  interface LibraryConfig {
5
11
  autoImport?: boolean;
6
12
  allowLateinitKeyword?: boolean;
@@ -12,7 +18,7 @@ interface AException {
12
18
  declare class ACompiler {
13
19
  private instance;
14
20
  private constructor();
15
- static create(customWasmUrl?: string): Promise<ACompiler>;
21
+ static create(config?: ACompilerConfig): Promise<ACompiler>;
16
22
  getOutput(): any;
17
23
  clearOutput(): void;
18
24
  registerBuiltInLibrary(name: string, source: string, config?: LibraryConfig, methods?: Record<string, AutolangNativeFunc>): void;
@@ -30,4 +36,4 @@ declare class ACompiler {
30
36
  refresh(): void;
31
37
  }
32
38
 
33
- export { ACompiler, type AException, type AObject, type AutolangNativeFunc, type AutolangType, type LibraryConfig };
39
+ export { ACompiler, type ACompilerConfig, type AException, type AObject, type AutolangNativeFunc, type AutolangType, type LibraryConfig };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,12 @@
1
1
  type AObject = number;
2
2
  type AutolangType = number | null | undefined | string | boolean | void | AObject;
3
3
  type AutolangNativeFunc = (thisArg: AutolangType, ...args: AutolangType[]) => (number | null | string | boolean | void);
4
+ interface ACompilerConfig {
5
+ addStdFile?: boolean;
6
+ addStdRegex?: boolean;
7
+ addStdJson?: boolean;
8
+ addStdMath?: boolean;
9
+ }
4
10
  interface LibraryConfig {
5
11
  autoImport?: boolean;
6
12
  allowLateinitKeyword?: boolean;
@@ -12,7 +18,7 @@ interface AException {
12
18
  declare class ACompiler {
13
19
  private instance;
14
20
  private constructor();
15
- static create(customWasmUrl?: string): Promise<ACompiler>;
21
+ static create(config?: ACompilerConfig): Promise<ACompiler>;
16
22
  getOutput(): any;
17
23
  clearOutput(): void;
18
24
  registerBuiltInLibrary(name: string, source: string, config?: LibraryConfig, methods?: Record<string, AutolangNativeFunc>): void;
@@ -30,4 +36,4 @@ declare class ACompiler {
30
36
  refresh(): void;
31
37
  }
32
38
 
33
- export { ACompiler, type AException, type AObject, type AutolangNativeFunc, type AutolangType, type LibraryConfig };
39
+ export { ACompiler, type ACompilerConfig, type AException, type AObject, type AutolangNativeFunc, type AutolangType, type LibraryConfig };