baja-lite 1.0.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 (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/cjs/constant.d.ts +13 -0
  4. package/cjs/constant.js +19 -0
  5. package/cjs/error.d.ts +5 -0
  6. package/cjs/error.js +16 -0
  7. package/cjs/fn.d.ts +128 -0
  8. package/cjs/fn.js +169 -0
  9. package/cjs/index.d.ts +8 -0
  10. package/cjs/index.js +24 -0
  11. package/cjs/math.d.ts +69 -0
  12. package/cjs/math.js +435 -0
  13. package/cjs/now.d.ts +7 -0
  14. package/cjs/now.js +26 -0
  15. package/cjs/object.d.ts +77 -0
  16. package/cjs/object.js +212 -0
  17. package/cjs/set-ex.d.ts +171 -0
  18. package/cjs/set-ex.js +336 -0
  19. package/cjs/sql.d.ts +1216 -0
  20. package/cjs/sql.js +3380 -0
  21. package/cjs/string.d.ts +18 -0
  22. package/cjs/string.js +124 -0
  23. package/cjs/test-mysql.d.ts +1 -0
  24. package/cjs/test-mysql.js +108 -0
  25. package/cjs/test-sqlite.d.ts +1 -0
  26. package/cjs/test-sqlite.js +89 -0
  27. package/cjs/test.d.ts +1 -0
  28. package/cjs/test.js +4 -0
  29. package/es/constant.d.ts +13 -0
  30. package/es/constant.js +16 -0
  31. package/es/error.d.ts +5 -0
  32. package/es/error.js +13 -0
  33. package/es/fn.d.ts +128 -0
  34. package/es/fn.js +162 -0
  35. package/es/index.d.ts +8 -0
  36. package/es/index.js +8 -0
  37. package/es/math.d.ts +69 -0
  38. package/es/math.js +414 -0
  39. package/es/now.d.ts +7 -0
  40. package/es/now.js +16 -0
  41. package/es/object.d.ts +77 -0
  42. package/es/object.js +196 -0
  43. package/es/set-ex.d.ts +171 -0
  44. package/es/set-ex.js +332 -0
  45. package/es/sql.d.ts +1216 -0
  46. package/es/sql.js +3338 -0
  47. package/es/string.d.ts +18 -0
  48. package/es/string.js +109 -0
  49. package/es/test-mysql.d.ts +1 -0
  50. package/es/test-mysql.js +106 -0
  51. package/es/test-sqlite.d.ts +1 -0
  52. package/es/test-sqlite.js +87 -0
  53. package/es/test.d.ts +1 -0
  54. package/es/test.js +2 -0
  55. package/package.json +66 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 void-soul
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,13 @@
1
+ /** 执行方式 */
2
+ export declare enum SqlSyncMode {
3
+ /** 同步执行 */
4
+ Sync = 0,
5
+ /** 异步执行 */
6
+ Async = 1
7
+ }
8
+ export declare enum ExcuteSplitMode {
9
+ SyncTrust = 0,
10
+ SyncNoTrust = 1,
11
+ AsyncTrust = 2,
12
+ AsyncNoTrust = 3
13
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExcuteSplitMode = exports.SqlSyncMode = void 0;
4
+ /** 执行方式 */
5
+ var SqlSyncMode;
6
+ (function (SqlSyncMode) {
7
+ /** 同步执行 */
8
+ SqlSyncMode[SqlSyncMode["Sync"] = 0] = "Sync";
9
+ /** 异步执行 */
10
+ SqlSyncMode[SqlSyncMode["Async"] = 1] = "Async";
11
+ })(SqlSyncMode || (exports.SqlSyncMode = SqlSyncMode = {}));
12
+ ;
13
+ var ExcuteSplitMode;
14
+ (function (ExcuteSplitMode) {
15
+ ExcuteSplitMode[ExcuteSplitMode["SyncTrust"] = 0] = "SyncTrust";
16
+ ExcuteSplitMode[ExcuteSplitMode["SyncNoTrust"] = 1] = "SyncNoTrust";
17
+ ExcuteSplitMode[ExcuteSplitMode["AsyncTrust"] = 2] = "AsyncTrust";
18
+ ExcuteSplitMode[ExcuteSplitMode["AsyncNoTrust"] = 3] = "AsyncNoTrust";
19
+ })(ExcuteSplitMode || (exports.ExcuteSplitMode = ExcuteSplitMode = {}));
package/cjs/error.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export declare const Throw: {
2
+ if(test: boolean, message: string | Error | any): void;
3
+ ifNot(test: boolean, message: string | Error | any): void;
4
+ now(message: string | Error | any): never;
5
+ };
package/cjs/error.js ADDED
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Throw = void 0;
4
+ exports.Throw = {
5
+ if(test, message) {
6
+ if (test === true)
7
+ this.now(message);
8
+ },
9
+ ifNot(test, message) {
10
+ if (test !== true)
11
+ this.now(message);
12
+ },
13
+ now(message) {
14
+ throw typeof message === 'string' ? new Error(message) : message;
15
+ },
16
+ };
package/cjs/fn.d.ts ADDED
@@ -0,0 +1,128 @@
1
+ /**
2
+ * 回调函数promise化
3
+ * 调用示例
4
+ * soap.excute(arg1, arg2, function(error, data){});
5
+ * 可使用为:
6
+ * const soap_excute = promise({
7
+ * fn: soap.excute,
8
+ * target: soap
9
+ * });
10
+ * const data = await soap_excute(arg1, arg2);
11
+ * @param this
12
+ * @param param1
13
+ */
14
+ export declare const promise: <T>(this: any, { fn, target, last }: {
15
+ fn: (...args: any[]) => any;
16
+ target?: any;
17
+ last?: boolean;
18
+ }) => (...args: any[]) => Promise<T>;
19
+ export declare const sleep: (time?: number) => Promise<unknown>;
20
+ /**
21
+ * 执行器
22
+ * @param fn
23
+ * @param {
24
+ ifFinish?: (result?: T) => boolean; // 是否结束,默认是建议判断 !!result
25
+ maxTryTimes?: number; //最多尝试几次,默认是20
26
+ onFail?: () => Promise<boolean | undefined> | boolean | undefined; // 失败时的回调,返回false表示停止执行
27
+ name?: string; // 执行器名称,用于打印日志
28
+ exitIfFail?: boolean; // 失败时是否退出,默认是false. 这里设置true后,onFail返回true,也会停止执行
29
+ defVal?: T; // 失败时的默认值
30
+ sleepAppend?: number; // 等待延迟MS,默认是1000内随机+200
31
+ * }
32
+ * @returns
33
+ */
34
+ export declare function dieTrying<T = any>(fn: (...args: any[]) => Promise<T | undefined> | T | undefined, { ifFinish, maxTryTimes, onFail, name, exitIfFail, defVal, sleepAppend }?: {
35
+ ifFinish?: (result?: T) => boolean;
36
+ maxTryTimes?: number;
37
+ onFail?: () => Promise<boolean | undefined> | boolean | undefined;
38
+ name?: string;
39
+ exitIfFail?: boolean;
40
+ defVal?: T;
41
+ sleepAppend?: number;
42
+ }): Promise<T | undefined>;
43
+ export declare enum ExcuteSplitMode {
44
+ SyncTrust = 0,
45
+ SyncNoTrust = 1,
46
+ AsyncTrust = 2,
47
+ AsyncNoTrust = 3
48
+ }
49
+ /**
50
+ * 数组分割执行
51
+ * @param datas 数组
52
+ * @param fn 执行的函数, 参数1:分割数组;参数2:第几个分割数组;参数3:分割数组的数量;参数4:从第几个下标(相对于总数组)元素开始;参数5:到第几个下标(相对于总数组)元素结束
53
+ * @param config 配置(三选一):everyLength=每组个数(最后一组可能不足次数), groupCount=拆分几组, extendParams=依附拆分数组;
54
+ * @param 额外选项 settled=是否并行?
55
+ * T: datas类型
56
+ * E: extendParams类型
57
+ * R: 返回值类型
58
+ */
59
+ /**
60
+ * 数组分割执行
61
+ *
62
+ * # 参数说明
63
+ * @param sync 同步异步开关
64
+ * @param datas 数组
65
+ * @param fn 执行的函数
66
+ ```
67
+ ** `args`: 分割后的小数组
68
+ ** `index`: 第几个小数组
69
+ ** `length`: 总共多少个小数组
70
+ ** `extendParam`?: `参见下面Option中的extendParams`
71
+ ** `startIndex`?: 本次小数组的第一个元素是从总数组的第几个元素
72
+ ** `endIndex`?: 本次小数组的最后一个元素是从总数组的第几个元素
73
+ fn: (args: T[], index: number, length: number, extendParam?: E, startIndex?: number, endIndex?: number):R => {
74
+
75
+ }
76
+ ```
77
+ * @param option 选项
78
+
79
+ ## 分割数组方式:2种,选择一种即可
80
+ 1. everyLength=每组个数(最后一组可能不足次数)
81
+ 2. groupCount=拆分几组
82
+ ## settled 异步执行是否并行执行? 默认false
83
+ ## `extendParams`:扩展参数
84
+ ** 数组
85
+ ** 结合分组方式:groupCount使用。例如:
86
+ ```
87
+ `groupCount`=5,那么可以传入5个`extendParams`,在执行分组时,会为每个数组传入对应下标的`extendParam`
88
+ ```
89
+ ## `trust` 是否信任方法体,默认false
90
+ * true时,执行时捕获不异常, 返回值变为 R[]
91
+ * false时,执行时捕获异常,并返回 { result: R[]; error: string[]; };
92
+ # 泛型说明:全部可选
93
+ 1. T = 数组类型
94
+ 2. R = 返回结果类型
95
+ 3. E = 扩展参数类型
96
+
97
+ * @returns
98
+ */
99
+ export declare function excuteSplit<T = any, R = any, E = any>(sync: ExcuteSplitMode.SyncTrust, datas: T[], fn: (args: T[], index: number, length: number, extendParam?: E, startIndex?: number, endIndex?: number) => R, option: {
100
+ everyLength?: number;
101
+ groupCount?: number;
102
+ settled?: boolean;
103
+ extendParams?: E[];
104
+ }): R[];
105
+ export declare function excuteSplit<T = any, R = any, E = any>(sync: ExcuteSplitMode.SyncNoTrust, datas: T[], fn: (args: T[], index: number, length: number, extendParam?: E, startIndex?: number, endIndex?: number) => R, option: {
106
+ everyLength?: number;
107
+ groupCount?: number;
108
+ settled?: boolean;
109
+ extendParams?: E[];
110
+ }): {
111
+ result: R[];
112
+ error: string[];
113
+ };
114
+ export declare function excuteSplit<T = any, R = any, E = any>(sync: ExcuteSplitMode.AsyncTrust, datas: T[], fn: (args: T[], index: number, length: number, extendParam?: E, startIndex?: number, endIndex?: number) => Promise<R>, option: {
115
+ everyLength?: number;
116
+ groupCount?: number;
117
+ settled?: boolean;
118
+ extendParams?: E[];
119
+ }): Promise<R[]>;
120
+ export declare function excuteSplit<T = any, R = any, E = any>(sync: ExcuteSplitMode.AsyncNoTrust, datas: T[], fn: (args: T[], index: number, length: number, extendParam?: E, startIndex?: number, endIndex?: number) => Promise<R>, option: {
121
+ everyLength?: number;
122
+ groupCount?: number;
123
+ settled?: boolean;
124
+ extendParams?: E[];
125
+ }): Promise<{
126
+ result: R[];
127
+ error: string[];
128
+ }>;
package/cjs/fn.js ADDED
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.excuteSplit = exports.ExcuteSplitMode = exports.dieTrying = exports.sleep = exports.promise = void 0;
4
+ const object_1 = require("./object");
5
+ const error_1 = require("./error");
6
+ /**
7
+ * 回调函数promise化
8
+ * 调用示例
9
+ * soap.excute(arg1, arg2, function(error, data){});
10
+ * 可使用为:
11
+ * const soap_excute = promise({
12
+ * fn: soap.excute,
13
+ * target: soap
14
+ * });
15
+ * const data = await soap_excute(arg1, arg2);
16
+ * @param this
17
+ * @param param1
18
+ */
19
+ const promise = function ({ fn, target, last = true }) {
20
+ return (...args) => {
21
+ return new Promise((resolve, reject) => {
22
+ args[last === true ? 'push' : 'unshift']((err, data) => {
23
+ if (err === null || err === undefined) {
24
+ return resolve.call(this, data);
25
+ }
26
+ return reject(err);
27
+ });
28
+ if (target) {
29
+ fn.apply(target, args);
30
+ }
31
+ else {
32
+ fn.apply({}, args);
33
+ }
34
+ });
35
+ };
36
+ };
37
+ exports.promise = promise;
38
+ const sleep = (time = parseInt(`${Math.random()}`) + 200) => new Promise((resolve) => setTimeout(resolve, time));
39
+ exports.sleep = sleep;
40
+ /**
41
+ * 执行器
42
+ * @param fn
43
+ * @param {
44
+ ifFinish?: (result?: T) => boolean; // 是否结束,默认是建议判断 !!result
45
+ maxTryTimes?: number; //最多尝试几次,默认是20
46
+ onFail?: () => Promise<boolean | undefined> | boolean | undefined; // 失败时的回调,返回false表示停止执行
47
+ name?: string; // 执行器名称,用于打印日志
48
+ exitIfFail?: boolean; // 失败时是否退出,默认是false. 这里设置true后,onFail返回true,也会停止执行
49
+ defVal?: T; // 失败时的默认值
50
+ sleepAppend?: number; // 等待延迟MS,默认是1000内随机+200
51
+ * }
52
+ * @returns
53
+ */
54
+ async function dieTrying(fn, { ifFinish = (result) => !!result, maxTryTimes = 20, onFail, name = 'dieTrying', exitIfFail = true, defVal, sleepAppend = 0 } = {}) {
55
+ let count = 0;
56
+ let result = defVal;
57
+ while (result = await fn(), !ifFinish(result)) {
58
+ await (0, exports.sleep)(parseInt(`${Math.random() * 1000}`) + sleepAppend);
59
+ count++;
60
+ console.debug(`${name} try ${count} times`);
61
+ if (count > maxTryTimes) {
62
+ if (onFail) {
63
+ const remuseExcute = await onFail();
64
+ console.error(`${name} timeout`);
65
+ count = 0;
66
+ if (remuseExcute === false) {
67
+ break;
68
+ }
69
+ }
70
+ if (exitIfFail) {
71
+ break;
72
+ }
73
+ }
74
+ }
75
+ return result;
76
+ }
77
+ exports.dieTrying = dieTrying;
78
+ var ExcuteSplitMode;
79
+ (function (ExcuteSplitMode) {
80
+ ExcuteSplitMode[ExcuteSplitMode["SyncTrust"] = 0] = "SyncTrust";
81
+ ExcuteSplitMode[ExcuteSplitMode["SyncNoTrust"] = 1] = "SyncNoTrust";
82
+ ExcuteSplitMode[ExcuteSplitMode["AsyncTrust"] = 2] = "AsyncTrust";
83
+ ExcuteSplitMode[ExcuteSplitMode["AsyncNoTrust"] = 3] = "AsyncNoTrust";
84
+ })(ExcuteSplitMode || (exports.ExcuteSplitMode = ExcuteSplitMode = {}));
85
+ function excuteSplit(sync, datas, fn, { everyLength = 0, groupCount = 0, settled = false, extendParams = new Array() }) {
86
+ if (extendParams.length > 0) {
87
+ groupCount = extendParams.length;
88
+ }
89
+ error_1.Throw.if(everyLength === 0 && groupCount === 0, '参数错误!');
90
+ const ps = { everyLength, groupCount };
91
+ const list = (0, object_1.arraySplit)(datas, ps);
92
+ if (sync === ExcuteSplitMode.AsyncTrust) {
93
+ return new Promise(async (resolve, reject) => {
94
+ const reasons = [];
95
+ if (settled) {
96
+ const result = await Promise.allSettled(list.map((list, i) => fn(list, i, list.length, extendParams[i])));
97
+ for (const item of result) {
98
+ if (item.status === 'rejected') {
99
+ reject(item.reason);
100
+ }
101
+ else {
102
+ reasons.push(item.value);
103
+ }
104
+ }
105
+ }
106
+ else {
107
+ for (let i = 0; i < list.length; i++) {
108
+ const startIndex = (i - 1) * ps.everyLength;
109
+ const endIndex = startIndex + list[i].length - 1;
110
+ reasons.push(await fn(list[i], i, list.length, extendParams[i], startIndex, endIndex));
111
+ }
112
+ }
113
+ resolve(reasons);
114
+ });
115
+ }
116
+ else if (sync === ExcuteSplitMode.AsyncNoTrust) {
117
+ return new Promise(async (resolve, reject) => {
118
+ const reasons = { result: [], error: [] };
119
+ if (settled) {
120
+ const result = await Promise.allSettled(list.map((list, i) => fn(list, i, list.length, extendParams[i])));
121
+ for (const item of result) {
122
+ if (item.status === 'rejected') {
123
+ reasons.error.push(item.reason);
124
+ }
125
+ else {
126
+ reasons.result.push(item.value);
127
+ }
128
+ }
129
+ }
130
+ else {
131
+ for (let i = 0; i < list.length; i++) {
132
+ const startIndex = (i - 1) * ps.everyLength;
133
+ const endIndex = startIndex + list[i].length - 1;
134
+ try {
135
+ reasons.result.push(await fn(list[i], i, list.length, extendParams[i], startIndex, endIndex));
136
+ }
137
+ catch (error) {
138
+ reasons.error.push(error);
139
+ }
140
+ }
141
+ }
142
+ resolve(reasons);
143
+ });
144
+ }
145
+ else if (sync === ExcuteSplitMode.SyncTrust) {
146
+ const reasons = [];
147
+ for (let i = 0; i < list.length; i++) {
148
+ const startIndex = (i - 1) * ps.everyLength;
149
+ const endIndex = startIndex + list[i].length - 1;
150
+ reasons.push(fn(list[i], i, list.length, extendParams[i], startIndex, endIndex));
151
+ }
152
+ return reasons;
153
+ }
154
+ else {
155
+ const reasons = { result: [], error: [] };
156
+ for (let i = 0; i < list.length; i++) {
157
+ try {
158
+ const startIndex = (i - 1) * ps.everyLength;
159
+ const endIndex = startIndex + list[i].length - 1;
160
+ reasons.result.push(fn(list[i], i, list.length, extendParams[i], startIndex, endIndex));
161
+ }
162
+ catch (error) {
163
+ reasons.error.push(error);
164
+ }
165
+ }
166
+ return reasons;
167
+ }
168
+ }
169
+ exports.excuteSplit = excuteSplit;
package/cjs/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export * from './error';
2
+ export * from './fn';
3
+ export * from './math';
4
+ export * from './now';
5
+ export * from './object';
6
+ export * from './set-ex';
7
+ export * from './sql';
8
+ export * from './string';
package/cjs/index.js ADDED
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./error"), exports);
18
+ __exportStar(require("./fn"), exports);
19
+ __exportStar(require("./math"), exports);
20
+ __exportStar(require("./now"), exports);
21
+ __exportStar(require("./object"), exports);
22
+ __exportStar(require("./set-ex"), exports);
23
+ __exportStar(require("./sql"), exports);
24
+ __exportStar(require("./string"), exports);
package/cjs/math.d.ts ADDED
@@ -0,0 +1,69 @@
1
+ /** 金钱格式化可用样式 */
2
+ export declare class MoneyOption {
3
+ style?: 'currency' | 'decimal' | 'percent';
4
+ currency?: string;
5
+ prefix?: number;
6
+ def?: number;
7
+ currencyDisplay?: 'symbol' | 'name' | 'code';
8
+ useGrouping?: boolean;
9
+ local?: string;
10
+ }
11
+ export interface Point {
12
+ latitude: string;
13
+ longitude: string;
14
+ lat: number;
15
+ long: number;
16
+ }
17
+ export declare const num: (val: any, def?: number) => number;
18
+ export declare const max: (...args: any[]) => number;
19
+ export declare const min: (...args: any[]) => number;
20
+ export declare const div: (...args: any[]) => number;
21
+ export declare const divDef: (def: any, ...args: any[]) => number;
22
+ export declare const add: (...args: any[]) => number;
23
+ export declare const mul: (...args: any[]) => number;
24
+ export declare const sub: (...args: any[]) => number;
25
+ export declare const round: (number: any, numDigits: number, upOrDown?: number) => number;
26
+ /** =value.xx,其中xx=number,如number=99,表示修正数字为value.99 */
27
+ export declare const merge: (value: any, number: any) => any;
28
+ export declare const money: (value: any, option?: MoneyOption) => string;
29
+ export declare class Bus {
30
+ private result;
31
+ private ifit;
32
+ constructor(result: any);
33
+ add(...args: any[]): this;
34
+ sub(...args: any[]): this;
35
+ div(...args: any[]): this;
36
+ divDef(def: any, ...args: any[]): this;
37
+ mul(...args: any[]): this;
38
+ max(...args: any[]): this;
39
+ min(...args: any[]): this;
40
+ ac(): this;
41
+ abs(): this;
42
+ round(numDigits: number, upOrDown?: number): this;
43
+ merge(number: any): this;
44
+ if(condition: boolean): this;
45
+ over(): number;
46
+ money(option?: MoneyOption): string;
47
+ lt(data: any): boolean;
48
+ le(data: any): boolean;
49
+ gt(data: any): boolean;
50
+ ge(data: any): boolean;
51
+ nlt(data: any): boolean;
52
+ nle(data: any): boolean;
53
+ ngt(data: any): boolean;
54
+ nge(data: any): boolean;
55
+ eq(data: any): boolean;
56
+ ne(data: any): boolean;
57
+ ifLt(data: any): this;
58
+ ifLe(data: any): this;
59
+ ifGt(data: any): this;
60
+ ifGe(data: any): this;
61
+ ifNlt(data: any): this;
62
+ ifNle(data: any): this;
63
+ ifNgt(data: any): this;
64
+ ifNge(data: any): this;
65
+ ifEq(data: any): this;
66
+ ifNe(data: any): this;
67
+ }
68
+ export declare const calc: (result: any) => Bus;
69
+ export declare const getGeo: (p1: Point, p2: Point) => number;