a-calc 3.0.0 → 3.0.2
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/a-calc.versions.js +185 -66
- package/browser/index.js +4 -2
- package/browser/wasm_calc_bg.wasm +0 -0
- package/calc.d.ts +74 -59
- package/cjs/chunks/calc.js +10 -0
- package/cjs/chunks/wasm_calc.js +1 -0
- package/cjs/chunks/wasm_calc_bg.wasm +0 -0
- package/cjs/index.js +1 -8
- package/cjs/package.json +3 -3
- package/es/chunks/calc.js +10 -0
- package/es/chunks/wasm_calc.js +1 -0
- package/es/chunks/wasm_calc_bg.wasm +0 -0
- package/es/index.js +1 -8
- package/es/package.json +3 -3
- package/mcp-server/src/index.js +0 -0
- package/package.json +22 -17
- package/src/wasm/wasm_calc.d.ts +45 -52
- package/src/wasm/wasm_calc.js +783 -310
- package/src/wasm/wasm_calc_bg.wasm +0 -0
- package/src/wasm/wasm_calc_bg.wasm.d.ts +44 -46
- package/ts-plugin/dist/config_extractor.js +1 -2
- package/ts-plugin/dist/utils.js +3 -4
- package/ts-plugin/dist/variable_extractor.js +1 -2
|
Binary file
|
|
@@ -1,49 +1,47 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const eval_expr: (a: number, b: number) =>
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
export const
|
|
29
|
-
export const
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
33
|
-
export const
|
|
34
|
-
export const
|
|
35
|
-
export const
|
|
36
|
-
export const
|
|
37
|
-
export const
|
|
38
|
-
export const
|
|
39
|
-
export const
|
|
40
|
-
export const
|
|
41
|
-
export const
|
|
42
|
-
export const
|
|
43
|
-
export const
|
|
44
|
-
export const
|
|
45
|
-
export const
|
|
46
|
-
export const
|
|
47
|
-
export const
|
|
48
|
-
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
49
|
-
export const __wbindgen_start: () => void;
|
|
4
|
+
export const eval_expr: (a: number, b: number, c: number) => void;
|
|
5
|
+
export const eval_expr_safe: (a: number, b: number, c: number) => void;
|
|
6
|
+
export const str_abs: (a: number, b: number, c: number) => void;
|
|
7
|
+
export const str_ceil: (a: number, b: number, c: number) => void;
|
|
8
|
+
export const str_compare: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
9
|
+
export const str_cos: (a: number, b: number, c: number) => void;
|
|
10
|
+
export const str_div: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
11
|
+
export const str_eq: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
12
|
+
export const str_exp: (a: number, b: number, c: number) => void;
|
|
13
|
+
export const str_floor: (a: number, b: number, c: number) => void;
|
|
14
|
+
export const str_fract: (a: number, b: number, c: number) => void;
|
|
15
|
+
export const str_gt: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
16
|
+
export const str_gte: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
17
|
+
export const str_is_integer: (a: number, b: number, c: number) => void;
|
|
18
|
+
export const str_is_negative: (a: number, b: number, c: number) => void;
|
|
19
|
+
export const str_is_positive: (a: number, b: number, c: number) => void;
|
|
20
|
+
export const str_is_zero: (a: number, b: number, c: number) => void;
|
|
21
|
+
export const str_ln: (a: number, b: number, c: number) => void;
|
|
22
|
+
export const str_log10: (a: number, b: number, c: number) => void;
|
|
23
|
+
export const str_lt: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
24
|
+
export const str_lte: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
25
|
+
export const str_max: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
26
|
+
export const str_min: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
27
|
+
export const str_mod: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
28
|
+
export const str_mul: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
29
|
+
export const str_neg: (a: number, b: number, c: number) => void;
|
|
30
|
+
export const str_normalize: (a: number, b: number, c: number) => void;
|
|
31
|
+
export const str_plus: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
32
|
+
export const str_pow: (a: number, b: number, c: number, d: bigint) => void;
|
|
33
|
+
export const str_powd: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
34
|
+
export const str_round: (a: number, b: number, c: number) => void;
|
|
35
|
+
export const str_round_dp: (a: number, b: number, c: number, d: number) => void;
|
|
36
|
+
export const str_round_dp_bankers: (a: number, b: number, c: number, d: number) => void;
|
|
37
|
+
export const str_scale: (a: number, b: number, c: number) => void;
|
|
38
|
+
export const str_sign: (a: number, b: number, c: number) => void;
|
|
39
|
+
export const str_sin: (a: number, b: number, c: number) => void;
|
|
40
|
+
export const str_sqrt: (a: number, b: number, c: number) => void;
|
|
41
|
+
export const str_sub: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
42
|
+
export const str_tan: (a: number, b: number, c: number) => void;
|
|
43
|
+
export const str_trunc: (a: number, b: number, c: number) => void;
|
|
44
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
45
|
+
export const __wbindgen_export: (a: number, b: number) => number;
|
|
46
|
+
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
47
|
+
export const __wbindgen_export3: (a: number, b: number, c: number) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extract_config_from_project =
|
|
3
|
+
exports.extract_config_from_project = extract_config_from_project;
|
|
4
4
|
/**
|
|
5
5
|
* 从项目中提取 set_config 配置的类型信息
|
|
6
6
|
*/
|
|
@@ -18,7 +18,6 @@ function extract_config_from_project(ts_module, program, logger) {
|
|
|
18
18
|
}
|
|
19
19
|
return result;
|
|
20
20
|
}
|
|
21
|
-
exports.extract_config_from_project = extract_config_from_project;
|
|
22
21
|
function visit_node(ts_module, node, type_checker, result, logger) {
|
|
23
22
|
// 查找 set_config 调用
|
|
24
23
|
if (ts_module.isCallExpression(node)) {
|
package/ts-plugin/dist/utils.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.is_in_acalc_string = is_in_acalc_string;
|
|
4
|
+
exports.get_text_before_cursor = get_text_before_cursor;
|
|
5
|
+
exports.detect_trigger = detect_trigger;
|
|
4
6
|
/**
|
|
5
7
|
* 检测位置是否在 calc/fmt 等函数的字符串参数内
|
|
6
8
|
*/
|
|
@@ -73,7 +75,6 @@ function is_in_acalc_string(ts_module, source_file, position, type_checker, logg
|
|
|
73
75
|
visit(source_file);
|
|
74
76
|
return result;
|
|
75
77
|
}
|
|
76
|
-
exports.is_in_acalc_string = is_in_acalc_string;
|
|
77
78
|
/**
|
|
78
79
|
* 检测是否是链式调用的格式化参数
|
|
79
80
|
* cadd(1, 2).mul(3)("=2") 中最后的括号
|
|
@@ -224,7 +225,6 @@ function get_string_content(ts_module, node) {
|
|
|
224
225
|
function get_text_before_cursor(content, offset) {
|
|
225
226
|
return content.slice(0, offset);
|
|
226
227
|
}
|
|
227
|
-
exports.get_text_before_cursor = get_text_before_cursor;
|
|
228
228
|
/**
|
|
229
229
|
* 检测补全触发类型
|
|
230
230
|
* @param text_before 光标前的文本
|
|
@@ -291,7 +291,6 @@ function detect_trigger(text_before, is_format_only) {
|
|
|
291
291
|
}
|
|
292
292
|
return null;
|
|
293
293
|
}
|
|
294
|
-
exports.detect_trigger = detect_trigger;
|
|
295
294
|
/**
|
|
296
295
|
* 检测是否在格式化区域
|
|
297
296
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extract_variables_from_arg =
|
|
3
|
+
exports.extract_variables_from_arg = extract_variables_from_arg;
|
|
4
4
|
/**
|
|
5
5
|
* 从第二个参数中提取所有可用变量
|
|
6
6
|
*/
|
|
@@ -24,7 +24,6 @@ function extract_variables_from_arg(ts_module, arg, type_checker, logger) {
|
|
|
24
24
|
logger.info(`a-calc-ts-plugin: extracted ${result.length} variables`);
|
|
25
25
|
return result;
|
|
26
26
|
}
|
|
27
|
-
exports.extract_variables_from_arg = extract_variables_from_arg;
|
|
28
27
|
/**
|
|
29
28
|
* 检查是否是数组类型
|
|
30
29
|
*/
|