libchai 0.1.13 → 0.2.0

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.
Files changed (5) hide show
  1. package/LICENSE +674 -0
  2. package/chai.d.ts +20 -45
  3. package/chai.js +344 -387
  4. package/chai_bg.wasm +0 -0
  5. package/package.json +10 -2
package/chai.d.ts CHANGED
@@ -1,41 +1,18 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * @param {any} js_config
5
- * @returns {any}
6
- */
4
+ * 用于在图形界面验证输入的配置是否正确
5
+ */
7
6
  export function validate(js_config: any): any;
8
7
  /**
9
- */
10
- export class WebInterface {
8
+ * 通过图形界面来使用 libchai 的入口,实现了界面特征
9
+ */
10
+ export class Web {
11
+ private constructor();
11
12
  free(): void;
12
- /**
13
- * @param {Function} post_message
14
- * @param {any} js_config
15
- * @param {any} js_info
16
- * @param {any} js_assets
17
- * @returns {WebInterface}
18
- */
19
- static new(post_message: Function, js_config: any, js_info: any, js_assets: any): WebInterface;
20
- /**
21
- * @param {any} js_config
22
- */
23
- update_config(js_config: any): void;
24
- /**
25
- * @param {any} js_info
26
- */
27
- update_info(js_info: any): void;
28
- /**
29
- * @param {any} js_assets
30
- */
31
- update_assets(js_assets: any): void;
32
- /**
33
- * @param {any} js_objective
34
- * @returns {any}
35
- */
36
- encode_evaluate(js_objective: any): any;
37
- /**
38
- */
13
+ static new(回调: Function): Web;
14
+ sync(前端参数: any): void;
15
+ encode_evaluate(前端目标函数配置: any): any;
39
16
  optimize(): void;
40
17
  }
41
18
 
@@ -43,19 +20,17 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
43
20
 
44
21
  export interface InitOutput {
45
22
  readonly memory: WebAssembly.Memory;
46
- readonly __wbg_webinterface_free: (a: number) => void;
23
+ readonly __wbg_web_free: (a: number, b: number) => void;
47
24
  readonly validate: (a: number, b: number) => void;
48
- readonly webinterface_new: (a: number, b: number, c: number, d: number, e: number) => void;
49
- readonly webinterface_update_config: (a: number, b: number, c: number) => void;
50
- readonly webinterface_update_info: (a: number, b: number, c: number) => void;
51
- readonly webinterface_update_assets: (a: number, b: number, c: number) => void;
52
- readonly webinterface_encode_evaluate: (a: number, b: number, c: number) => void;
53
- readonly webinterface_optimize: (a: number, b: number) => void;
25
+ readonly web_new: (a: number) => number;
26
+ readonly web_sync: (a: number, b: number, c: number) => void;
27
+ readonly web_encode_evaluate: (a: number, b: number, c: number) => void;
28
+ readonly web_optimize: (a: number, b: number) => void;
54
29
  readonly __wbindgen_export_0: (a: number, b: number) => number;
55
30
  readonly __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
31
+ readonly __wbindgen_export_2: (a: number) => void;
32
+ readonly __wbindgen_export_3: (a: number, b: number, c: number) => void;
56
33
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
57
- readonly __wbindgen_export_2: (a: number, b: number, c: number) => void;
58
- readonly __wbindgen_export_3: (a: number) => void;
59
34
  }
60
35
 
61
36
  export type SyncInitInput = BufferSource | WebAssembly.Module;
@@ -63,18 +38,18 @@ export type SyncInitInput = BufferSource | WebAssembly.Module;
63
38
  * Instantiates the given `module`, which can either be bytes or
64
39
  * a precompiled `WebAssembly.Module`.
65
40
  *
66
- * @param {SyncInitInput} module
41
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
67
42
  *
68
43
  * @returns {InitOutput}
69
44
  */
70
- export function initSync(module: SyncInitInput): InitOutput;
45
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
71
46
 
72
47
  /**
73
48
  * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
74
49
  * for everything else, calls `WebAssembly.instantiate` directly.
75
50
  *
76
- * @param {InitInput | Promise<InitInput>} module_or_path
51
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
77
52
  *
78
53
  * @returns {Promise<InitOutput>}
79
54
  */
80
- export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
55
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;