mixlea-utils-js 0.1.68 → 0.1.69
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/mixlea-utils-js.js +565 -563
- package/dist/mixlea-utils-js.umd.js +2 -2
- package/dist/types/index.d.ts +1499 -1495
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,1495 +1,1499 @@
|
|
|
1
|
-
declare interface AbstractTreeNode {
|
|
2
|
-
children?: AbstractTreeNode[];
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
declare interface Action {
|
|
6
|
-
type: string;
|
|
7
|
-
payload?: any;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export declare function add(...nums: number[]): number;
|
|
11
|
-
|
|
12
|
-
export declare function alwaysResolved(): Promise<void>;
|
|
13
|
-
|
|
14
|
-
export declare function alwaysResolveUndefined(): Promise<unknown>;
|
|
15
|
-
|
|
16
|
-
export declare function alwaysReturn<T>(returnValue: T): () => T;
|
|
17
|
-
|
|
18
|
-
export declare function alwaysReturnEmptyRecord(): {};
|
|
19
|
-
|
|
20
|
-
export declare function alwaysReturnEmptyString(): string;
|
|
21
|
-
|
|
22
|
-
export declare function alwaysReturnFalse(): boolean;
|
|
23
|
-
|
|
24
|
-
export declare function alwaysReturnNullish(): null;
|
|
25
|
-
|
|
26
|
-
export declare function alwaysReturnTrue(): boolean;
|
|
27
|
-
|
|
28
|
-
export declare function arrayAllocateTotal<T extends Record<string, any> = Record<string, any>>(params: {
|
|
29
|
-
list: T[];
|
|
30
|
-
total: number;
|
|
31
|
-
getPortion: (item: T, index: number) => number;
|
|
32
|
-
precision?: number;
|
|
33
|
-
lastPrecision?: number;
|
|
34
|
-
assignment: (portionValue: number, item: T, index: number) => Record<string, any>;
|
|
35
|
-
}): T[];
|
|
36
|
-
|
|
37
|
-
export declare function arrayAppend<T>(source: T[], append: T[] | ((source: T[]) => T[])): T[];
|
|
38
|
-
|
|
39
|
-
export declare function arrayAssign<T>(arr: T[], assign: Record<string, any>, target: number | number[] | ((row: T, rowIndex: number, arr: T[]) => boolean)): T[];
|
|
40
|
-
|
|
41
|
-
export declare function arrayDiff(arr1: any[], arr2: any[]): any[];
|
|
42
|
-
|
|
43
|
-
export declare function arrayDistinct<T = any>(arr: T[], callback?: (item: T) => any): T[];
|
|
44
|
-
|
|
45
|
-
export declare function arrayDuplicateMerge(arr: any[], callback?: (item: any) => any): [any, {
|
|
46
|
-
index: number;
|
|
47
|
-
item: any;
|
|
48
|
-
}[]][];
|
|
49
|
-
|
|
50
|
-
export declare function arrayEvery<T>(arr: T[], callback: (value: T, index: number, array: T[]) => boolean, opts?: {
|
|
51
|
-
emptyResult?: boolean;
|
|
52
|
-
}): boolean;
|
|
53
|
-
|
|
54
|
-
export declare function arrayExcludeIndexes<T>(arr: T[], indexes: number[]): any[];
|
|
55
|
-
|
|
56
|
-
export declare function arrayExcludeLastNumber<T = any>(arr: T[], number: number): T[];
|
|
57
|
-
|
|
58
|
-
export declare function arrayFilter<T = any>(arr: T[], callback: (value: T, index: number, array: T[]) => boolean): T[];
|
|
59
|
-
|
|
60
|
-
export declare function arrayFind<T = any>(arr: T[], callback: (record: T, index: number, arr: T[]) => boolean, defaultValue?: T): T | null;
|
|
61
|
-
|
|
62
|
-
/** 返回连续值得索引列表 */
|
|
63
|
-
export declare function arrayFindChainIndexes<T>(arr: T[], callback: (item: T) => boolean | null | undefined, { fromIndex, endIndex, fallbackValue, }?: {
|
|
64
|
-
fromIndex?: number;
|
|
65
|
-
endIndex?: number;
|
|
66
|
-
fallbackValue?: number[];
|
|
67
|
-
}): number[];
|
|
68
|
-
|
|
69
|
-
/** 返回连续值得索引列表 */
|
|
70
|
-
export declare function arrayFindChainIndexesRight<T>(arr: T[], callback: (item: T) => boolean | null | undefined, { fromIndex, endIndex, fallbackValue, }?: {
|
|
71
|
-
fromIndex?: number;
|
|
72
|
-
endIndex?: number;
|
|
73
|
-
fallbackValue?: number[];
|
|
74
|
-
}): number[];
|
|
75
|
-
|
|
76
|
-
export declare function arrayFindIndex<T>(arr: T[], callback: (record: T, index: number, arr: T[]) => boolean, { fromIndex, endIndex, fallbackValue, }?: {
|
|
77
|
-
fromIndex?: number;
|
|
78
|
-
endIndex?: number;
|
|
79
|
-
fallbackValue?: number;
|
|
80
|
-
}): number;
|
|
81
|
-
|
|
82
|
-
export declare function arrayFindIndexRight<T>(arr: T[], callback: (record: T, index: number, arr: T[]) => boolean, { fromIndex, endIndex, fallbackValue, }?: {
|
|
83
|
-
fromIndex?: number;
|
|
84
|
-
endIndex?: number;
|
|
85
|
-
fallbackValue?: number;
|
|
86
|
-
}): number;
|
|
87
|
-
|
|
88
|
-
export declare function arrayFindSame<T>(arr: T[], callback?: (item: T) => any): any[];
|
|
89
|
-
|
|
90
|
-
export declare function arrayFlatMap<T, U>(array: T[], callback: (value: T, index: number, array: T[]) => U[]): U[];
|
|
91
|
-
|
|
92
|
-
export declare function arrayForEach<T>(arr: T[], callback: (record: T, index: number, arr: T[]) => void, opts?: {
|
|
93
|
-
direction?: 'left' | 'right';
|
|
94
|
-
}): void;
|
|
95
|
-
|
|
96
|
-
export declare function arrayGroup<T>(arr: T[], groupKey: (record: T) => any): T[][];
|
|
97
|
-
|
|
98
|
-
export declare function arrayGroupMap<T>(arr: T[], groupKey: (record: T) => any): Map<any, T[]>;
|
|
99
|
-
|
|
100
|
-
export declare function arrayHas<T = any>(arr: T[], callback: (record: T, index: number, arr: T[]) => boolean): boolean;
|
|
101
|
-
|
|
102
|
-
export declare function arrayIncludeIndexes<T>(arr: T[], indexes: number[]): any[];
|
|
103
|
-
|
|
104
|
-
export declare function arrayIncludes(arr: any[], item: any): boolean;
|
|
105
|
-
|
|
106
|
-
export declare function arrayInsert<T>(source: T[], index: number, item: T): T[];
|
|
107
|
-
|
|
108
|
-
export declare function arrayInsertInterval<T>(arr: T[], element: T | ((index: number) => T), interval?: number): T[];
|
|
109
|
-
|
|
110
|
-
export declare function arrayIsDuplicate(arr: any[], callback?: (item: any) => any): boolean;
|
|
111
|
-
|
|
112
|
-
export declare function arrayItemCount<T>(arr: T[]): [T, number][];
|
|
113
|
-
|
|
114
|
-
export declare function arrayIteMove<T>(arr: T[], fromIndex: number, toIndex: number): T[];
|
|
115
|
-
|
|
116
|
-
export declare function arrayJoin<T>(arr: T[], separator: string, map?: (item: T) => any): string;
|
|
117
|
-
|
|
118
|
-
export declare function arrayLastIndex<T>(arr: T[]): number;
|
|
119
|
-
|
|
120
|
-
export declare function arrayLastItem<T>(arr: T[]): T;
|
|
121
|
-
|
|
122
|
-
export declare function arrayLastPick<T = any>(arr: T[], num?: number): any[];
|
|
123
|
-
|
|
124
|
-
export declare function arrayMap<T = any, R = any>(arr: T[], callback: (record: T, index: number, arr: T[]) => R): R[];
|
|
125
|
-
|
|
126
|
-
export declare function arrayMapToObject(arr: any[], fieldFn: (arrItem: any) => string, valueFn: (arrItem: any) => any, option?: {
|
|
127
|
-
chain?: boolean;
|
|
128
|
-
fieldPrefix?: string;
|
|
129
|
-
}): Record<string, any>;
|
|
130
|
-
|
|
131
|
-
export declare function arrayMerge(...arrs: any[]): any[];
|
|
132
|
-
|
|
133
|
-
export declare function arrayNotIn(arr: any[], diffArr: any[], callback: (arrItem: any, diffArrItem: any) => boolean): any[];
|
|
134
|
-
|
|
135
|
-
export declare function arrayObjectFieldNotEmptySame<T extends Record<string, any>>(input: T[], field: string, opts?: {
|
|
136
|
-
whenEmptyResult?: boolean;
|
|
137
|
-
}): boolean;
|
|
138
|
-
|
|
139
|
-
export declare function arrayObjectFieldSame<T extends Record<string, any>>(input: T[], field: string, opts?: {
|
|
140
|
-
whenEmptyResult?: boolean;
|
|
141
|
-
}): boolean;
|
|
142
|
-
|
|
143
|
-
export declare function arrayObjectMultiSort(arr: Record<string, any>[], conditions: {
|
|
144
|
-
prop: string;
|
|
145
|
-
order?: 'asc' | 'desc';
|
|
146
|
-
}[]): Record<string, any>[];
|
|
147
|
-
|
|
148
|
-
export declare function arrayPickLast<T = any>(arr: T[]): T | null;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* 根据优先级排序, 未给出优先级的尽量按原位置排序
|
|
152
|
-
* @param arr
|
|
153
|
-
* @param priorityFn
|
|
154
|
-
* @returns
|
|
155
|
-
*/
|
|
156
|
-
export declare function arrayPrioritySort<T>(arr: T[], priorityFn: (item: T) => number | null | undefined): T[];
|
|
157
|
-
|
|
158
|
-
export declare function arrayReduce<T = any, R = any>(arr: T[], callback: (result: R, currentValue: T, currentIndex: number, arr: T[]) => R, initialValue: R): R;
|
|
159
|
-
|
|
160
|
-
export declare function arraySlice<T>(arr: T[], start?: number, end?: number): T[];
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
*
|
|
164
|
-
* @param arr
|
|
165
|
-
* @param callback
|
|
166
|
-
* @param opts's emptyResult 默认为false
|
|
167
|
-
* @returns
|
|
168
|
-
*/
|
|
169
|
-
export declare function arraySome<T>(arr: T[], callback: (value: T, index: number, array: T[]) => boolean, opts?: {
|
|
170
|
-
emptyResult?: boolean;
|
|
171
|
-
}): boolean;
|
|
172
|
-
|
|
173
|
-
export declare function arraySort<T>(array: T[], sortCondition: SortCondition<T>): T[];
|
|
174
|
-
|
|
175
|
-
export declare function arraysZip<T, R>(callback: (...args: T[]) => R, ...arrays: T[][]): R[];
|
|
176
|
-
|
|
177
|
-
export declare function arrayToBetween<T = any>(arr: T[], left: (itme: T) => boolean, right: (itme: T) => boolean): T[];
|
|
178
|
-
|
|
179
|
-
export declare function arrayToMap<T, K, V = T>(arr: T[], key: (record: T, index: number, arr: T[]) => K, value?: (record: T, index: number, arr: T[]) => V): Map<K, V>;
|
|
180
|
-
|
|
181
|
-
export declare function arrayToObject<T = any>(arr: any[], keyGetter: string | ((item: T) => string), valueGetter: string | ((item: T) => any), opts?: {
|
|
182
|
-
keyChain?: boolean;
|
|
183
|
-
}): Record<any, any>;
|
|
184
|
-
|
|
185
|
-
export declare function arrayToShallowObject<T = any>(arr: any[], keyFn: (item: T) => string, valueFn: (item: T) => any): Record<any, any>;
|
|
186
|
-
|
|
187
|
-
export declare function buildURL({ baseURL, url, params, }: {
|
|
188
|
-
baseURL?: string;
|
|
189
|
-
url: string;
|
|
190
|
-
params: Record<string, any>;
|
|
191
|
-
}): string;
|
|
192
|
-
|
|
193
|
-
export declare function cacheDelete(key: string): void;
|
|
194
|
-
|
|
195
|
-
export declare function cacheGet<T = any>(key: string): T | null;
|
|
196
|
-
|
|
197
|
-
export declare function cacheSet(key: string, val: any): void;
|
|
198
|
-
|
|
199
|
-
export declare function calcAdaptivePoint(width: number): "3xl" | "2xl" | "xl" | "lg" | "md" | "sm" | "xs";
|
|
200
|
-
|
|
201
|
-
export declare function calcGridRegionBoundaryPoints<X extends string, Y extends string, T extends Point_3<X, Y>>(points: T[], xField: X, yField: Y, cellSize?: number): T[];
|
|
202
|
-
|
|
203
|
-
export declare function calcGridRegionBoundarySegments<X extends string, Y extends string, T extends Point_2<X, Y>>(points: T[], xField: X, yField: Y, cell?: number): [T, T][];
|
|
204
|
-
|
|
205
|
-
export declare function calcMartixRange<X extends string, Y extends string, T extends Point_4<X, Y>>(points: T[], xField: X, yField: Y): {
|
|
206
|
-
xSize: number;
|
|
207
|
-
ySize: number;
|
|
208
|
-
minX: number;
|
|
209
|
-
maxX: number;
|
|
210
|
-
minY: number;
|
|
211
|
-
maxY: number;
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
export declare function calcNumberDiffRate(number1: number, number2: number): number;
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* 计算内存占用大小
|
|
218
|
-
* @param value
|
|
219
|
-
* @param unit
|
|
220
|
-
* @returns
|
|
221
|
-
*/
|
|
222
|
-
export declare function calculateMemory(value: unknown, unit?: 'B' | 'KB' | 'MB'): string;
|
|
223
|
-
|
|
224
|
-
declare type Callable<T> = T | (() => T);
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* 可执行函数执行, 非函数直接返回
|
|
228
|
-
* @param fn
|
|
229
|
-
* @param params
|
|
230
|
-
* @returns
|
|
231
|
-
*/
|
|
232
|
-
export declare function callable<T, P extends any[]>(fn: T | ((...params: P) => T), ...params: P): T;
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* 中文大写金额转换
|
|
236
|
-
* @param input
|
|
237
|
-
* @returns
|
|
238
|
-
*/
|
|
239
|
-
export declare function capitalizedAmount(input: number | string): any;
|
|
240
|
-
|
|
241
|
-
declare type CaseKey = string | number | symbol;
|
|
242
|
-
|
|
243
|
-
export declare function classNameExcludes(className: string, excludes: string[]): string;
|
|
244
|
-
|
|
245
|
-
export declare function classNames(...items: (string | undefined | null | Record<string, any>)[]): string;
|
|
246
|
-
|
|
247
|
-
export declare function clone<T = any>(value: T): T;
|
|
248
|
-
|
|
249
|
-
export declare function cloneDeep<T>(obj: T): T;
|
|
250
|
-
|
|
251
|
-
export declare function cloneShallow<T>(obj: T): T;
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* 推导 coalesce 返回值类型:
|
|
255
|
-
* - 如果为空参数列表,返回 null;
|
|
256
|
-
* - 否则返回所有 thunk 解析后的非 nullish 联合类型或 null。
|
|
257
|
-
*/
|
|
258
|
-
declare type CoalesceReturn<T extends readonly MaybeThunk<any>[]> = T extends [] ? undefined : Exclude<ReturnType<T[number]> | T[number], null | undefined> | undefined;
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* 推导 coalesce 返回值类型:
|
|
262
|
-
* - 如果为空参数列表,返回 null;
|
|
263
|
-
* - 否则返回所有 thunk 解析后的非 nullish 联合类型或 null。
|
|
264
|
-
*/
|
|
265
|
-
declare type CoalesceReturn_2<T extends readonly MaybeThunk_2<any>[]> = T extends [] ? undefined : Exclude<ReturnType<T[number]> | T[number], null | undefined> | undefined;
|
|
266
|
-
|
|
267
|
-
declare interface CommonEvent {
|
|
268
|
-
type: 'mousedown' | 'mouseup' | 'click';
|
|
269
|
-
bubbles?: boolean;
|
|
270
|
-
cancelable?: boolean;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
declare interface CommonEvent_2 {
|
|
274
|
-
type: 'mousedown' | 'mouseup' | 'click';
|
|
275
|
-
bubbles?: boolean;
|
|
276
|
-
cancelable?: boolean;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
export declare function compareSetDifference<T>(setA: Set<T>, setB: Set<T>): Set<T>;
|
|
280
|
-
|
|
281
|
-
declare type ConfigStore = Record<string, any>;
|
|
282
|
-
|
|
283
|
-
export declare function convertWeightUnitToStandard(chineseWeight: string): string;
|
|
284
|
-
|
|
285
|
-
export declare function coordinateBetween(p1: Point, p2: Point): Point[];
|
|
286
|
-
|
|
287
|
-
export declare function createArray<T = any>(amount: number, fill?: T | (() => T)): T[];
|
|
288
|
-
|
|
289
|
-
export declare function createDelayResizeObserver(element: Element, callback: (rect: DOMRectReadOnly) => void): ResizeObserver;
|
|
290
|
-
|
|
291
|
-
export declare function createFormData<T extends Record<string, any>>(initial: T): FormData;
|
|
292
|
-
|
|
293
|
-
export declare function createHtmlElement(tag: string, opts?: {
|
|
294
|
-
id?: string;
|
|
295
|
-
classList?: string[];
|
|
296
|
-
className: string;
|
|
297
|
-
}): HTMLElement;
|
|
298
|
-
|
|
299
|
-
export declare function createHtmlElementByTemplate(template: string): HTMLElement;
|
|
300
|
-
|
|
301
|
-
export declare function createReducerStore<T, A extends Action>(reducer: Reducer<T, A>, initialState: T): StoreResult<T, A>;
|
|
302
|
-
|
|
303
|
-
export declare function createResizeObserver(element: Element, callback: (rect: DOMRectReadOnly) => void): ResizeObserver;
|
|
304
|
-
|
|
305
|
-
export declare function createStateStore<T>(initialState: T): {
|
|
306
|
-
getStore: () => T;
|
|
307
|
-
setStore: (next: T | NextFunction<T>) => void;
|
|
308
|
-
subscribeStore: (listener: (state: T) => void) => () => void;
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* 时间格式化
|
|
313
|
-
* @param time
|
|
314
|
-
* @param format
|
|
315
|
-
* @returns
|
|
316
|
-
*/
|
|
317
|
-
export declare function dateFormatter<T>(time: T, format?: string, defaultValue?: string): string;
|
|
318
|
-
|
|
319
|
-
export declare function dateMonthFormatter<T = unknown>(value: T, defaultValue?: string): string;
|
|
320
|
-
|
|
321
|
-
export declare function dateTimeFormatter<T = unknown>(value: T, defaultValue?: string): string;
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* 函数去抖,也就是说当调用动作n毫秒后,才会执行该动作,若在这n毫秒内又调用此动作则将重新计算执行时间。
|
|
325
|
-
*
|
|
326
|
-
* @param {Function} func 需要去抖的函数.
|
|
327
|
-
* @param {number} [wait] 延迟执行的时间.
|
|
328
|
-
* @param {object} [options] 选项对象.
|
|
329
|
-
* @param {boolean} [options.leading] 指定是否在超时前调用.
|
|
330
|
-
* @param {number} [options.maxWait] func延迟调用的最大时间.
|
|
331
|
-
* @param {boolean} [options.trailing] 指定是否在超时后调用.
|
|
332
|
-
* @returns {Function} 返回去抖之后的函数.
|
|
333
|
-
*
|
|
334
|
-
*/
|
|
335
|
-
export declare function debounce<T extends (...args: any) => any>(func: T, wait?: number, options?: {
|
|
336
|
-
leading?: boolean | undefined;
|
|
337
|
-
maxWait?: number | undefined;
|
|
338
|
-
trailing?: boolean | undefined;
|
|
339
|
-
}): DebouncedFunc<T>;
|
|
340
|
-
|
|
341
|
-
declare interface DebouncedFunc<T extends (...args: any[]) => any> {
|
|
342
|
-
(...args: Parameters<T>): ReturnType<T> | undefined;
|
|
343
|
-
cancel: () => void;
|
|
344
|
-
flush: () => ReturnType<T> | undefined;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* XOR 解密(稳定输出原始内容)
|
|
349
|
-
* @param {string} encrypted - Base64 加密字符串
|
|
350
|
-
* @param {string} pwd - 密码
|
|
351
|
-
* @returns {string} 解密后的原始字符串
|
|
352
|
-
*/
|
|
353
|
-
export declare function decrypt(encrypted: string, pwd: string): string;
|
|
354
|
-
|
|
355
|
-
export declare function deepAssign<T = unknown>(target: T, assignment: Record<string, unknown>): T;
|
|
356
|
-
|
|
357
|
-
export declare function deepClone<T = any>(value: T): T;
|
|
358
|
-
|
|
359
|
-
export declare function deepCloneAssign<T>(from: T, assignment: Record<string, any>): T;
|
|
360
|
-
|
|
361
|
-
export declare function deepGet<T = any>(from: any, selector: string | null | undefined, defaultValue: T): T;
|
|
362
|
-
|
|
363
|
-
export declare function deepMultiSet<T = unknown>(target: T, assignment: Record<string, unknown>): T;
|
|
364
|
-
|
|
365
|
-
export declare function deepSet(obj: any, path: string | Array<string | number>, value: any): void;
|
|
366
|
-
|
|
367
|
-
export declare function deferMicrotask(func: VoidFunction): void;
|
|
368
|
-
|
|
369
|
-
export declare const deleteConfigStoreAtKey: (key: string) => void;
|
|
370
|
-
|
|
371
|
-
export declare function dispatchNodeEvent<T = any>(el: T, e: CommonEvent | SpecialEvent): Promise<T>;
|
|
372
|
-
|
|
373
|
-
export declare function dispatchNodeEvents<T = any>(el: T, events: (CommonEvent_2 | SpecialEvent_2)[]): Promise<T>;
|
|
374
|
-
|
|
375
|
-
export declare function distanceSimilarity(a: string, b: string): number;
|
|
376
|
-
|
|
377
|
-
export declare function divide(items: any[], options?: {
|
|
378
|
-
replaceNaNItem?: number;
|
|
379
|
-
replaceNaNResult?: number;
|
|
380
|
-
}): number;
|
|
381
|
-
|
|
382
|
-
export declare function divideBy(record: Record<string, any>, fields: any[], options?: {
|
|
383
|
-
replaceNaNItem?: number;
|
|
384
|
-
replaceNaNResult?: number;
|
|
385
|
-
}): number;
|
|
386
|
-
|
|
387
|
-
export declare function domAddClassNames(element: Element, ...classNames: string[]): void;
|
|
388
|
-
|
|
389
|
-
export declare function domContains(container: any, element: any): boolean;
|
|
390
|
-
|
|
391
|
-
export declare function domRemoveClassNames(element: HTMLElement, ...classNames: string[]): void;
|
|
392
|
-
|
|
393
|
-
export declare function downloadBuffer(fileName: string, buffer: ArrayBuffer): void;
|
|
394
|
-
|
|
395
|
-
declare function downloadBuffer_2({ fileName, buffer }: {
|
|
396
|
-
fileName: string;
|
|
397
|
-
buffer: ArrayBuffer;
|
|
398
|
-
}): void;
|
|
399
|
-
|
|
400
|
-
export declare function downloadFile(file: File): void;
|
|
401
|
-
|
|
402
|
-
export declare function downloadURL(url: string, fallbackName: string): void;
|
|
403
|
-
|
|
404
|
-
declare function downloadURL_2({ url, fileName, fallbackFileName, }: {
|
|
405
|
-
url: string;
|
|
406
|
-
fileName?: string;
|
|
407
|
-
fallbackFileName: string;
|
|
408
|
-
}): void;
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* 返回第一个非 null 或 undefined 的值(支持直接值和函数懒求值)
|
|
412
|
-
*/
|
|
413
|
-
export declare function emptyCoalesce<T extends readonly MaybeThunk_2<any>[]>(...items: T): CoalesceReturn_2<T>;
|
|
414
|
-
|
|
415
|
-
export declare function emptyCoalescing(...params: any[]): any;
|
|
416
|
-
|
|
417
|
-
export declare function emptyFunction(): void;
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* XOR 加密(支持 Unicode,解密稳定)
|
|
421
|
-
* @param {string} input - 要加密的字符串
|
|
422
|
-
* @param {string} pwd - 密码
|
|
423
|
-
* @returns {string} Base64 加密结果
|
|
424
|
-
*/
|
|
425
|
-
export declare function encrypt(input: string, pwd: string): string;
|
|
426
|
-
|
|
427
|
-
declare type EnsureArray<T> = T extends any[] ? T : T extends null | undefined ? [] : T[];
|
|
428
|
-
|
|
429
|
-
export declare function ensureArray(arr: any, defaultArr?: any[]): any[];
|
|
430
|
-
|
|
431
|
-
export declare function ensureArrayJoin(input: unknown, separator?: string): string;
|
|
432
|
-
|
|
433
|
-
export declare function ensureFunction<T extends (...args: any[]) => unknown>(input?: T | unknown): T;
|
|
434
|
-
|
|
435
|
-
export declare function ensureGetDateYear(value: any, defaultValue: number): number;
|
|
436
|
-
|
|
437
|
-
export declare function ensureInteger(value: any, defaultValue: number): number;
|
|
438
|
-
|
|
439
|
-
export declare function ensureMap<K, V>(map: any, fallback?: Map<K, V>): Map<K, V> | Map<any, any>;
|
|
440
|
-
|
|
441
|
-
export declare function ensureNotEmptyArray(arr: any, defaultArr: any[]): any[];
|
|
442
|
-
|
|
443
|
-
export declare function ensureNumber(value: any, defaultValue: number): number;
|
|
444
|
-
|
|
445
|
-
export declare function ensureObject(input: any, fallback?: Record<string, any>): Record<string, any>;
|
|
446
|
-
|
|
447
|
-
export declare function ensureString(value: any, fallback?: string): string;
|
|
448
|
-
|
|
449
|
-
export declare function ensureStringSplitArray<T>(input: unknown, separator: string): T[];
|
|
450
|
-
|
|
451
|
-
export declare function ensureZero(value: number, defaultValue: number): number;
|
|
452
|
-
|
|
453
|
-
export declare function escapeRegExp(str: string): string;
|
|
454
|
-
|
|
455
|
-
export declare function evaluateMathExpression(expression: string, variables: Record<string, any>, opts?: {
|
|
456
|
-
fallbackValue: number;
|
|
457
|
-
termFallbackValue: number;
|
|
458
|
-
precision?: number;
|
|
459
|
-
} | number): number;
|
|
460
|
-
|
|
461
|
-
export declare function exchangeRateFormatter<T = unknown>(value: T, opts?: {
|
|
462
|
-
thousandth?: boolean;
|
|
463
|
-
}): string;
|
|
464
|
-
|
|
465
|
-
export declare function execFunc(func: Function): any;
|
|
466
|
-
|
|
467
|
-
export declare function executePromises<T extends any[]>(promises: [...Array<Promise<T[number]>>]): Promise<T>;
|
|
468
|
-
|
|
469
|
-
declare function exportFile({ fileName, fallbackFileName, file, }: {
|
|
470
|
-
file: File;
|
|
471
|
-
fileName?: string;
|
|
472
|
-
fallbackFileName: string;
|
|
473
|
-
}): void;
|
|
474
|
-
|
|
475
|
-
declare function exportJson({ fileName, data }: {
|
|
476
|
-
fileName: string;
|
|
477
|
-
data: any;
|
|
478
|
-
}): void;
|
|
479
|
-
|
|
480
|
-
export declare function extractMapKeys<K, V>(map: Map<K, V>): K[];
|
|
481
|
-
|
|
482
|
-
export declare function extractMapValues<K, V>(map: Map<K, V>): V[];
|
|
483
|
-
|
|
484
|
-
export declare function extractWeightInfo(input: string): {
|
|
485
|
-
value: string;
|
|
486
|
-
unit: string;
|
|
487
|
-
quantity: number;
|
|
488
|
-
} | null;
|
|
489
|
-
|
|
490
|
-
export declare function extractWeightInfoToKg(spec: string): number | null;
|
|
491
|
-
|
|
492
|
-
export declare function findDOMDataBubble<T extends string>(start: any, dataKey: string, end?: any): T | undefined;
|
|
493
|
-
|
|
494
|
-
export declare function findHtmlElementById(id: string, defaultValue?: HTMLElement): HTMLElement | null;
|
|
495
|
-
|
|
496
|
-
export declare function findHtmlElementUpward(start: Element | null, callback: (element: Element) => boolean, defaultElement?: Element): Element | null;
|
|
497
|
-
|
|
498
|
-
export declare function findNodeClosest(from: HTMLElement | null | undefined, callback: (node: HTMLElement) => boolean, end?: HTMLElement | null | undefined): HTMLElement | null;
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* 将扁平数组转换成树结构
|
|
502
|
-
* @param list 扁平数组
|
|
503
|
-
* @param options 树解析map
|
|
504
|
-
* @returns
|
|
505
|
-
*/
|
|
506
|
-
export declare function flatArrayToTree(list?: any[], options?: {
|
|
507
|
-
keyField: string;
|
|
508
|
-
childField: string;
|
|
509
|
-
parentField: string;
|
|
510
|
-
}): any[];
|
|
511
|
-
|
|
512
|
-
export declare function functionWrap<T extends (...args: any[]) => any>(input: T, ...params: Parameters<T>): () => ReturnType<T>;
|
|
513
|
-
|
|
514
|
-
export declare function functionWrapable<T extends (...args: any[]) => any>(input: T | null | undefined, ...params: Parameters<T>): (() => ReturnType<T>) | undefined;
|
|
515
|
-
|
|
516
|
-
export declare function functionWrapable(input: unknown): undefined;
|
|
517
|
-
|
|
518
|
-
declare function get<T>(key: string | symbol): T | undefined;
|
|
519
|
-
|
|
520
|
-
declare function get<T>(key: string | symbol, fallbackValue: T): T;
|
|
521
|
-
|
|
522
|
-
export declare function getAllLocalStorage(): Record<string, any>;
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* 生成赋值数据
|
|
526
|
-
* @param assign
|
|
527
|
-
* @param target
|
|
528
|
-
* @returns
|
|
529
|
-
*/
|
|
530
|
-
export declare function getAssignData(assign: Record<string, string>, target: Record<string, any>): Record<string, any>;
|
|
531
|
-
|
|
532
|
-
export declare function getBrowserEnv(): "webview" | "mobile" | "desktop";
|
|
533
|
-
|
|
534
|
-
export declare function getClosestInteger(val: number): number;
|
|
535
|
-
|
|
536
|
-
export declare const getConfigStoreAtKey: <V = any>(key: string) => V | undefined;
|
|
537
|
-
|
|
538
|
-
export declare function getCurrentDate(): Date;
|
|
539
|
-
|
|
540
|
-
export declare function getDateDay(value: any, defaultValue?: number): number;
|
|
541
|
-
|
|
542
|
-
export declare function getDateLastDay(value: any, defaultValue?: number): number;
|
|
543
|
-
|
|
544
|
-
export declare function getDateMonth(value: any, defaultValue?: number): number;
|
|
545
|
-
|
|
546
|
-
export declare function getDateMonthEndDate(value: any, defaultValue?: Date): Date;
|
|
547
|
-
|
|
548
|
-
export declare function getDateMonthStartDate(value: any, defaultValue?: Date): Date;
|
|
549
|
-
|
|
550
|
-
export declare function getDateTimestamp(value: any, defaultValue: number): number;
|
|
551
|
-
|
|
552
|
-
export declare function getDateWeekday(value: any, defaultValue?: number): number;
|
|
553
|
-
|
|
554
|
-
export declare function getDateYear(value: any, defaultValue?: number): number;
|
|
555
|
-
|
|
556
|
-
export declare function getDateZeroTimeZoneTime(value: any): number;
|
|
557
|
-
|
|
558
|
-
export declare function getDayEndTimestamp(value: any, defaultValue?: number): number;
|
|
559
|
-
|
|
560
|
-
export declare function getDayStartTimestamp(value: any, defaultValue?: number): number;
|
|
561
|
-
|
|
562
|
-
export declare function getDOMRect(element: any): DOMRect | null;
|
|
563
|
-
|
|
564
|
-
export declare function getFileType(fileName: string): string;
|
|
565
|
-
|
|
566
|
-
export declare function getFileTypeFromPath(path: string): {
|
|
567
|
-
ext: null;
|
|
568
|
-
mime: null;
|
|
569
|
-
} | {
|
|
570
|
-
ext: string;
|
|
571
|
-
mime: string;
|
|
572
|
-
};
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* 根据占比调整 HEX 颜色的亮度(通过 HSL)
|
|
576
|
-
* @param hexColor 十六进制颜色(如 "#4CAF50")
|
|
577
|
-
* @param percentage 占比(0~1,0=最亮,1=最暗)
|
|
578
|
-
* @returns 调整后的 HEX 颜色
|
|
579
|
-
*/
|
|
580
|
-
export declare function getHexPercentColor(hexColor: string, percentage: number): string;
|
|
581
|
-
|
|
582
|
-
export declare function getMonthEndTimestamp(value: any, defaultValue: number): number;
|
|
583
|
-
|
|
584
|
-
export declare function getMonthStartTimestamp(value: any, defaultValue: number): number;
|
|
585
|
-
|
|
586
|
-
export declare function getNextMonthDate(value: any, defaultValue?: Date): Date;
|
|
587
|
-
|
|
588
|
-
export declare function getNextYearDate(value: any, defaultValue?: Date): Date;
|
|
589
|
-
|
|
590
|
-
export declare function getNumberPrecision(value: any): number;
|
|
591
|
-
|
|
592
|
-
export declare function getNumberStandardString(value: any): string;
|
|
593
|
-
|
|
594
|
-
export declare function getObjectEntries<T extends Record<string, any>>(obj: T): [string, any][];
|
|
595
|
-
|
|
596
|
-
export declare function getObjectUID(key: Record<string, any>): any;
|
|
597
|
-
|
|
598
|
-
export declare function getOffsetDaysDate(input: any, days: number, fallbackDate?: Date): Date;
|
|
599
|
-
|
|
600
|
-
export declare function getOffsetMonthsDate(input: any, months: number, fallbackDate?: Date): Date;
|
|
601
|
-
|
|
602
|
-
export declare function getOffsetYearsDate(input: any, years: number, fallbackDate?: Date): Date;
|
|
603
|
-
|
|
604
|
-
export declare function getPercentRGB(rgb: [number, number, number], percentage: number, darken?: boolean): number[];
|
|
605
|
-
|
|
606
|
-
export declare function getPrevMonthDate(value: any, defaultValue?: Date): Date;
|
|
607
|
-
|
|
608
|
-
export declare function getPrevYearDate(value: any, defaultValue?: Date): Date;
|
|
609
|
-
|
|
610
|
-
export declare function getRangeDateMonthSegments([startDate, endDate]: [Date, Date], opts?: {
|
|
611
|
-
hasYear?: boolean;
|
|
612
|
-
}): string[];
|
|
613
|
-
|
|
614
|
-
export declare function getRangeDateYearSegments([startDate, endDate]: [Date, Date]): string[];
|
|
615
|
-
|
|
616
|
-
/**
|
|
617
|
-
* 在两个 HEX 颜色之间平滑过渡
|
|
618
|
-
* @param startHex 起始颜色(如 "#FF0000")
|
|
619
|
-
* @param endHex 结束颜色(如 "#00FF00")
|
|
620
|
-
* @param percent 过渡比例(0~1,0=起始色,1=结束色)
|
|
621
|
-
* @returns 过渡后的 HEX 颜色
|
|
622
|
-
*/
|
|
623
|
-
export declare function getRangeHexPercentColor(startHex: string, endHex: string, percent: number): string;
|
|
624
|
-
|
|
625
|
-
export declare function getToday(): Date;
|
|
626
|
-
|
|
627
|
-
export declare function getTodayEndTimestamp(): number;
|
|
628
|
-
|
|
629
|
-
export declare function getTodayStartTimestamp(): number;
|
|
630
|
-
|
|
631
|
-
export declare function getYearEndTimestamp(input: any): number | null;
|
|
632
|
-
|
|
633
|
-
export declare function getYearStartTimestamp(input: any): number | null;
|
|
634
|
-
|
|
635
|
-
export declare const h5: {
|
|
636
|
-
downloadBuffer: typeof downloadBuffer_2;
|
|
637
|
-
downloadURL: typeof downloadURL_2;
|
|
638
|
-
exportFile: typeof exportFile;
|
|
639
|
-
exportJson: typeof exportJson;
|
|
640
|
-
readJsonFile: typeof readJsonFile;
|
|
641
|
-
};
|
|
642
|
-
|
|
643
|
-
export declare function hexToArgb(hexColor: string): string;
|
|
644
|
-
|
|
645
|
-
export declare function hexToRgba(ahex: string, inpuyAlpha?: number | string): {
|
|
646
|
-
v: string;
|
|
647
|
-
o: {
|
|
648
|
-
r: number;
|
|
649
|
-
g: number;
|
|
650
|
-
b: number;
|
|
651
|
-
a: number;
|
|
652
|
-
};
|
|
653
|
-
};
|
|
654
|
-
|
|
655
|
-
export declare function htmlElementAppendChild(parentElement: HTMLElement, sonElement: HTMLElement): HTMLElement;
|
|
656
|
-
|
|
657
|
-
export declare function htmlElementHasClassName(element: Element, className: string): boolean;
|
|
658
|
-
|
|
659
|
-
export declare function htmlElementRemoveChild(parentElement: HTMLElement, sonElement: HTMLElement): HTMLElement;
|
|
660
|
-
|
|
661
|
-
declare interface IAbstractTreeNode {
|
|
662
|
-
children?: IAbstractTreeNode[];
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
declare type IBaseValue<T> = T;
|
|
666
|
-
|
|
667
|
-
export declare function IF(condition: any, trueValue: any | (() => any)): any;
|
|
668
|
-
|
|
669
|
-
export declare function IF_ZERO_OR_NAN_REPLACE(input: any, replace: any): any;
|
|
670
|
-
|
|
671
|
-
export declare function IFEL<C, T, F>(condition: C, trueExp: T | ((condition: C) => T), falseExp: F | ((condition: C) => F)): T | F;
|
|
672
|
-
|
|
673
|
-
export declare function ifElse(condition: boolean, trueReturn: any, falseReturn: any): any;
|
|
674
|
-
|
|
675
|
-
export declare function IFEmpty<T = any, K = any>(val: T, elVal: K): T | K;
|
|
676
|
-
|
|
677
|
-
export declare function IFEqualReplace(val: any, equalValue: any, replace: any): any;
|
|
678
|
-
|
|
679
|
-
export declare function IFInvalidDateReplace(date: any, replace: Date): any;
|
|
680
|
-
|
|
681
|
-
export declare function ifNaNReplace(val: any, replace: any): any;
|
|
682
|
-
|
|
683
|
-
declare type IFnValue<T> = (...args: any[]) => T;
|
|
684
|
-
|
|
685
|
-
export declare function ifReplace<T>(val: T, fn: (val: T) => boolean, replace: any): any;
|
|
686
|
-
|
|
687
|
-
export declare function ifReturn<T>(condition: boolean | (() => boolean), val: T): T | undefined;
|
|
688
|
-
|
|
689
|
-
export declare function iif(condition: ValueOrFn<boolean>): {
|
|
690
|
-
then<T>(truthy: ValueOrFn<T>): {
|
|
691
|
-
else(falsy: ValueOrFn<T>): T;
|
|
692
|
-
};
|
|
693
|
-
};
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
* @param value 输入值
|
|
697
|
-
* @param thousandth 千分位, 默认 true
|
|
698
|
-
* @param allowNegative 允许负数, 默认 true
|
|
699
|
-
* @param allowDecimal 允许小数, 默认 true
|
|
700
|
-
* @param precision 小数位, 默认 2
|
|
701
|
-
*/
|
|
702
|
-
export declare function inputNumberMask(value: any, options?: {
|
|
703
|
-
thousandth?: boolean;
|
|
704
|
-
allowNegative?: boolean;
|
|
705
|
-
allowDecimal?: boolean;
|
|
706
|
-
precision?: number;
|
|
707
|
-
}): string;
|
|
708
|
-
|
|
709
|
-
export declare function integerFormatter<T = unknown>(value: T, options?: {
|
|
710
|
-
thousandth?: boolean;
|
|
711
|
-
}): string;
|
|
712
|
-
|
|
713
|
-
export declare function invalidDateReplace<T = any>(date: Date, repalce: T): Date | T;
|
|
714
|
-
|
|
715
|
-
export declare function invokeable<T>(value: IValue<T>, args: any[]): T;
|
|
716
|
-
|
|
717
|
-
declare interface IObject {
|
|
718
|
-
[name: string]: any;
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
export declare function isArray<T>(arr: T[] | unknown): arr is T[];
|
|
722
|
-
|
|
723
|
-
export declare function isBoolean(value: any): value is boolean;
|
|
724
|
-
|
|
725
|
-
export declare function isChineseChar(input: any): boolean;
|
|
726
|
-
|
|
727
|
-
export declare function isChineseString(input: any): boolean;
|
|
728
|
-
|
|
729
|
-
export declare function isDate(date: any): date is Date;
|
|
730
|
-
|
|
731
|
-
export declare function isDesktopBrowser(): boolean;
|
|
732
|
-
|
|
733
|
-
export declare function isDOM(element: any): any;
|
|
734
|
-
|
|
735
|
-
/**
|
|
736
|
-
* 判断数据是否为[null, undefind], 数组为空, 字符串为空, 对象为空
|
|
737
|
-
* @param input
|
|
738
|
-
*/
|
|
739
|
-
export declare function isEmpty(input: any): input is VoidLike_2;
|
|
740
|
-
|
|
741
|
-
export declare function isEmptyString(value: any): boolean;
|
|
742
|
-
|
|
743
|
-
export declare function isEqual(x: any, y: any): boolean;
|
|
744
|
-
|
|
745
|
-
export declare function isEqualZero(number: number, digits?: number): boolean;
|
|
746
|
-
|
|
747
|
-
export declare function isEveryVoid(...items: any[]): boolean;
|
|
748
|
-
|
|
749
|
-
export declare function isFalse(val: any): val is false;
|
|
750
|
-
|
|
751
|
-
export declare function isFasly(val: any): val is false;
|
|
752
|
-
|
|
753
|
-
export declare function isFormData(input: any): input is FormData;
|
|
754
|
-
|
|
755
|
-
export declare function isFunction<T extends (...args: any[]) => any>(input: unknown): input is T;
|
|
756
|
-
|
|
757
|
-
export declare function isHtmlElement(input: any): input is HTMLElement;
|
|
758
|
-
|
|
759
|
-
export declare function isHtmlInputElement(input: any): input is HTMLInputElement;
|
|
760
|
-
|
|
761
|
-
export declare function isMobileBrowser(): boolean;
|
|
762
|
-
|
|
763
|
-
export declare function isMoreThanZero(val: any): boolean;
|
|
764
|
-
|
|
765
|
-
export declare function isNodeContains(container: HTMLElement | null | undefined, target?: HTMLElement | null | undefined): boolean;
|
|
766
|
-
|
|
767
|
-
/**
|
|
768
|
-
* 判断数据是否不为[null, undefind], 数组不为空, 字符串不为空, 对象不为空
|
|
769
|
-
* @param input
|
|
770
|
-
*/
|
|
771
|
-
export declare function isNotEmpty(input: any): input is NotVoidLike;
|
|
772
|
-
|
|
773
|
-
export declare function isNotEmptyArray(arr: any): arr is Array<any>;
|
|
774
|
-
|
|
775
|
-
export declare function isNotEmptyString(value: any): value is string;
|
|
776
|
-
|
|
777
|
-
export declare function isNotEqualZero(number: number, digits?: number): boolean;
|
|
778
|
-
|
|
779
|
-
export declare function isNotNullish<T>(value: T | null | undefined): value is T;
|
|
780
|
-
|
|
781
|
-
export declare function isNotPlainObject(val: any): boolean;
|
|
782
|
-
|
|
783
|
-
export declare function isNotUndefined(value: any): boolean;
|
|
784
|
-
|
|
785
|
-
export declare function isNotVoid(input: any): input is NotVoidLike_2;
|
|
786
|
-
|
|
787
|
-
export declare function isNullish<T>(value: T | null | undefined): value is null | undefined;
|
|
788
|
-
|
|
789
|
-
export declare function isNumber(value: any): value is number;
|
|
790
|
-
|
|
791
|
-
export declare function isNumeric(token: string): boolean;
|
|
792
|
-
|
|
793
|
-
export declare function isObject<T extends Record<string, any>>(obj: unknown): obj is T;
|
|
794
|
-
|
|
795
|
-
/**
|
|
796
|
-
* 判断两个对象是否相等
|
|
797
|
-
*/
|
|
798
|
-
export declare function isObjStructureEqual(obj1: Record<string, any>, obj2: Record<string, any>): boolean;
|
|
799
|
-
|
|
800
|
-
export declare function isPlainObject(val: any): boolean;
|
|
801
|
-
|
|
802
|
-
export declare function isPromise<T>(input: T): input is T extends Promise<any> ? T : never;
|
|
803
|
-
|
|
804
|
-
export declare function isSomeNotVoid(...items: any[]): boolean;
|
|
805
|
-
|
|
806
|
-
export declare function isSomeVoid(...items: any[]): boolean;
|
|
807
|
-
|
|
808
|
-
export declare function isString(value: unknown): value is string;
|
|
809
|
-
|
|
810
|
-
export declare function isTimestamp(input: any): boolean;
|
|
811
|
-
|
|
812
|
-
export declare function isTreeBranch<T extends Record<string, any>>(node: T, opts?: {
|
|
813
|
-
leafField?: string;
|
|
814
|
-
}): boolean;
|
|
815
|
-
|
|
816
|
-
export declare function isTreeLeaf<T extends Record<string, any>>(node: T, opts?: {
|
|
817
|
-
leafField?: string;
|
|
818
|
-
}): boolean;
|
|
819
|
-
|
|
820
|
-
export declare function isTrue(val: any): val is true;
|
|
821
|
-
|
|
822
|
-
export declare function isTruly(val: any): val is true;
|
|
823
|
-
|
|
824
|
-
export declare function isUndefined(value: any): boolean;
|
|
825
|
-
|
|
826
|
-
export declare function isURLSearchParams(input: any): input is URLSearchParams;
|
|
827
|
-
|
|
828
|
-
export declare function isValidDate(input: any): input is Date;
|
|
829
|
-
|
|
830
|
-
export declare function isValidNumber(val: any): boolean;
|
|
831
|
-
|
|
832
|
-
export declare function isVoid(input: any): input is VoidLike;
|
|
833
|
-
|
|
834
|
-
export declare function isWebViewBrowser(): boolean;
|
|
835
|
-
|
|
836
|
-
export declare function isWeixinBrowser(): boolean;
|
|
837
|
-
|
|
838
|
-
declare interface ISwitchMap {
|
|
839
|
-
[field: string]: any | (() => any);
|
|
840
|
-
default?: any | (() => any);
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
declare type IValue<T> = IBaseValue<T> | IFnValue<T>;
|
|
844
|
-
|
|
845
|
-
export declare const jsonParser: {
|
|
846
|
-
FUNC_PREFIX: string;
|
|
847
|
-
REG_PREFIX: string;
|
|
848
|
-
isArrOrObj(obj: any): boolean;
|
|
849
|
-
isArr(obj: any): boolean;
|
|
850
|
-
isObj(obj: any): boolean;
|
|
851
|
-
isRegExp(obj: any): boolean;
|
|
852
|
-
isFunc(obj: any): boolean;
|
|
853
|
-
funcParse(obj: IObject | any[]): any;
|
|
854
|
-
parse(jsonStr: string, error?: ((err: Error | unknown) => Record<string, any>) | undefined): any;
|
|
855
|
-
stringify(obj: any, replacer?: ((key: string, value: any) => any) | undefined, space?: number | string, error?: ((err: Error | unknown) => Record<string, any>) | undefined): string;
|
|
856
|
-
fastStringify(obj: any, space?: number | string, error?: ((err: Error | unknown) => Record<string, any>) | undefined): string;
|
|
857
|
-
nativeStringify: {
|
|
858
|
-
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
859
|
-
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
860
|
-
};
|
|
861
|
-
nativeParse: (text: string, reviver?: ((this: any, key: string, value: any) => any) | undefined) => any;
|
|
862
|
-
};
|
|
863
|
-
|
|
864
|
-
export declare function localStorageDelete(key: string): void;
|
|
865
|
-
|
|
866
|
-
export declare function localStorageGet<T>(key: string): T | null;
|
|
867
|
-
|
|
868
|
-
export declare function localStorageSet(key: string, value: any): void;
|
|
869
|
-
|
|
870
|
-
export declare function makeArray<T>(input: T): EnsureArray<T>;
|
|
871
|
-
|
|
872
|
-
export declare function mapKeys(map: any): any[];
|
|
873
|
-
|
|
874
|
-
declare interface Mapping {
|
|
875
|
-
eq: string | number;
|
|
876
|
-
ne: string | number;
|
|
877
|
-
ge: string | number;
|
|
878
|
-
le: string | number;
|
|
879
|
-
gt: string | number;
|
|
880
|
-
lt: string | number;
|
|
881
|
-
in: (string | number | Record<string, any>)[];
|
|
882
|
-
notIn: (string | number | Record<string, any>)[];
|
|
883
|
-
like: string | number;
|
|
884
|
-
likeRight: string | number;
|
|
885
|
-
likeLeft: string | number;
|
|
886
|
-
between: [string | number, string | number];
|
|
887
|
-
isNull: boolean;
|
|
888
|
-
isEmpty: boolean;
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
declare interface Mapping_2 {
|
|
892
|
-
eq?: Nullable_2<string | number>;
|
|
893
|
-
ne?: Nullable_2<string | number>;
|
|
894
|
-
ge?: Nullable_2<string | number>;
|
|
895
|
-
le?: Nullable_2<string | number>;
|
|
896
|
-
gt?: Nullable_2<string | number>;
|
|
897
|
-
lt?: Nullable_2<string | number>;
|
|
898
|
-
in?: Nullable_2<(string | number | Record<string, any>)[]>;
|
|
899
|
-
notIn?: Nullable_2<(string | number | Record<string, any>)[]>;
|
|
900
|
-
like?: Nullable_2<string | number>;
|
|
901
|
-
likeRight?: Nullable_2<string | number>;
|
|
902
|
-
likeLeft?: Nullable_2<string | number>;
|
|
903
|
-
between?: Nullable_2<[string | number, string | number]>;
|
|
904
|
-
isNull?: Nullable_2<boolean>;
|
|
905
|
-
isEmpty?: Nullable_2<boolean>;
|
|
906
|
-
tag?: Nullable_2<string>;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
declare interface MappingReuslt {
|
|
910
|
-
eq?: string | number;
|
|
911
|
-
ne?: string | number;
|
|
912
|
-
ge?: string | number;
|
|
913
|
-
le?: string | number;
|
|
914
|
-
gt?: string | number;
|
|
915
|
-
lt?: string | number;
|
|
916
|
-
in?: (string | number | Record<string, any>)[];
|
|
917
|
-
notIn?: (string | number | Record<string, any>)[];
|
|
918
|
-
like?: string | number;
|
|
919
|
-
likeRight?: string | number;
|
|
920
|
-
likeLeft?: string | number;
|
|
921
|
-
between?: [string | number, string | number];
|
|
922
|
-
isNull?: boolean;
|
|
923
|
-
isEmpty?: boolean;
|
|
924
|
-
tag?: string;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
export declare function match<K extends CaseKey>(key: Callable<K>): MatchBuilder<K, never>;
|
|
928
|
-
|
|
929
|
-
declare type MatchBuilder<K, V> = {
|
|
930
|
-
case: <CK extends CaseKey, CV>(key: Callable<CK> | Callable<CK[]>, value: Callable<CV>) => MatchBuilder<K, V | CV>;
|
|
931
|
-
default: <DV>(value: Callable<DV>) => V | DV;
|
|
932
|
-
};
|
|
933
|
-
|
|
934
|
-
export declare function mathTakeEvaluate(variables: Record<string, any>, expression: string, opts?: {
|
|
935
|
-
fallbackValue: number;
|
|
936
|
-
termFallbackValue: number;
|
|
937
|
-
precision?: number;
|
|
938
|
-
} | number): number;
|
|
939
|
-
|
|
940
|
-
declare type MaybeThunk<T> = T | (() => T);
|
|
941
|
-
|
|
942
|
-
declare type MaybeThunk_2<T> = T | (() => T);
|
|
943
|
-
|
|
944
|
-
export declare const memoStore: {
|
|
945
|
-
get: typeof get;
|
|
946
|
-
set: (key: string | symbol, val: unknown) => void;
|
|
947
|
-
delete: (key: string | symbol) => void;
|
|
948
|
-
};
|
|
949
|
-
|
|
950
|
-
declare type Merge<T extends any[]> = T extends [infer First, ...infer Rest extends any[]] ? First extends object ? Rest extends any[] ? First & Merge<Rest> : First : never : {};
|
|
951
|
-
|
|
952
|
-
export declare function mergeArray(...arrs: any[]): any[];
|
|
953
|
-
|
|
954
|
-
export declare function mergeObject<T extends any[]>(...objectList: T): Merge<T>;
|
|
955
|
-
|
|
956
|
-
export declare function mergeProps<T extends Record<string, any>>(base: T, extra: T): T;
|
|
957
|
-
|
|
958
|
-
export declare function multiply(arr: any[], options?: {
|
|
959
|
-
replaceNaNItem?: number;
|
|
960
|
-
replaceNaNResult?: number;
|
|
961
|
-
}): number;
|
|
962
|
-
|
|
963
|
-
export declare function multiplyBy(val: Record<string, any>, fields: string[], options?: {
|
|
964
|
-
replaceNaNItem?: number;
|
|
965
|
-
replaceNaNResult?: number;
|
|
966
|
-
}): number;
|
|
967
|
-
|
|
968
|
-
declare type NextFunction<T> = (state: T) => T;
|
|
969
|
-
|
|
970
|
-
declare type NotVoidLike = object | Map<any, any> | Set<any> | string | number | boolean;
|
|
971
|
-
|
|
972
|
-
declare type NotVoidLike_2 = object | Map<any, any> | Set<any> | string | number | boolean;
|
|
973
|
-
|
|
974
|
-
declare type Nullable<T> = T | null | undefined;
|
|
975
|
-
|
|
976
|
-
declare type Nullable_2<T> = T | null | undefined;
|
|
977
|
-
|
|
978
|
-
/**
|
|
979
|
-
* 返回第一个非 null 或 undefined 的值(支持直接值和函数懒求值)
|
|
980
|
-
*/
|
|
981
|
-
export declare function nullishCoalesce<T extends readonly MaybeThunk<any>[]>(...items: T): CoalesceReturn<T>;
|
|
982
|
-
|
|
983
|
-
export declare function numberFormateDecimal(input: any, decimals?: number, opts?: {
|
|
984
|
-
mode: 'round' | 'truncate';
|
|
985
|
-
}): string;
|
|
986
|
-
|
|
987
|
-
export declare function numberFormateThousandth(value: any): string;
|
|
988
|
-
|
|
989
|
-
/**
|
|
990
|
-
* @param value 需格式化值
|
|
991
|
-
* @param thousandth 千分位, 默认 true
|
|
992
|
-
* @param percent 百分比, 默认 false
|
|
993
|
-
* @param allowRound 四舍五入, 默认 true
|
|
994
|
-
* @param precision 小数位, 默认 2
|
|
995
|
-
* @param precisionPad 小数位填充, 默认 true
|
|
996
|
-
* @param multiply 小数位填充, 默认 1
|
|
997
|
-
*/
|
|
998
|
-
export declare function numberFormatter<T = unknown>(value: T, options?: {
|
|
999
|
-
allowDecimal?: boolean;
|
|
1000
|
-
thousandth?: boolean;
|
|
1001
|
-
percent?: boolean;
|
|
1002
|
-
allowRound?: boolean;
|
|
1003
|
-
precision?: number;
|
|
1004
|
-
precisionPad?: boolean;
|
|
1005
|
-
multiply?: number;
|
|
1006
|
-
}): string;
|
|
1007
|
-
|
|
1008
|
-
/**
|
|
1009
|
-
* 保留指定位数的小数
|
|
1010
|
-
* @param value 原始数字
|
|
1011
|
-
* @param decimals 要保留的小数位数(默认为 2)
|
|
1012
|
-
* @param mode 保留模式:'round' 表示四舍五入,'trunc' 表示直接截取(默认为 'round')
|
|
1013
|
-
*/
|
|
1014
|
-
export declare function numberKeepDecimal(input: any, decimals?: number, opts?: {
|
|
1015
|
-
mode?: 'round' | 'trunc';
|
|
1016
|
-
fallback?: number;
|
|
1017
|
-
}): number;
|
|
1018
|
-
|
|
1019
|
-
export declare function numberRandom(min: number, max: number): number;
|
|
1020
|
-
|
|
1021
|
-
export declare function numberRound(value: any, precision: number): number;
|
|
1022
|
-
|
|
1023
|
-
/**
|
|
1024
|
-
* 将一个数字转换为整数
|
|
1025
|
-
* - 支持四种方法:
|
|
1026
|
-
* - "round"(默认,四舍五入)
|
|
1027
|
-
* - "floor"(向下取整)
|
|
1028
|
-
* - "ceil"(向上取整)
|
|
1029
|
-
* - "trunc"(直接去掉小数部分,取整)
|
|
1030
|
-
* @param value 输入的数字
|
|
1031
|
-
* @param method 转换方法
|
|
1032
|
-
* @param opts.fallback 失败默认值
|
|
1033
|
-
* @returns 整数
|
|
1034
|
-
*/
|
|
1035
|
-
export declare function numberToInt(input: any, method?: 'floor' | 'ceil' | 'round' | 'trunc', opts?: {
|
|
1036
|
-
fallback: number;
|
|
1037
|
-
}): number;
|
|
1038
|
-
|
|
1039
|
-
export declare function objectArrayExpressionCalcInject(arr: Record<string, any>[], injects: Record<string, string>): Record<string, any>[];
|
|
1040
|
-
|
|
1041
|
-
export declare function objectArrayMerge<T extends Record<string, any>>(arr: T[], classNames: string[], mergeCallback?: (mergeRecord: T, item: T) => T): T[];
|
|
1042
|
-
|
|
1043
|
-
export declare function objectArrayPick(arr: Record<string, any>[], pick: string): any[];
|
|
1044
|
-
|
|
1045
|
-
export declare function objectArrayResetFields<T extends Record<string, any>>(arr: T[], resetFields: Record<string, any>): T[];
|
|
1046
|
-
|
|
1047
|
-
export declare function objectArraySyncFields(arr: Record<string, any>[], fields: Record<string, string>): Record<string, any>[];
|
|
1048
|
-
|
|
1049
|
-
export declare function objectAssign<T>(obj: T, assign: Record<string, any>): T;
|
|
1050
|
-
|
|
1051
|
-
export declare function objectEqual(obj: any, obj1: any, opts?: {
|
|
1052
|
-
compareFields?: string[];
|
|
1053
|
-
}): boolean;
|
|
1054
|
-
|
|
1055
|
-
/**
|
|
1056
|
-
* 对象字段校验
|
|
1057
|
-
* @param obj 检测对象
|
|
1058
|
-
* @param fields 默认Object.keys获取到的字段
|
|
1059
|
-
* @param callback 默认isEmpty
|
|
1060
|
-
* @return boolean
|
|
1061
|
-
*/
|
|
1062
|
-
export declare function objectFieldsEvery(obj: any, validateFunc: (fieldValue: any) => boolean, fields?: string[], defaultValue?: boolean): boolean;
|
|
1063
|
-
|
|
1064
|
-
export declare function objectFieldsSetNull(o: any, fields: string[]): Record<string, any>;
|
|
1065
|
-
|
|
1066
|
-
export declare function objectFieldsSetUndefined(o: any, fields: string[]): Record<string, any>;
|
|
1067
|
-
|
|
1068
|
-
/**
|
|
1069
|
-
* 对象字段校验
|
|
1070
|
-
* @param obj 检测对象
|
|
1071
|
-
* @param fields 默认Object.keys获取到的字段
|
|
1072
|
-
* @param callback 默认isNotEmpty
|
|
1073
|
-
* @return boolean
|
|
1074
|
-
*/
|
|
1075
|
-
export declare function objectFieldsValidate(obj: any, fields?: string[] | null, validateFunc?: (fieldValue: any) => boolean): boolean;
|
|
1076
|
-
|
|
1077
|
-
export declare function objectFieldsValidatePaths(record: Record<string, any>, paths: string[], check?: (val: any) => boolean): (readonly [string, boolean])[];
|
|
1078
|
-
|
|
1079
|
-
export declare function objectFieldsValidateVoidPaths(record: Record<string, any>, paths: string[]): string[];
|
|
1080
|
-
|
|
1081
|
-
export declare function objectForEach<T extends Record<string, any>>(obj: T, callback: (key: string, value: any, obj: T) => void): void;
|
|
1082
|
-
|
|
1083
|
-
export declare function objectGet(value: unknown, path?: string, defaultValue?: any): any;
|
|
1084
|
-
|
|
1085
|
-
export declare function objectHas(obj: unknown, fields: string | string[]): boolean;
|
|
1086
|
-
|
|
1087
|
-
export declare function objectHasKey<T, K extends PropertyKey>(obj: T, key: K): key is K & keyof T;
|
|
1088
|
-
|
|
1089
|
-
export declare function objectKeys(obj: any, opts?: {
|
|
1090
|
-
excludeKeys?: string[];
|
|
1091
|
-
includeKeys?: string[];
|
|
1092
|
-
}, keyMap?: (key: string) => string): any[];
|
|
1093
|
-
|
|
1094
|
-
export declare function objectOmit<O extends Record<string, any>>(input: O, check: any[] | ((value: any) => boolean)): Record<string, any>;
|
|
1095
|
-
|
|
1096
|
-
export declare function objectOmitFields<O extends object, F extends keyof O>(input: O, fields: F[]): Omit<O, F>;
|
|
1097
|
-
|
|
1098
|
-
export declare function objectPathsJoin(record: Record<string, any>, paths: string[], joinSymbol?: string): string;
|
|
1099
|
-
|
|
1100
|
-
export declare function objectPick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
1101
|
-
|
|
1102
|
-
export declare function objectRemoveFields(o: any, fields: string[]): Record<string, any>;
|
|
1103
|
-
|
|
1104
|
-
export declare function objectRemoveNullishFields<T extends Record<string, any>>(obj: T): Partial<T>;
|
|
1105
|
-
|
|
1106
|
-
export declare function objectSet<T extends Record<string, any>>(obj: T, path: string, val: unknown): void;
|
|
1107
|
-
|
|
1108
|
-
export declare function objectShallowGet(obj: any, field: string): any;
|
|
1109
|
-
|
|
1110
|
-
export declare function objectShallowMap(obj: Record<any, any>, keyFn: (key: any, value: any, obj: Record<any, any>) => string, valueFn: (value: any, key: any, obj: Record<any, any>) => any): Record<any, any>;
|
|
1111
|
-
|
|
1112
|
-
/**
|
|
1113
|
-
* 对象字段校验
|
|
1114
|
-
* @param obj 检测对象
|
|
1115
|
-
* @param fields 默认Object.keys获取到的字段
|
|
1116
|
-
* @param callback 默认isEmpty
|
|
1117
|
-
* @return boolean
|
|
1118
|
-
*/
|
|
1119
|
-
export declare function objectSome(obj: any, validateFunc: (fieldValue: any) => boolean, fields?: string[] | null, defaultValue?: boolean): boolean;
|
|
1120
|
-
|
|
1121
|
-
export declare function objectSomeFields(input: any, fields: string[], func: (fieldValue: any, field: string) => boolean): boolean;
|
|
1122
|
-
|
|
1123
|
-
export declare function objectStringify(obj: Record<string, any>, allowDots?: boolean): string;
|
|
1124
|
-
|
|
1125
|
-
export declare function objectToArray<T extends Record<string, any>>(obj: Record<string, any>, callback: (key: string, value: any) => T): T[];
|
|
1126
|
-
|
|
1127
|
-
export declare function objectValueMap<T extends Record<string, any>, R>(input: T, valueGetter: (value: T[keyof T], key: keyof T, input: T) => R): Record<keyof T, R>;
|
|
1128
|
-
|
|
1129
|
-
/**
|
|
1130
|
-
* 对象转url参数
|
|
1131
|
-
* @param {*} data
|
|
1132
|
-
* @param {*} isPrefix
|
|
1133
|
-
*/
|
|
1134
|
-
export declare function objToUrl(data: any, isPrefix?: boolean): string;
|
|
1135
|
-
|
|
1136
|
-
export declare function parseURL(path: string): {
|
|
1137
|
-
pathname: string;
|
|
1138
|
-
params: Record<string, string>;
|
|
1139
|
-
};
|
|
1140
|
-
|
|
1141
|
-
export declare function percentFormatter<T = unknown>(value: T, options?: {
|
|
1142
|
-
thousandth?: boolean;
|
|
1143
|
-
allowRound?: boolean;
|
|
1144
|
-
precision?: number;
|
|
1145
|
-
precisionPad?: boolean;
|
|
1146
|
-
}): string;
|
|
1147
|
-
|
|
1148
|
-
export declare function pipe<A extends unknown[], B>(ab: (this: void, ...a: A) => B): (...args: A) => B;
|
|
1149
|
-
|
|
1150
|
-
export declare function pipe<A extends unknown[], B, C>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C): (...args: A) => C;
|
|
1151
|
-
|
|
1152
|
-
export declare function pipe<A extends unknown[], B, C, D>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D): (...args: A) => D;
|
|
1153
|
-
|
|
1154
|
-
export declare function pipe<A extends unknown[], B, C, D, E>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E): (...args: A) => E;
|
|
1155
|
-
|
|
1156
|
-
export declare function pipe<A extends unknown[], B, C, D, E, F>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F): (...args: A) => F;
|
|
1157
|
-
|
|
1158
|
-
export declare function pipe<A extends unknown[], B, C, D, E, F, G>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G): (...args: A) => G;
|
|
1159
|
-
|
|
1160
|
-
export declare function pipe<A extends unknown[], B, C, D, E, F, G, H>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H): (...args: A) => H;
|
|
1161
|
-
|
|
1162
|
-
export declare function pipe<A extends unknown[], B, C, D, E, F, G, H, I>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H, hi: (this: void, h: H) => I): (...args: A) => I;
|
|
1163
|
-
|
|
1164
|
-
export declare function pipe<A extends unknown[], B, C, D, E, F, G, H, I, J>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H, hi: (this: void, h: H) => I, ij: (this: void, i: I) => J): (...args: A) => J;
|
|
1165
|
-
|
|
1166
|
-
export declare function pipeWith<A, B>(a: A, ab: (this: void, a: A) => B): B;
|
|
1167
|
-
|
|
1168
|
-
export declare function pipeWith<A, B, C>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C): C;
|
|
1169
|
-
|
|
1170
|
-
export declare function pipeWith<A, B, C, D>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D): D;
|
|
1171
|
-
|
|
1172
|
-
export declare function pipeWith<A, B, C, D, E>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E): E;
|
|
1173
|
-
|
|
1174
|
-
export declare function pipeWith<A, B, C, D, E, F>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F): F;
|
|
1175
|
-
|
|
1176
|
-
export declare function pipeWith<A, B, C, D, E, F, G>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G): G;
|
|
1177
|
-
|
|
1178
|
-
export declare function pipeWith<A, B, C, D, E, F, G, H>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H): H;
|
|
1179
|
-
|
|
1180
|
-
export declare function pipeWith<A, B, C, D, E, F, G, H, I>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H, hi: (this: void, h: H) => I): I;
|
|
1181
|
-
|
|
1182
|
-
export declare function pipeWith<A, B, C, D, E, F, G, H, I, J>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H, hi: (this: void, h: H) => I, ij: (this: void, i: I) => J): J;
|
|
1183
|
-
|
|
1184
|
-
declare interface Point {
|
|
1185
|
-
x: number;
|
|
1186
|
-
y: number;
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
declare type Point_2<X extends string, Y extends string> = {
|
|
1190
|
-
[K in X | Y]: number;
|
|
1191
|
-
};
|
|
1192
|
-
|
|
1193
|
-
declare type Point_3<X extends string, Y extends string> = {
|
|
1194
|
-
[K in X | Y]: number;
|
|
1195
|
-
};
|
|
1196
|
-
|
|
1197
|
-
declare type Point_4<X extends string, Y extends string> = {
|
|
1198
|
-
[K in X | Y]: number;
|
|
1199
|
-
};
|
|
1200
|
-
|
|
1201
|
-
export declare function promiseQueue(arr: Promise<any>[]): Promise<any[]>;
|
|
1202
|
-
|
|
1203
|
-
export declare const qs: {
|
|
1204
|
-
stringify: typeof stringify;
|
|
1205
|
-
};
|
|
1206
|
-
|
|
1207
|
-
export declare function queryStructure(mapping: Mapping_2): MappingReuslt;
|
|
1208
|
-
|
|
1209
|
-
export declare function rangeDateFormatter<T = unknown>(value: T): string;
|
|
1210
|
-
|
|
1211
|
-
export declare function rangeMonthFormatter<T = unknown>(value: T): string;
|
|
1212
|
-
|
|
1213
|
-
/** TODO: 值类型检测需更完善一点 */
|
|
1214
|
-
export declare function rangeYearFormatter<T = unknown>(value: T): string;
|
|
1215
|
-
|
|
1216
|
-
export declare function readBlobAsBuffer(bolb: Blob): Promise<ArrayBuffer>;
|
|
1217
|
-
|
|
1218
|
-
export declare function readFileAsArrayBuffer(file: File): Promise<ArrayBuffer>;
|
|
1219
|
-
|
|
1220
|
-
export declare function readFileAsBuffer(file: File): Promise<ArrayBuffer>;
|
|
1221
|
-
|
|
1222
|
-
declare function readJsonFile<T = any>({ file, fallbackResult }: {
|
|
1223
|
-
file: File;
|
|
1224
|
-
fallbackResult?: T;
|
|
1225
|
-
}): Promise<T>;
|
|
1226
|
-
|
|
1227
|
-
export declare function readURLAsBuffer(url: string): Promise<ArrayBuffer>;
|
|
1228
|
-
|
|
1229
|
-
declare type Reducer<T, A> = (state: T, action: A) => T;
|
|
1230
|
-
|
|
1231
|
-
export declare function returnNotVoid<X, Y>(param1: X, param2: Y | (() => Y)): X | Y;
|
|
1232
|
-
|
|
1233
|
-
export declare function rgba2obj(rgba?: string): RGBColor;
|
|
1234
|
-
|
|
1235
|
-
export declare interface RGBColor {
|
|
1236
|
-
a?: number;
|
|
1237
|
-
b: number;
|
|
1238
|
-
g: number;
|
|
1239
|
-
r: number;
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
export declare function runPromiseQueue(promises: Promise<any>[]): Promise<any[]>;
|
|
1243
|
-
|
|
1244
|
-
export declare function runQueuePromise(promises: (() => Promise<any>)[]): Promise<any[]>;
|
|
1245
|
-
|
|
1246
|
-
export declare function safeArray(arr: any): any[];
|
|
1247
|
-
|
|
1248
|
-
export declare function safeArrayJoin(arr: any, seperator?: string): string;
|
|
1249
|
-
|
|
1250
|
-
export declare function safeDateGetYear(date: Date): number;
|
|
1251
|
-
|
|
1252
|
-
/**
|
|
1253
|
-
* 安全获取
|
|
1254
|
-
*/
|
|
1255
|
-
export declare function safeGet<T = any>(prop: any, ...opts: any): T;
|
|
1256
|
-
|
|
1257
|
-
export declare function selectFile({ accept, multiple }: {
|
|
1258
|
-
accept?: string;
|
|
1259
|
-
multiple?: 'multiple';
|
|
1260
|
-
}): Promise<File[]>;
|
|
1261
|
-
|
|
1262
|
-
export declare const setConfigStore: (nextStore: ConfigStore) => void;
|
|
1263
|
-
|
|
1264
|
-
export declare const setConfigStoreAtKey: <V>(key: string, value: V) => void;
|
|
1265
|
-
|
|
1266
|
-
export declare function setDOMStyle(element: any, styles: Record<string, any>): void;
|
|
1267
|
-
|
|
1268
|
-
export declare function setDOMStylePropertys(element: any, propertys: Record<string, any>): void;
|
|
1269
|
-
|
|
1270
|
-
export declare function setHtmlInputValue<T = any>(el: T, value: any, opts?: {
|
|
1271
|
-
dispatchEvent: boolean | 'bubbles';
|
|
1272
|
-
}): Promise<T>;
|
|
1273
|
-
|
|
1274
|
-
export declare function shareAmount(totalAmount: any, target: {
|
|
1275
|
-
items: Record<string, any>[];
|
|
1276
|
-
itemPercentage: (row: any) => number;
|
|
1277
|
-
itemField: string;
|
|
1278
|
-
itemShare?: (item: any, percentageAmount: number) => number;
|
|
1279
|
-
}): Record<string, any>[];
|
|
1280
|
-
|
|
1281
|
-
/**
|
|
1282
|
-
* 比较函数,支持字符串、数字、数组、[null, undefined]
|
|
1283
|
-
*/
|
|
1284
|
-
export declare function smartCompare(x: any, y: any, order?: 'asc' | 'desc' | 'none' | undefined | null): number;
|
|
1285
|
-
|
|
1286
|
-
declare interface SortCondition<T> {
|
|
1287
|
-
condition: (item: T) => any;
|
|
1288
|
-
order: 'asc' | 'desc';
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
declare interface SpecialEvent {
|
|
1292
|
-
type: 'focus';
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
declare interface SpecialEvent_2 {
|
|
1296
|
-
type: 'focus';
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
export declare function stopDOMEvent(event: any): void;
|
|
1300
|
-
|
|
1301
|
-
declare interface StoreResult<T, A> {
|
|
1302
|
-
getState: () => T;
|
|
1303
|
-
dispatch: (action: A) => void;
|
|
1304
|
-
subscribe: (listener: () => void) => () => void;
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
declare function stringify(obj: any, unsafePrefix?: string): string;
|
|
1308
|
-
|
|
1309
|
-
export declare function stringInsert(value: any, strIndex: number, insert: any): string;
|
|
1310
|
-
|
|
1311
|
-
export declare function stringJoin(value: any, interval: number, joinStr: string): string;
|
|
1312
|
-
|
|
1313
|
-
export declare function stringReplaceAll(value: string, regOrStr: string | RegExp, replaceStr: string, apply?: (opts: {
|
|
1314
|
-
matchStr: string;
|
|
1315
|
-
matchStrIndex: number;
|
|
1316
|
-
matchCount: number;
|
|
1317
|
-
matchTotal: number;
|
|
1318
|
-
}) => boolean): string;
|
|
1319
|
-
|
|
1320
|
-
export declare function stringSplit(str: any, seperator: string): string[];
|
|
1321
|
-
|
|
1322
|
-
export declare function stringToKebabCase(str: string): string;
|
|
1323
|
-
|
|
1324
|
-
/**
|
|
1325
|
-
* 字符串内字符个数统计
|
|
1326
|
-
* @param str
|
|
1327
|
-
* @param char
|
|
1328
|
-
* @returns
|
|
1329
|
-
*/
|
|
1330
|
-
export declare function stringWordCount(str: string, word: string): number;
|
|
1331
|
-
|
|
1332
|
-
export declare function substringSimilarity(a: string, b: string): 0 | 1;
|
|
1333
|
-
|
|
1334
|
-
export declare function subtract(arr: any[], options?: {
|
|
1335
|
-
replaceNaNItem?: number;
|
|
1336
|
-
replaceNaNResult?: number;
|
|
1337
|
-
}): number;
|
|
1338
|
-
|
|
1339
|
-
export declare function sum<T>(arr: T[], opts?: {
|
|
1340
|
-
replaceNaNItem?: number;
|
|
1341
|
-
replaceNaNResult?: number;
|
|
1342
|
-
}): number;
|
|
1343
|
-
|
|
1344
|
-
export declare function sumBy<T>(arr: T[], getter: string | ((item: T) => number), opts?: {
|
|
1345
|
-
replaceNaNItem?: number;
|
|
1346
|
-
replaceNaNResult?: number;
|
|
1347
|
-
}): number;
|
|
1348
|
-
|
|
1349
|
-
export declare function SWITCH(key: any, map: ISwitchMap): any;
|
|
1350
|
-
|
|
1351
|
-
export declare function switchCase(condition: any, cases: Record<any, any>): any;
|
|
1352
|
-
|
|
1353
|
-
export declare function toArray<T>(input: T | T[] | undefined): T[];
|
|
1354
|
-
|
|
1355
|
-
export declare function toDate(value: any, fallback?: Date): Date;
|
|
1356
|
-
|
|
1357
|
-
/**
|
|
1358
|
-
*
|
|
1359
|
-
* @param input
|
|
1360
|
-
* @param format yyyy MM dd HH mm ss
|
|
1361
|
-
* @param fallbackValue
|
|
1362
|
-
* @returns
|
|
1363
|
-
*/
|
|
1364
|
-
export declare function toFormatDate<FV = Date>(input: any, format?: string, fallbackValue?: FV): Date | FV;
|
|
1365
|
-
|
|
1366
|
-
export declare function toFormatUtcDate<FV = Date>(input: any, format?: string, fallbackValue?: FV): Date | FV;
|
|
1367
|
-
|
|
1368
|
-
export declare function toNumber(value: any, opts?: {
|
|
1369
|
-
nanReplace?: number;
|
|
1370
|
-
multiply?: number;
|
|
1371
|
-
}): number;
|
|
1372
|
-
|
|
1373
|
-
export declare function toQueryValue<K extends keyof Mapping>(k: K, value: Nullable<Mapping[K]>): { [k in K]: Nullable<Mapping[k]>; } | undefined;
|
|
1374
|
-
|
|
1375
|
-
export declare function toSafeNumber(value: any, options?: {
|
|
1376
|
-
multiply?: number;
|
|
1377
|
-
}): number;
|
|
1378
|
-
|
|
1379
|
-
export declare function toSafeString(val: unknown): string;
|
|
1380
|
-
|
|
1381
|
-
export declare function toSimplifiedChinese<T>(input: T
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
export
|
|
1387
|
-
|
|
1388
|
-
export declare function
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
export declare function
|
|
1395
|
-
leafField: string;
|
|
1396
|
-
}): T[];
|
|
1397
|
-
|
|
1398
|
-
export declare function
|
|
1399
|
-
leafField: string;
|
|
1400
|
-
}):
|
|
1401
|
-
|
|
1402
|
-
export declare function
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
})
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
leafField: string;
|
|
1418
|
-
}):
|
|
1419
|
-
|
|
1420
|
-
export declare function
|
|
1421
|
-
|
|
1422
|
-
})
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
leafField: string;
|
|
1428
|
-
}):
|
|
1429
|
-
|
|
1430
|
-
export declare function
|
|
1431
|
-
leafField: string;
|
|
1432
|
-
}): any;
|
|
1433
|
-
|
|
1434
|
-
export declare function
|
|
1435
|
-
leafField: string;
|
|
1436
|
-
}): any;
|
|
1437
|
-
|
|
1438
|
-
export declare function
|
|
1439
|
-
leafField: string;
|
|
1440
|
-
}): any;
|
|
1441
|
-
|
|
1442
|
-
export declare function
|
|
1443
|
-
leafField: string;
|
|
1444
|
-
}):
|
|
1445
|
-
|
|
1446
|
-
export declare function
|
|
1447
|
-
|
|
1448
|
-
})
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
export declare function
|
|
1464
|
-
|
|
1465
|
-
export declare function
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
declare
|
|
1475
|
-
|
|
1476
|
-
declare type
|
|
1477
|
-
|
|
1478
|
-
declare type
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
export
|
|
1
|
+
declare interface AbstractTreeNode {
|
|
2
|
+
children?: AbstractTreeNode[];
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
declare interface Action {
|
|
6
|
+
type: string;
|
|
7
|
+
payload?: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export declare function add(...nums: number[]): number;
|
|
11
|
+
|
|
12
|
+
export declare function alwaysResolved(): Promise<void>;
|
|
13
|
+
|
|
14
|
+
export declare function alwaysResolveUndefined(): Promise<unknown>;
|
|
15
|
+
|
|
16
|
+
export declare function alwaysReturn<T>(returnValue: T): () => T;
|
|
17
|
+
|
|
18
|
+
export declare function alwaysReturnEmptyRecord(): {};
|
|
19
|
+
|
|
20
|
+
export declare function alwaysReturnEmptyString(): string;
|
|
21
|
+
|
|
22
|
+
export declare function alwaysReturnFalse(): boolean;
|
|
23
|
+
|
|
24
|
+
export declare function alwaysReturnNullish(): null;
|
|
25
|
+
|
|
26
|
+
export declare function alwaysReturnTrue(): boolean;
|
|
27
|
+
|
|
28
|
+
export declare function arrayAllocateTotal<T extends Record<string, any> = Record<string, any>>(params: {
|
|
29
|
+
list: T[];
|
|
30
|
+
total: number;
|
|
31
|
+
getPortion: (item: T, index: number) => number;
|
|
32
|
+
precision?: number;
|
|
33
|
+
lastPrecision?: number;
|
|
34
|
+
assignment: (portionValue: number, item: T, index: number) => Record<string, any>;
|
|
35
|
+
}): T[];
|
|
36
|
+
|
|
37
|
+
export declare function arrayAppend<T>(source: T[], append: T[] | ((source: T[]) => T[])): T[];
|
|
38
|
+
|
|
39
|
+
export declare function arrayAssign<T>(arr: T[], assign: Record<string, any>, target: number | number[] | ((row: T, rowIndex: number, arr: T[]) => boolean)): T[];
|
|
40
|
+
|
|
41
|
+
export declare function arrayDiff(arr1: any[], arr2: any[]): any[];
|
|
42
|
+
|
|
43
|
+
export declare function arrayDistinct<T = any>(arr: T[], callback?: (item: T) => any): T[];
|
|
44
|
+
|
|
45
|
+
export declare function arrayDuplicateMerge(arr: any[], callback?: (item: any) => any): [any, {
|
|
46
|
+
index: number;
|
|
47
|
+
item: any;
|
|
48
|
+
}[]][];
|
|
49
|
+
|
|
50
|
+
export declare function arrayEvery<T>(arr: T[], callback: (value: T, index: number, array: T[]) => boolean, opts?: {
|
|
51
|
+
emptyResult?: boolean;
|
|
52
|
+
}): boolean;
|
|
53
|
+
|
|
54
|
+
export declare function arrayExcludeIndexes<T>(arr: T[], indexes: number[]): any[];
|
|
55
|
+
|
|
56
|
+
export declare function arrayExcludeLastNumber<T = any>(arr: T[], number: number): T[];
|
|
57
|
+
|
|
58
|
+
export declare function arrayFilter<T = any>(arr: T[], callback: (value: T, index: number, array: T[]) => boolean): T[];
|
|
59
|
+
|
|
60
|
+
export declare function arrayFind<T = any>(arr: T[], callback: (record: T, index: number, arr: T[]) => boolean, defaultValue?: T): T | null;
|
|
61
|
+
|
|
62
|
+
/** 返回连续值得索引列表 */
|
|
63
|
+
export declare function arrayFindChainIndexes<T>(arr: T[], callback: (item: T) => boolean | null | undefined, { fromIndex, endIndex, fallbackValue, }?: {
|
|
64
|
+
fromIndex?: number;
|
|
65
|
+
endIndex?: number;
|
|
66
|
+
fallbackValue?: number[];
|
|
67
|
+
}): number[];
|
|
68
|
+
|
|
69
|
+
/** 返回连续值得索引列表 */
|
|
70
|
+
export declare function arrayFindChainIndexesRight<T>(arr: T[], callback: (item: T) => boolean | null | undefined, { fromIndex, endIndex, fallbackValue, }?: {
|
|
71
|
+
fromIndex?: number;
|
|
72
|
+
endIndex?: number;
|
|
73
|
+
fallbackValue?: number[];
|
|
74
|
+
}): number[];
|
|
75
|
+
|
|
76
|
+
export declare function arrayFindIndex<T>(arr: T[], callback: (record: T, index: number, arr: T[]) => boolean, { fromIndex, endIndex, fallbackValue, }?: {
|
|
77
|
+
fromIndex?: number;
|
|
78
|
+
endIndex?: number;
|
|
79
|
+
fallbackValue?: number;
|
|
80
|
+
}): number;
|
|
81
|
+
|
|
82
|
+
export declare function arrayFindIndexRight<T>(arr: T[], callback: (record: T, index: number, arr: T[]) => boolean, { fromIndex, endIndex, fallbackValue, }?: {
|
|
83
|
+
fromIndex?: number;
|
|
84
|
+
endIndex?: number;
|
|
85
|
+
fallbackValue?: number;
|
|
86
|
+
}): number;
|
|
87
|
+
|
|
88
|
+
export declare function arrayFindSame<T>(arr: T[], callback?: (item: T) => any): any[];
|
|
89
|
+
|
|
90
|
+
export declare function arrayFlatMap<T, U>(array: T[], callback: (value: T, index: number, array: T[]) => U[]): U[];
|
|
91
|
+
|
|
92
|
+
export declare function arrayForEach<T>(arr: T[], callback: (record: T, index: number, arr: T[]) => void, opts?: {
|
|
93
|
+
direction?: 'left' | 'right';
|
|
94
|
+
}): void;
|
|
95
|
+
|
|
96
|
+
export declare function arrayGroup<T>(arr: T[], groupKey: (record: T) => any): T[][];
|
|
97
|
+
|
|
98
|
+
export declare function arrayGroupMap<T>(arr: T[], groupKey: (record: T) => any): Map<any, T[]>;
|
|
99
|
+
|
|
100
|
+
export declare function arrayHas<T = any>(arr: T[], callback: (record: T, index: number, arr: T[]) => boolean): boolean;
|
|
101
|
+
|
|
102
|
+
export declare function arrayIncludeIndexes<T>(arr: T[], indexes: number[]): any[];
|
|
103
|
+
|
|
104
|
+
export declare function arrayIncludes(arr: any[], item: any): boolean;
|
|
105
|
+
|
|
106
|
+
export declare function arrayInsert<T>(source: T[], index: number, item: T): T[];
|
|
107
|
+
|
|
108
|
+
export declare function arrayInsertInterval<T>(arr: T[], element: T | ((index: number) => T), interval?: number): T[];
|
|
109
|
+
|
|
110
|
+
export declare function arrayIsDuplicate(arr: any[], callback?: (item: any) => any): boolean;
|
|
111
|
+
|
|
112
|
+
export declare function arrayItemCount<T>(arr: T[]): [T, number][];
|
|
113
|
+
|
|
114
|
+
export declare function arrayIteMove<T>(arr: T[], fromIndex: number, toIndex: number): T[];
|
|
115
|
+
|
|
116
|
+
export declare function arrayJoin<T>(arr: T[], separator: string, map?: (item: T) => any): string;
|
|
117
|
+
|
|
118
|
+
export declare function arrayLastIndex<T>(arr: T[]): number;
|
|
119
|
+
|
|
120
|
+
export declare function arrayLastItem<T>(arr: T[]): T;
|
|
121
|
+
|
|
122
|
+
export declare function arrayLastPick<T = any>(arr: T[], num?: number): any[];
|
|
123
|
+
|
|
124
|
+
export declare function arrayMap<T = any, R = any>(arr: T[], callback: (record: T, index: number, arr: T[]) => R): R[];
|
|
125
|
+
|
|
126
|
+
export declare function arrayMapToObject(arr: any[], fieldFn: (arrItem: any) => string, valueFn: (arrItem: any) => any, option?: {
|
|
127
|
+
chain?: boolean;
|
|
128
|
+
fieldPrefix?: string;
|
|
129
|
+
}): Record<string, any>;
|
|
130
|
+
|
|
131
|
+
export declare function arrayMerge(...arrs: any[]): any[];
|
|
132
|
+
|
|
133
|
+
export declare function arrayNotIn(arr: any[], diffArr: any[], callback: (arrItem: any, diffArrItem: any) => boolean): any[];
|
|
134
|
+
|
|
135
|
+
export declare function arrayObjectFieldNotEmptySame<T extends Record<string, any>>(input: T[], field: string, opts?: {
|
|
136
|
+
whenEmptyResult?: boolean;
|
|
137
|
+
}): boolean;
|
|
138
|
+
|
|
139
|
+
export declare function arrayObjectFieldSame<T extends Record<string, any>>(input: T[], field: string, opts?: {
|
|
140
|
+
whenEmptyResult?: boolean;
|
|
141
|
+
}): boolean;
|
|
142
|
+
|
|
143
|
+
export declare function arrayObjectMultiSort(arr: Record<string, any>[], conditions: {
|
|
144
|
+
prop: string;
|
|
145
|
+
order?: 'asc' | 'desc';
|
|
146
|
+
}[]): Record<string, any>[];
|
|
147
|
+
|
|
148
|
+
export declare function arrayPickLast<T = any>(arr: T[]): T | null;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* 根据优先级排序, 未给出优先级的尽量按原位置排序
|
|
152
|
+
* @param arr
|
|
153
|
+
* @param priorityFn
|
|
154
|
+
* @returns
|
|
155
|
+
*/
|
|
156
|
+
export declare function arrayPrioritySort<T>(arr: T[], priorityFn: (item: T) => number | null | undefined): T[];
|
|
157
|
+
|
|
158
|
+
export declare function arrayReduce<T = any, R = any>(arr: T[], callback: (result: R, currentValue: T, currentIndex: number, arr: T[]) => R, initialValue: R): R;
|
|
159
|
+
|
|
160
|
+
export declare function arraySlice<T>(arr: T[], start?: number, end?: number): T[];
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
*
|
|
164
|
+
* @param arr
|
|
165
|
+
* @param callback
|
|
166
|
+
* @param opts's emptyResult 默认为false
|
|
167
|
+
* @returns
|
|
168
|
+
*/
|
|
169
|
+
export declare function arraySome<T>(arr: T[], callback: (value: T, index: number, array: T[]) => boolean, opts?: {
|
|
170
|
+
emptyResult?: boolean;
|
|
171
|
+
}): boolean;
|
|
172
|
+
|
|
173
|
+
export declare function arraySort<T>(array: T[], sortCondition: SortCondition<T>): T[];
|
|
174
|
+
|
|
175
|
+
export declare function arraysZip<T, R>(callback: (...args: T[]) => R, ...arrays: T[][]): R[];
|
|
176
|
+
|
|
177
|
+
export declare function arrayToBetween<T = any>(arr: T[], left: (itme: T) => boolean, right: (itme: T) => boolean): T[];
|
|
178
|
+
|
|
179
|
+
export declare function arrayToMap<T, K, V = T>(arr: T[], key: (record: T, index: number, arr: T[]) => K, value?: (record: T, index: number, arr: T[]) => V): Map<K, V>;
|
|
180
|
+
|
|
181
|
+
export declare function arrayToObject<T = any>(arr: any[], keyGetter: string | ((item: T) => string), valueGetter: string | ((item: T) => any), opts?: {
|
|
182
|
+
keyChain?: boolean;
|
|
183
|
+
}): Record<any, any>;
|
|
184
|
+
|
|
185
|
+
export declare function arrayToShallowObject<T = any>(arr: any[], keyFn: (item: T) => string, valueFn: (item: T) => any): Record<any, any>;
|
|
186
|
+
|
|
187
|
+
export declare function buildURL({ baseURL, url, params, }: {
|
|
188
|
+
baseURL?: string;
|
|
189
|
+
url: string;
|
|
190
|
+
params: Record<string, any>;
|
|
191
|
+
}): string;
|
|
192
|
+
|
|
193
|
+
export declare function cacheDelete(key: string): void;
|
|
194
|
+
|
|
195
|
+
export declare function cacheGet<T = any>(key: string): T | null;
|
|
196
|
+
|
|
197
|
+
export declare function cacheSet(key: string, val: any): void;
|
|
198
|
+
|
|
199
|
+
export declare function calcAdaptivePoint(width: number): "3xl" | "2xl" | "xl" | "lg" | "md" | "sm" | "xs";
|
|
200
|
+
|
|
201
|
+
export declare function calcGridRegionBoundaryPoints<X extends string, Y extends string, T extends Point_3<X, Y>>(points: T[], xField: X, yField: Y, cellSize?: number): T[];
|
|
202
|
+
|
|
203
|
+
export declare function calcGridRegionBoundarySegments<X extends string, Y extends string, T extends Point_2<X, Y>>(points: T[], xField: X, yField: Y, cell?: number): [T, T][];
|
|
204
|
+
|
|
205
|
+
export declare function calcMartixRange<X extends string, Y extends string, T extends Point_4<X, Y>>(points: T[], xField: X, yField: Y): {
|
|
206
|
+
xSize: number;
|
|
207
|
+
ySize: number;
|
|
208
|
+
minX: number;
|
|
209
|
+
maxX: number;
|
|
210
|
+
minY: number;
|
|
211
|
+
maxY: number;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export declare function calcNumberDiffRate(number1: number, number2: number): number;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* 计算内存占用大小
|
|
218
|
+
* @param value
|
|
219
|
+
* @param unit
|
|
220
|
+
* @returns
|
|
221
|
+
*/
|
|
222
|
+
export declare function calculateMemory(value: unknown, unit?: 'B' | 'KB' | 'MB'): string;
|
|
223
|
+
|
|
224
|
+
declare type Callable<T> = T | (() => T);
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* 可执行函数执行, 非函数直接返回
|
|
228
|
+
* @param fn
|
|
229
|
+
* @param params
|
|
230
|
+
* @returns
|
|
231
|
+
*/
|
|
232
|
+
export declare function callable<T, P extends any[]>(fn: T | ((...params: P) => T), ...params: P): T;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* 中文大写金额转换
|
|
236
|
+
* @param input
|
|
237
|
+
* @returns
|
|
238
|
+
*/
|
|
239
|
+
export declare function capitalizedAmount(input: number | string): any;
|
|
240
|
+
|
|
241
|
+
declare type CaseKey = string | number | symbol;
|
|
242
|
+
|
|
243
|
+
export declare function classNameExcludes(className: string, excludes: string[]): string;
|
|
244
|
+
|
|
245
|
+
export declare function classNames(...items: (string | undefined | null | Record<string, any>)[]): string;
|
|
246
|
+
|
|
247
|
+
export declare function clone<T = any>(value: T): T;
|
|
248
|
+
|
|
249
|
+
export declare function cloneDeep<T>(obj: T): T;
|
|
250
|
+
|
|
251
|
+
export declare function cloneShallow<T>(obj: T): T;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* 推导 coalesce 返回值类型:
|
|
255
|
+
* - 如果为空参数列表,返回 null;
|
|
256
|
+
* - 否则返回所有 thunk 解析后的非 nullish 联合类型或 null。
|
|
257
|
+
*/
|
|
258
|
+
declare type CoalesceReturn<T extends readonly MaybeThunk<any>[]> = T extends [] ? undefined : Exclude<ReturnType<T[number]> | T[number], null | undefined> | undefined;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* 推导 coalesce 返回值类型:
|
|
262
|
+
* - 如果为空参数列表,返回 null;
|
|
263
|
+
* - 否则返回所有 thunk 解析后的非 nullish 联合类型或 null。
|
|
264
|
+
*/
|
|
265
|
+
declare type CoalesceReturn_2<T extends readonly MaybeThunk_2<any>[]> = T extends [] ? undefined : Exclude<ReturnType<T[number]> | T[number], null | undefined> | undefined;
|
|
266
|
+
|
|
267
|
+
declare interface CommonEvent {
|
|
268
|
+
type: 'mousedown' | 'mouseup' | 'click';
|
|
269
|
+
bubbles?: boolean;
|
|
270
|
+
cancelable?: boolean;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
declare interface CommonEvent_2 {
|
|
274
|
+
type: 'mousedown' | 'mouseup' | 'click';
|
|
275
|
+
bubbles?: boolean;
|
|
276
|
+
cancelable?: boolean;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export declare function compareSetDifference<T>(setA: Set<T>, setB: Set<T>): Set<T>;
|
|
280
|
+
|
|
281
|
+
declare type ConfigStore = Record<string, any>;
|
|
282
|
+
|
|
283
|
+
export declare function convertWeightUnitToStandard(chineseWeight: string): string;
|
|
284
|
+
|
|
285
|
+
export declare function coordinateBetween(p1: Point, p2: Point): Point[];
|
|
286
|
+
|
|
287
|
+
export declare function createArray<T = any>(amount: number, fill?: T | (() => T)): T[];
|
|
288
|
+
|
|
289
|
+
export declare function createDelayResizeObserver(element: Element, callback: (rect: DOMRectReadOnly) => void): ResizeObserver;
|
|
290
|
+
|
|
291
|
+
export declare function createFormData<T extends Record<string, any>>(initial: T): FormData;
|
|
292
|
+
|
|
293
|
+
export declare function createHtmlElement(tag: string, opts?: {
|
|
294
|
+
id?: string;
|
|
295
|
+
classList?: string[];
|
|
296
|
+
className: string;
|
|
297
|
+
}): HTMLElement;
|
|
298
|
+
|
|
299
|
+
export declare function createHtmlElementByTemplate(template: string): HTMLElement;
|
|
300
|
+
|
|
301
|
+
export declare function createReducerStore<T, A extends Action>(reducer: Reducer<T, A>, initialState: T): StoreResult<T, A>;
|
|
302
|
+
|
|
303
|
+
export declare function createResizeObserver(element: Element, callback: (rect: DOMRectReadOnly) => void): ResizeObserver;
|
|
304
|
+
|
|
305
|
+
export declare function createStateStore<T>(initialState: T): {
|
|
306
|
+
getStore: () => T;
|
|
307
|
+
setStore: (next: T | NextFunction<T>) => void;
|
|
308
|
+
subscribeStore: (listener: (state: T) => void) => () => void;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* 时间格式化
|
|
313
|
+
* @param time
|
|
314
|
+
* @param format
|
|
315
|
+
* @returns
|
|
316
|
+
*/
|
|
317
|
+
export declare function dateFormatter<T>(time: T, format?: string, defaultValue?: string): string;
|
|
318
|
+
|
|
319
|
+
export declare function dateMonthFormatter<T = unknown>(value: T, defaultValue?: string): string;
|
|
320
|
+
|
|
321
|
+
export declare function dateTimeFormatter<T = unknown>(value: T, defaultValue?: string): string;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* 函数去抖,也就是说当调用动作n毫秒后,才会执行该动作,若在这n毫秒内又调用此动作则将重新计算执行时间。
|
|
325
|
+
*
|
|
326
|
+
* @param {Function} func 需要去抖的函数.
|
|
327
|
+
* @param {number} [wait] 延迟执行的时间.
|
|
328
|
+
* @param {object} [options] 选项对象.
|
|
329
|
+
* @param {boolean} [options.leading] 指定是否在超时前调用.
|
|
330
|
+
* @param {number} [options.maxWait] func延迟调用的最大时间.
|
|
331
|
+
* @param {boolean} [options.trailing] 指定是否在超时后调用.
|
|
332
|
+
* @returns {Function} 返回去抖之后的函数.
|
|
333
|
+
*
|
|
334
|
+
*/
|
|
335
|
+
export declare function debounce<T extends (...args: any) => any>(func: T, wait?: number, options?: {
|
|
336
|
+
leading?: boolean | undefined;
|
|
337
|
+
maxWait?: number | undefined;
|
|
338
|
+
trailing?: boolean | undefined;
|
|
339
|
+
}): DebouncedFunc<T>;
|
|
340
|
+
|
|
341
|
+
declare interface DebouncedFunc<T extends (...args: any[]) => any> {
|
|
342
|
+
(...args: Parameters<T>): ReturnType<T> | undefined;
|
|
343
|
+
cancel: () => void;
|
|
344
|
+
flush: () => ReturnType<T> | undefined;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* XOR 解密(稳定输出原始内容)
|
|
349
|
+
* @param {string} encrypted - Base64 加密字符串
|
|
350
|
+
* @param {string} pwd - 密码
|
|
351
|
+
* @returns {string} 解密后的原始字符串
|
|
352
|
+
*/
|
|
353
|
+
export declare function decrypt(encrypted: string, pwd: string): string;
|
|
354
|
+
|
|
355
|
+
export declare function deepAssign<T = unknown>(target: T, assignment: Record<string, unknown>): T;
|
|
356
|
+
|
|
357
|
+
export declare function deepClone<T = any>(value: T): T;
|
|
358
|
+
|
|
359
|
+
export declare function deepCloneAssign<T>(from: T, assignment: Record<string, any>): T;
|
|
360
|
+
|
|
361
|
+
export declare function deepGet<T = any>(from: any, selector: string | null | undefined, defaultValue: T): T;
|
|
362
|
+
|
|
363
|
+
export declare function deepMultiSet<T = unknown>(target: T, assignment: Record<string, unknown>): T;
|
|
364
|
+
|
|
365
|
+
export declare function deepSet(obj: any, path: string | Array<string | number>, value: any): void;
|
|
366
|
+
|
|
367
|
+
export declare function deferMicrotask(func: VoidFunction): void;
|
|
368
|
+
|
|
369
|
+
export declare const deleteConfigStoreAtKey: (key: string) => void;
|
|
370
|
+
|
|
371
|
+
export declare function dispatchNodeEvent<T = any>(el: T, e: CommonEvent | SpecialEvent): Promise<T>;
|
|
372
|
+
|
|
373
|
+
export declare function dispatchNodeEvents<T = any>(el: T, events: (CommonEvent_2 | SpecialEvent_2)[]): Promise<T>;
|
|
374
|
+
|
|
375
|
+
export declare function distanceSimilarity(a: string, b: string): number;
|
|
376
|
+
|
|
377
|
+
export declare function divide(items: any[], options?: {
|
|
378
|
+
replaceNaNItem?: number;
|
|
379
|
+
replaceNaNResult?: number;
|
|
380
|
+
}): number;
|
|
381
|
+
|
|
382
|
+
export declare function divideBy(record: Record<string, any>, fields: any[], options?: {
|
|
383
|
+
replaceNaNItem?: number;
|
|
384
|
+
replaceNaNResult?: number;
|
|
385
|
+
}): number;
|
|
386
|
+
|
|
387
|
+
export declare function domAddClassNames(element: Element, ...classNames: string[]): void;
|
|
388
|
+
|
|
389
|
+
export declare function domContains(container: any, element: any): boolean;
|
|
390
|
+
|
|
391
|
+
export declare function domRemoveClassNames(element: HTMLElement, ...classNames: string[]): void;
|
|
392
|
+
|
|
393
|
+
export declare function downloadBuffer(fileName: string, buffer: ArrayBuffer): void;
|
|
394
|
+
|
|
395
|
+
declare function downloadBuffer_2({ fileName, buffer }: {
|
|
396
|
+
fileName: string;
|
|
397
|
+
buffer: ArrayBuffer;
|
|
398
|
+
}): void;
|
|
399
|
+
|
|
400
|
+
export declare function downloadFile(file: File): void;
|
|
401
|
+
|
|
402
|
+
export declare function downloadURL(url: string, fallbackName: string): void;
|
|
403
|
+
|
|
404
|
+
declare function downloadURL_2({ url, fileName, fallbackFileName, }: {
|
|
405
|
+
url: string;
|
|
406
|
+
fileName?: string;
|
|
407
|
+
fallbackFileName: string;
|
|
408
|
+
}): void;
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* 返回第一个非 null 或 undefined 的值(支持直接值和函数懒求值)
|
|
412
|
+
*/
|
|
413
|
+
export declare function emptyCoalesce<T extends readonly MaybeThunk_2<any>[]>(...items: T): CoalesceReturn_2<T>;
|
|
414
|
+
|
|
415
|
+
export declare function emptyCoalescing(...params: any[]): any;
|
|
416
|
+
|
|
417
|
+
export declare function emptyFunction(): void;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* XOR 加密(支持 Unicode,解密稳定)
|
|
421
|
+
* @param {string} input - 要加密的字符串
|
|
422
|
+
* @param {string} pwd - 密码
|
|
423
|
+
* @returns {string} Base64 加密结果
|
|
424
|
+
*/
|
|
425
|
+
export declare function encrypt(input: string, pwd: string): string;
|
|
426
|
+
|
|
427
|
+
declare type EnsureArray<T> = T extends any[] ? T : T extends null | undefined ? [] : T[];
|
|
428
|
+
|
|
429
|
+
export declare function ensureArray(arr: any, defaultArr?: any[]): any[];
|
|
430
|
+
|
|
431
|
+
export declare function ensureArrayJoin(input: unknown, separator?: string): string;
|
|
432
|
+
|
|
433
|
+
export declare function ensureFunction<T extends (...args: any[]) => unknown>(input?: T | unknown): T;
|
|
434
|
+
|
|
435
|
+
export declare function ensureGetDateYear(value: any, defaultValue: number): number;
|
|
436
|
+
|
|
437
|
+
export declare function ensureInteger(value: any, defaultValue: number): number;
|
|
438
|
+
|
|
439
|
+
export declare function ensureMap<K, V>(map: any, fallback?: Map<K, V>): Map<K, V> | Map<any, any>;
|
|
440
|
+
|
|
441
|
+
export declare function ensureNotEmptyArray(arr: any, defaultArr: any[]): any[];
|
|
442
|
+
|
|
443
|
+
export declare function ensureNumber(value: any, defaultValue: number): number;
|
|
444
|
+
|
|
445
|
+
export declare function ensureObject(input: any, fallback?: Record<string, any>): Record<string, any>;
|
|
446
|
+
|
|
447
|
+
export declare function ensureString(value: any, fallback?: string): string;
|
|
448
|
+
|
|
449
|
+
export declare function ensureStringSplitArray<T>(input: unknown, separator: string): T[];
|
|
450
|
+
|
|
451
|
+
export declare function ensureZero(value: number, defaultValue: number): number;
|
|
452
|
+
|
|
453
|
+
export declare function escapeRegExp(str: string): string;
|
|
454
|
+
|
|
455
|
+
export declare function evaluateMathExpression(expression: string, variables: Record<string, any>, opts?: {
|
|
456
|
+
fallbackValue: number;
|
|
457
|
+
termFallbackValue: number;
|
|
458
|
+
precision?: number;
|
|
459
|
+
} | number): number;
|
|
460
|
+
|
|
461
|
+
export declare function exchangeRateFormatter<T = unknown>(value: T, opts?: {
|
|
462
|
+
thousandth?: boolean;
|
|
463
|
+
}): string;
|
|
464
|
+
|
|
465
|
+
export declare function execFunc(func: Function): any;
|
|
466
|
+
|
|
467
|
+
export declare function executePromises<T extends any[]>(promises: [...Array<Promise<T[number]>>]): Promise<T>;
|
|
468
|
+
|
|
469
|
+
declare function exportFile({ fileName, fallbackFileName, file, }: {
|
|
470
|
+
file: File;
|
|
471
|
+
fileName?: string;
|
|
472
|
+
fallbackFileName: string;
|
|
473
|
+
}): void;
|
|
474
|
+
|
|
475
|
+
declare function exportJson({ fileName, data }: {
|
|
476
|
+
fileName: string;
|
|
477
|
+
data: any;
|
|
478
|
+
}): void;
|
|
479
|
+
|
|
480
|
+
export declare function extractMapKeys<K, V>(map: Map<K, V>): K[];
|
|
481
|
+
|
|
482
|
+
export declare function extractMapValues<K, V>(map: Map<K, V>): V[];
|
|
483
|
+
|
|
484
|
+
export declare function extractWeightInfo(input: string): {
|
|
485
|
+
value: string;
|
|
486
|
+
unit: string;
|
|
487
|
+
quantity: number;
|
|
488
|
+
} | null;
|
|
489
|
+
|
|
490
|
+
export declare function extractWeightInfoToKg(spec: string): number | null;
|
|
491
|
+
|
|
492
|
+
export declare function findDOMDataBubble<T extends string>(start: any, dataKey: string, end?: any): T | undefined;
|
|
493
|
+
|
|
494
|
+
export declare function findHtmlElementById(id: string, defaultValue?: HTMLElement): HTMLElement | null;
|
|
495
|
+
|
|
496
|
+
export declare function findHtmlElementUpward(start: Element | null, callback: (element: Element) => boolean, defaultElement?: Element): Element | null;
|
|
497
|
+
|
|
498
|
+
export declare function findNodeClosest(from: HTMLElement | null | undefined, callback: (node: HTMLElement) => boolean, end?: HTMLElement | null | undefined): HTMLElement | null;
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* 将扁平数组转换成树结构
|
|
502
|
+
* @param list 扁平数组
|
|
503
|
+
* @param options 树解析map
|
|
504
|
+
* @returns
|
|
505
|
+
*/
|
|
506
|
+
export declare function flatArrayToTree(list?: any[], options?: {
|
|
507
|
+
keyField: string;
|
|
508
|
+
childField: string;
|
|
509
|
+
parentField: string;
|
|
510
|
+
}): any[];
|
|
511
|
+
|
|
512
|
+
export declare function functionWrap<T extends (...args: any[]) => any>(input: T, ...params: Parameters<T>): () => ReturnType<T>;
|
|
513
|
+
|
|
514
|
+
export declare function functionWrapable<T extends (...args: any[]) => any>(input: T | null | undefined, ...params: Parameters<T>): (() => ReturnType<T>) | undefined;
|
|
515
|
+
|
|
516
|
+
export declare function functionWrapable(input: unknown): undefined;
|
|
517
|
+
|
|
518
|
+
declare function get<T>(key: string | symbol): T | undefined;
|
|
519
|
+
|
|
520
|
+
declare function get<T>(key: string | symbol, fallbackValue: T): T;
|
|
521
|
+
|
|
522
|
+
export declare function getAllLocalStorage(): Record<string, any>;
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* 生成赋值数据
|
|
526
|
+
* @param assign
|
|
527
|
+
* @param target
|
|
528
|
+
* @returns
|
|
529
|
+
*/
|
|
530
|
+
export declare function getAssignData(assign: Record<string, string>, target: Record<string, any>): Record<string, any>;
|
|
531
|
+
|
|
532
|
+
export declare function getBrowserEnv(): "webview" | "mobile" | "desktop";
|
|
533
|
+
|
|
534
|
+
export declare function getClosestInteger(val: number): number;
|
|
535
|
+
|
|
536
|
+
export declare const getConfigStoreAtKey: <V = any>(key: string) => V | undefined;
|
|
537
|
+
|
|
538
|
+
export declare function getCurrentDate(): Date;
|
|
539
|
+
|
|
540
|
+
export declare function getDateDay(value: any, defaultValue?: number): number;
|
|
541
|
+
|
|
542
|
+
export declare function getDateLastDay(value: any, defaultValue?: number): number;
|
|
543
|
+
|
|
544
|
+
export declare function getDateMonth(value: any, defaultValue?: number): number;
|
|
545
|
+
|
|
546
|
+
export declare function getDateMonthEndDate(value: any, defaultValue?: Date): Date;
|
|
547
|
+
|
|
548
|
+
export declare function getDateMonthStartDate(value: any, defaultValue?: Date): Date;
|
|
549
|
+
|
|
550
|
+
export declare function getDateTimestamp(value: any, defaultValue: number): number;
|
|
551
|
+
|
|
552
|
+
export declare function getDateWeekday(value: any, defaultValue?: number): number;
|
|
553
|
+
|
|
554
|
+
export declare function getDateYear(value: any, defaultValue?: number): number;
|
|
555
|
+
|
|
556
|
+
export declare function getDateZeroTimeZoneTime(value: any): number;
|
|
557
|
+
|
|
558
|
+
export declare function getDayEndTimestamp(value: any, defaultValue?: number): number;
|
|
559
|
+
|
|
560
|
+
export declare function getDayStartTimestamp(value: any, defaultValue?: number): number;
|
|
561
|
+
|
|
562
|
+
export declare function getDOMRect(element: any): DOMRect | null;
|
|
563
|
+
|
|
564
|
+
export declare function getFileType(fileName: string): string;
|
|
565
|
+
|
|
566
|
+
export declare function getFileTypeFromPath(path: string): {
|
|
567
|
+
ext: null;
|
|
568
|
+
mime: null;
|
|
569
|
+
} | {
|
|
570
|
+
ext: string;
|
|
571
|
+
mime: string;
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* 根据占比调整 HEX 颜色的亮度(通过 HSL)
|
|
576
|
+
* @param hexColor 十六进制颜色(如 "#4CAF50")
|
|
577
|
+
* @param percentage 占比(0~1,0=最亮,1=最暗)
|
|
578
|
+
* @returns 调整后的 HEX 颜色
|
|
579
|
+
*/
|
|
580
|
+
export declare function getHexPercentColor(hexColor: string, percentage: number): string;
|
|
581
|
+
|
|
582
|
+
export declare function getMonthEndTimestamp(value: any, defaultValue: number): number;
|
|
583
|
+
|
|
584
|
+
export declare function getMonthStartTimestamp(value: any, defaultValue: number): number;
|
|
585
|
+
|
|
586
|
+
export declare function getNextMonthDate(value: any, defaultValue?: Date): Date;
|
|
587
|
+
|
|
588
|
+
export declare function getNextYearDate(value: any, defaultValue?: Date): Date;
|
|
589
|
+
|
|
590
|
+
export declare function getNumberPrecision(value: any): number;
|
|
591
|
+
|
|
592
|
+
export declare function getNumberStandardString(value: any): string;
|
|
593
|
+
|
|
594
|
+
export declare function getObjectEntries<T extends Record<string, any>>(obj: T): [string, any][];
|
|
595
|
+
|
|
596
|
+
export declare function getObjectUID(key: Record<string, any>): any;
|
|
597
|
+
|
|
598
|
+
export declare function getOffsetDaysDate(input: any, days: number, fallbackDate?: Date): Date;
|
|
599
|
+
|
|
600
|
+
export declare function getOffsetMonthsDate(input: any, months: number, fallbackDate?: Date): Date;
|
|
601
|
+
|
|
602
|
+
export declare function getOffsetYearsDate(input: any, years: number, fallbackDate?: Date): Date;
|
|
603
|
+
|
|
604
|
+
export declare function getPercentRGB(rgb: [number, number, number], percentage: number, darken?: boolean): number[];
|
|
605
|
+
|
|
606
|
+
export declare function getPrevMonthDate(value: any, defaultValue?: Date): Date;
|
|
607
|
+
|
|
608
|
+
export declare function getPrevYearDate(value: any, defaultValue?: Date): Date;
|
|
609
|
+
|
|
610
|
+
export declare function getRangeDateMonthSegments([startDate, endDate]: [Date, Date], opts?: {
|
|
611
|
+
hasYear?: boolean;
|
|
612
|
+
}): string[];
|
|
613
|
+
|
|
614
|
+
export declare function getRangeDateYearSegments([startDate, endDate]: [Date, Date]): string[];
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* 在两个 HEX 颜色之间平滑过渡
|
|
618
|
+
* @param startHex 起始颜色(如 "#FF0000")
|
|
619
|
+
* @param endHex 结束颜色(如 "#00FF00")
|
|
620
|
+
* @param percent 过渡比例(0~1,0=起始色,1=结束色)
|
|
621
|
+
* @returns 过渡后的 HEX 颜色
|
|
622
|
+
*/
|
|
623
|
+
export declare function getRangeHexPercentColor(startHex: string, endHex: string, percent: number): string;
|
|
624
|
+
|
|
625
|
+
export declare function getToday(): Date;
|
|
626
|
+
|
|
627
|
+
export declare function getTodayEndTimestamp(): number;
|
|
628
|
+
|
|
629
|
+
export declare function getTodayStartTimestamp(): number;
|
|
630
|
+
|
|
631
|
+
export declare function getYearEndTimestamp(input: any): number | null;
|
|
632
|
+
|
|
633
|
+
export declare function getYearStartTimestamp(input: any): number | null;
|
|
634
|
+
|
|
635
|
+
export declare const h5: {
|
|
636
|
+
downloadBuffer: typeof downloadBuffer_2;
|
|
637
|
+
downloadURL: typeof downloadURL_2;
|
|
638
|
+
exportFile: typeof exportFile;
|
|
639
|
+
exportJson: typeof exportJson;
|
|
640
|
+
readJsonFile: typeof readJsonFile;
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
export declare function hexToArgb(hexColor: string): string;
|
|
644
|
+
|
|
645
|
+
export declare function hexToRgba(ahex: string, inpuyAlpha?: number | string): {
|
|
646
|
+
v: string;
|
|
647
|
+
o: {
|
|
648
|
+
r: number;
|
|
649
|
+
g: number;
|
|
650
|
+
b: number;
|
|
651
|
+
a: number;
|
|
652
|
+
};
|
|
653
|
+
};
|
|
654
|
+
|
|
655
|
+
export declare function htmlElementAppendChild(parentElement: HTMLElement, sonElement: HTMLElement): HTMLElement;
|
|
656
|
+
|
|
657
|
+
export declare function htmlElementHasClassName(element: Element, className: string): boolean;
|
|
658
|
+
|
|
659
|
+
export declare function htmlElementRemoveChild(parentElement: HTMLElement, sonElement: HTMLElement): HTMLElement;
|
|
660
|
+
|
|
661
|
+
declare interface IAbstractTreeNode {
|
|
662
|
+
children?: IAbstractTreeNode[];
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
declare type IBaseValue<T> = T;
|
|
666
|
+
|
|
667
|
+
export declare function IF(condition: any, trueValue: any | (() => any)): any;
|
|
668
|
+
|
|
669
|
+
export declare function IF_ZERO_OR_NAN_REPLACE(input: any, replace: any): any;
|
|
670
|
+
|
|
671
|
+
export declare function IFEL<C, T, F>(condition: C, trueExp: T | ((condition: C) => T), falseExp: F | ((condition: C) => F)): T | F;
|
|
672
|
+
|
|
673
|
+
export declare function ifElse(condition: boolean, trueReturn: any, falseReturn: any): any;
|
|
674
|
+
|
|
675
|
+
export declare function IFEmpty<T = any, K = any>(val: T, elVal: K): T | K;
|
|
676
|
+
|
|
677
|
+
export declare function IFEqualReplace(val: any, equalValue: any, replace: any): any;
|
|
678
|
+
|
|
679
|
+
export declare function IFInvalidDateReplace(date: any, replace: Date): any;
|
|
680
|
+
|
|
681
|
+
export declare function ifNaNReplace(val: any, replace: any): any;
|
|
682
|
+
|
|
683
|
+
declare type IFnValue<T> = (...args: any[]) => T;
|
|
684
|
+
|
|
685
|
+
export declare function ifReplace<T>(val: T, fn: (val: T) => boolean, replace: any): any;
|
|
686
|
+
|
|
687
|
+
export declare function ifReturn<T>(condition: boolean | (() => boolean), val: T): T | undefined;
|
|
688
|
+
|
|
689
|
+
export declare function iif(condition: ValueOrFn<boolean>): {
|
|
690
|
+
then<T>(truthy: ValueOrFn<T>): {
|
|
691
|
+
else(falsy: ValueOrFn<T>): T;
|
|
692
|
+
};
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* @param value 输入值
|
|
697
|
+
* @param thousandth 千分位, 默认 true
|
|
698
|
+
* @param allowNegative 允许负数, 默认 true
|
|
699
|
+
* @param allowDecimal 允许小数, 默认 true
|
|
700
|
+
* @param precision 小数位, 默认 2
|
|
701
|
+
*/
|
|
702
|
+
export declare function inputNumberMask(value: any, options?: {
|
|
703
|
+
thousandth?: boolean;
|
|
704
|
+
allowNegative?: boolean;
|
|
705
|
+
allowDecimal?: boolean;
|
|
706
|
+
precision?: number;
|
|
707
|
+
}): string;
|
|
708
|
+
|
|
709
|
+
export declare function integerFormatter<T = unknown>(value: T, options?: {
|
|
710
|
+
thousandth?: boolean;
|
|
711
|
+
}): string;
|
|
712
|
+
|
|
713
|
+
export declare function invalidDateReplace<T = any>(date: Date, repalce: T): Date | T;
|
|
714
|
+
|
|
715
|
+
export declare function invokeable<T>(value: IValue<T>, args: any[]): T;
|
|
716
|
+
|
|
717
|
+
declare interface IObject {
|
|
718
|
+
[name: string]: any;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
export declare function isArray<T>(arr: T[] | unknown): arr is T[];
|
|
722
|
+
|
|
723
|
+
export declare function isBoolean(value: any): value is boolean;
|
|
724
|
+
|
|
725
|
+
export declare function isChineseChar(input: any): boolean;
|
|
726
|
+
|
|
727
|
+
export declare function isChineseString(input: any): boolean;
|
|
728
|
+
|
|
729
|
+
export declare function isDate(date: any): date is Date;
|
|
730
|
+
|
|
731
|
+
export declare function isDesktopBrowser(): boolean;
|
|
732
|
+
|
|
733
|
+
export declare function isDOM(element: any): any;
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* 判断数据是否为[null, undefind], 数组为空, 字符串为空, 对象为空
|
|
737
|
+
* @param input
|
|
738
|
+
*/
|
|
739
|
+
export declare function isEmpty(input: any): input is VoidLike_2;
|
|
740
|
+
|
|
741
|
+
export declare function isEmptyString(value: any): boolean;
|
|
742
|
+
|
|
743
|
+
export declare function isEqual(x: any, y: any): boolean;
|
|
744
|
+
|
|
745
|
+
export declare function isEqualZero(number: number, digits?: number): boolean;
|
|
746
|
+
|
|
747
|
+
export declare function isEveryVoid(...items: any[]): boolean;
|
|
748
|
+
|
|
749
|
+
export declare function isFalse(val: any): val is false;
|
|
750
|
+
|
|
751
|
+
export declare function isFasly(val: any): val is false;
|
|
752
|
+
|
|
753
|
+
export declare function isFormData(input: any): input is FormData;
|
|
754
|
+
|
|
755
|
+
export declare function isFunction<T extends (...args: any[]) => any>(input: unknown): input is T;
|
|
756
|
+
|
|
757
|
+
export declare function isHtmlElement(input: any): input is HTMLElement;
|
|
758
|
+
|
|
759
|
+
export declare function isHtmlInputElement(input: any): input is HTMLInputElement;
|
|
760
|
+
|
|
761
|
+
export declare function isMobileBrowser(): boolean;
|
|
762
|
+
|
|
763
|
+
export declare function isMoreThanZero(val: any): boolean;
|
|
764
|
+
|
|
765
|
+
export declare function isNodeContains(container: HTMLElement | null | undefined, target?: HTMLElement | null | undefined): boolean;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* 判断数据是否不为[null, undefind], 数组不为空, 字符串不为空, 对象不为空
|
|
769
|
+
* @param input
|
|
770
|
+
*/
|
|
771
|
+
export declare function isNotEmpty(input: any): input is NotVoidLike;
|
|
772
|
+
|
|
773
|
+
export declare function isNotEmptyArray(arr: any): arr is Array<any>;
|
|
774
|
+
|
|
775
|
+
export declare function isNotEmptyString(value: any): value is string;
|
|
776
|
+
|
|
777
|
+
export declare function isNotEqualZero(number: number, digits?: number): boolean;
|
|
778
|
+
|
|
779
|
+
export declare function isNotNullish<T>(value: T | null | undefined): value is T;
|
|
780
|
+
|
|
781
|
+
export declare function isNotPlainObject(val: any): boolean;
|
|
782
|
+
|
|
783
|
+
export declare function isNotUndefined(value: any): boolean;
|
|
784
|
+
|
|
785
|
+
export declare function isNotVoid(input: any): input is NotVoidLike_2;
|
|
786
|
+
|
|
787
|
+
export declare function isNullish<T>(value: T | null | undefined): value is null | undefined;
|
|
788
|
+
|
|
789
|
+
export declare function isNumber(value: any): value is number;
|
|
790
|
+
|
|
791
|
+
export declare function isNumeric(token: string): boolean;
|
|
792
|
+
|
|
793
|
+
export declare function isObject<T extends Record<string, any>>(obj: unknown): obj is T;
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* 判断两个对象是否相等
|
|
797
|
+
*/
|
|
798
|
+
export declare function isObjStructureEqual(obj1: Record<string, any>, obj2: Record<string, any>): boolean;
|
|
799
|
+
|
|
800
|
+
export declare function isPlainObject(val: any): boolean;
|
|
801
|
+
|
|
802
|
+
export declare function isPromise<T>(input: T): input is T extends Promise<any> ? T : never;
|
|
803
|
+
|
|
804
|
+
export declare function isSomeNotVoid(...items: any[]): boolean;
|
|
805
|
+
|
|
806
|
+
export declare function isSomeVoid(...items: any[]): boolean;
|
|
807
|
+
|
|
808
|
+
export declare function isString(value: unknown): value is string;
|
|
809
|
+
|
|
810
|
+
export declare function isTimestamp(input: any): boolean;
|
|
811
|
+
|
|
812
|
+
export declare function isTreeBranch<T extends Record<string, any>>(node: T, opts?: {
|
|
813
|
+
leafField?: string;
|
|
814
|
+
}): boolean;
|
|
815
|
+
|
|
816
|
+
export declare function isTreeLeaf<T extends Record<string, any>>(node: T, opts?: {
|
|
817
|
+
leafField?: string;
|
|
818
|
+
}): boolean;
|
|
819
|
+
|
|
820
|
+
export declare function isTrue(val: any): val is true;
|
|
821
|
+
|
|
822
|
+
export declare function isTruly(val: any): val is true;
|
|
823
|
+
|
|
824
|
+
export declare function isUndefined(value: any): boolean;
|
|
825
|
+
|
|
826
|
+
export declare function isURLSearchParams(input: any): input is URLSearchParams;
|
|
827
|
+
|
|
828
|
+
export declare function isValidDate(input: any): input is Date;
|
|
829
|
+
|
|
830
|
+
export declare function isValidNumber(val: any): boolean;
|
|
831
|
+
|
|
832
|
+
export declare function isVoid(input: any): input is VoidLike;
|
|
833
|
+
|
|
834
|
+
export declare function isWebViewBrowser(): boolean;
|
|
835
|
+
|
|
836
|
+
export declare function isWeixinBrowser(): boolean;
|
|
837
|
+
|
|
838
|
+
declare interface ISwitchMap {
|
|
839
|
+
[field: string]: any | (() => any);
|
|
840
|
+
default?: any | (() => any);
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
declare type IValue<T> = IBaseValue<T> | IFnValue<T>;
|
|
844
|
+
|
|
845
|
+
export declare const jsonParser: {
|
|
846
|
+
FUNC_PREFIX: string;
|
|
847
|
+
REG_PREFIX: string;
|
|
848
|
+
isArrOrObj(obj: any): boolean;
|
|
849
|
+
isArr(obj: any): boolean;
|
|
850
|
+
isObj(obj: any): boolean;
|
|
851
|
+
isRegExp(obj: any): boolean;
|
|
852
|
+
isFunc(obj: any): boolean;
|
|
853
|
+
funcParse(obj: IObject | any[]): any;
|
|
854
|
+
parse(jsonStr: string, error?: ((err: Error | unknown) => Record<string, any>) | undefined): any;
|
|
855
|
+
stringify(obj: any, replacer?: ((key: string, value: any) => any) | undefined, space?: number | string, error?: ((err: Error | unknown) => Record<string, any>) | undefined): string;
|
|
856
|
+
fastStringify(obj: any, space?: number | string, error?: ((err: Error | unknown) => Record<string, any>) | undefined): string;
|
|
857
|
+
nativeStringify: {
|
|
858
|
+
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
859
|
+
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
860
|
+
};
|
|
861
|
+
nativeParse: (text: string, reviver?: ((this: any, key: string, value: any) => any) | undefined) => any;
|
|
862
|
+
};
|
|
863
|
+
|
|
864
|
+
export declare function localStorageDelete(key: string): void;
|
|
865
|
+
|
|
866
|
+
export declare function localStorageGet<T>(key: string): T | null;
|
|
867
|
+
|
|
868
|
+
export declare function localStorageSet(key: string, value: any): void;
|
|
869
|
+
|
|
870
|
+
export declare function makeArray<T>(input: T): EnsureArray<T>;
|
|
871
|
+
|
|
872
|
+
export declare function mapKeys(map: any): any[];
|
|
873
|
+
|
|
874
|
+
declare interface Mapping {
|
|
875
|
+
eq: string | number;
|
|
876
|
+
ne: string | number;
|
|
877
|
+
ge: string | number;
|
|
878
|
+
le: string | number;
|
|
879
|
+
gt: string | number;
|
|
880
|
+
lt: string | number;
|
|
881
|
+
in: (string | number | Record<string, any>)[];
|
|
882
|
+
notIn: (string | number | Record<string, any>)[];
|
|
883
|
+
like: string | number;
|
|
884
|
+
likeRight: string | number;
|
|
885
|
+
likeLeft: string | number;
|
|
886
|
+
between: [string | number, string | number];
|
|
887
|
+
isNull: boolean;
|
|
888
|
+
isEmpty: boolean;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
declare interface Mapping_2 {
|
|
892
|
+
eq?: Nullable_2<string | number>;
|
|
893
|
+
ne?: Nullable_2<string | number>;
|
|
894
|
+
ge?: Nullable_2<string | number>;
|
|
895
|
+
le?: Nullable_2<string | number>;
|
|
896
|
+
gt?: Nullable_2<string | number>;
|
|
897
|
+
lt?: Nullable_2<string | number>;
|
|
898
|
+
in?: Nullable_2<(string | number | Record<string, any>)[]>;
|
|
899
|
+
notIn?: Nullable_2<(string | number | Record<string, any>)[]>;
|
|
900
|
+
like?: Nullable_2<string | number>;
|
|
901
|
+
likeRight?: Nullable_2<string | number>;
|
|
902
|
+
likeLeft?: Nullable_2<string | number>;
|
|
903
|
+
between?: Nullable_2<[string | number, string | number]>;
|
|
904
|
+
isNull?: Nullable_2<boolean>;
|
|
905
|
+
isEmpty?: Nullable_2<boolean>;
|
|
906
|
+
tag?: Nullable_2<string>;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
declare interface MappingReuslt {
|
|
910
|
+
eq?: string | number;
|
|
911
|
+
ne?: string | number;
|
|
912
|
+
ge?: string | number;
|
|
913
|
+
le?: string | number;
|
|
914
|
+
gt?: string | number;
|
|
915
|
+
lt?: string | number;
|
|
916
|
+
in?: (string | number | Record<string, any>)[];
|
|
917
|
+
notIn?: (string | number | Record<string, any>)[];
|
|
918
|
+
like?: string | number;
|
|
919
|
+
likeRight?: string | number;
|
|
920
|
+
likeLeft?: string | number;
|
|
921
|
+
between?: [string | number, string | number];
|
|
922
|
+
isNull?: boolean;
|
|
923
|
+
isEmpty?: boolean;
|
|
924
|
+
tag?: string;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
export declare function match<K extends CaseKey>(key: Callable<K>): MatchBuilder<K, never>;
|
|
928
|
+
|
|
929
|
+
declare type MatchBuilder<K, V> = {
|
|
930
|
+
case: <CK extends CaseKey, CV>(key: Callable<CK> | Callable<CK[]>, value: Callable<CV>) => MatchBuilder<K, V | CV>;
|
|
931
|
+
default: <DV>(value: Callable<DV>) => V | DV;
|
|
932
|
+
};
|
|
933
|
+
|
|
934
|
+
export declare function mathTakeEvaluate(variables: Record<string, any>, expression: string, opts?: {
|
|
935
|
+
fallbackValue: number;
|
|
936
|
+
termFallbackValue: number;
|
|
937
|
+
precision?: number;
|
|
938
|
+
} | number): number;
|
|
939
|
+
|
|
940
|
+
declare type MaybeThunk<T> = T | (() => T);
|
|
941
|
+
|
|
942
|
+
declare type MaybeThunk_2<T> = T | (() => T);
|
|
943
|
+
|
|
944
|
+
export declare const memoStore: {
|
|
945
|
+
get: typeof get;
|
|
946
|
+
set: (key: string | symbol, val: unknown) => void;
|
|
947
|
+
delete: (key: string | symbol) => void;
|
|
948
|
+
};
|
|
949
|
+
|
|
950
|
+
declare type Merge<T extends any[]> = T extends [infer First, ...infer Rest extends any[]] ? First extends object ? Rest extends any[] ? First & Merge<Rest> : First : never : {};
|
|
951
|
+
|
|
952
|
+
export declare function mergeArray(...arrs: any[]): any[];
|
|
953
|
+
|
|
954
|
+
export declare function mergeObject<T extends any[]>(...objectList: T): Merge<T>;
|
|
955
|
+
|
|
956
|
+
export declare function mergeProps<T extends Record<string, any>>(base: T, extra: T): T;
|
|
957
|
+
|
|
958
|
+
export declare function multiply(arr: any[], options?: {
|
|
959
|
+
replaceNaNItem?: number;
|
|
960
|
+
replaceNaNResult?: number;
|
|
961
|
+
}): number;
|
|
962
|
+
|
|
963
|
+
export declare function multiplyBy(val: Record<string, any>, fields: string[], options?: {
|
|
964
|
+
replaceNaNItem?: number;
|
|
965
|
+
replaceNaNResult?: number;
|
|
966
|
+
}): number;
|
|
967
|
+
|
|
968
|
+
declare type NextFunction<T> = (state: T) => T;
|
|
969
|
+
|
|
970
|
+
declare type NotVoidLike = object | Map<any, any> | Set<any> | string | number | boolean;
|
|
971
|
+
|
|
972
|
+
declare type NotVoidLike_2 = object | Map<any, any> | Set<any> | string | number | boolean;
|
|
973
|
+
|
|
974
|
+
declare type Nullable<T> = T | null | undefined;
|
|
975
|
+
|
|
976
|
+
declare type Nullable_2<T> = T | null | undefined;
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* 返回第一个非 null 或 undefined 的值(支持直接值和函数懒求值)
|
|
980
|
+
*/
|
|
981
|
+
export declare function nullishCoalesce<T extends readonly MaybeThunk<any>[]>(...items: T): CoalesceReturn<T>;
|
|
982
|
+
|
|
983
|
+
export declare function numberFormateDecimal(input: any, decimals?: number, opts?: {
|
|
984
|
+
mode: 'round' | 'truncate';
|
|
985
|
+
}): string;
|
|
986
|
+
|
|
987
|
+
export declare function numberFormateThousandth(value: any): string;
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* @param value 需格式化值
|
|
991
|
+
* @param thousandth 千分位, 默认 true
|
|
992
|
+
* @param percent 百分比, 默认 false
|
|
993
|
+
* @param allowRound 四舍五入, 默认 true
|
|
994
|
+
* @param precision 小数位, 默认 2
|
|
995
|
+
* @param precisionPad 小数位填充, 默认 true
|
|
996
|
+
* @param multiply 小数位填充, 默认 1
|
|
997
|
+
*/
|
|
998
|
+
export declare function numberFormatter<T = unknown>(value: T, options?: {
|
|
999
|
+
allowDecimal?: boolean;
|
|
1000
|
+
thousandth?: boolean;
|
|
1001
|
+
percent?: boolean;
|
|
1002
|
+
allowRound?: boolean;
|
|
1003
|
+
precision?: number;
|
|
1004
|
+
precisionPad?: boolean;
|
|
1005
|
+
multiply?: number;
|
|
1006
|
+
}): string;
|
|
1007
|
+
|
|
1008
|
+
/**
|
|
1009
|
+
* 保留指定位数的小数
|
|
1010
|
+
* @param value 原始数字
|
|
1011
|
+
* @param decimals 要保留的小数位数(默认为 2)
|
|
1012
|
+
* @param mode 保留模式:'round' 表示四舍五入,'trunc' 表示直接截取(默认为 'round')
|
|
1013
|
+
*/
|
|
1014
|
+
export declare function numberKeepDecimal(input: any, decimals?: number, opts?: {
|
|
1015
|
+
mode?: 'round' | 'trunc';
|
|
1016
|
+
fallback?: number;
|
|
1017
|
+
}): number;
|
|
1018
|
+
|
|
1019
|
+
export declare function numberRandom(min: number, max: number): number;
|
|
1020
|
+
|
|
1021
|
+
export declare function numberRound(value: any, precision: number): number;
|
|
1022
|
+
|
|
1023
|
+
/**
|
|
1024
|
+
* 将一个数字转换为整数
|
|
1025
|
+
* - 支持四种方法:
|
|
1026
|
+
* - "round"(默认,四舍五入)
|
|
1027
|
+
* - "floor"(向下取整)
|
|
1028
|
+
* - "ceil"(向上取整)
|
|
1029
|
+
* - "trunc"(直接去掉小数部分,取整)
|
|
1030
|
+
* @param value 输入的数字
|
|
1031
|
+
* @param method 转换方法
|
|
1032
|
+
* @param opts.fallback 失败默认值
|
|
1033
|
+
* @returns 整数
|
|
1034
|
+
*/
|
|
1035
|
+
export declare function numberToInt(input: any, method?: 'floor' | 'ceil' | 'round' | 'trunc', opts?: {
|
|
1036
|
+
fallback: number;
|
|
1037
|
+
}): number;
|
|
1038
|
+
|
|
1039
|
+
export declare function objectArrayExpressionCalcInject(arr: Record<string, any>[], injects: Record<string, string>): Record<string, any>[];
|
|
1040
|
+
|
|
1041
|
+
export declare function objectArrayMerge<T extends Record<string, any>>(arr: T[], classNames: string[], mergeCallback?: (mergeRecord: T, item: T) => T): T[];
|
|
1042
|
+
|
|
1043
|
+
export declare function objectArrayPick(arr: Record<string, any>[], pick: string): any[];
|
|
1044
|
+
|
|
1045
|
+
export declare function objectArrayResetFields<T extends Record<string, any>>(arr: T[], resetFields: Record<string, any>): T[];
|
|
1046
|
+
|
|
1047
|
+
export declare function objectArraySyncFields(arr: Record<string, any>[], fields: Record<string, string>): Record<string, any>[];
|
|
1048
|
+
|
|
1049
|
+
export declare function objectAssign<T>(obj: T, assign: Record<string, any>): T;
|
|
1050
|
+
|
|
1051
|
+
export declare function objectEqual(obj: any, obj1: any, opts?: {
|
|
1052
|
+
compareFields?: string[];
|
|
1053
|
+
}): boolean;
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* 对象字段校验
|
|
1057
|
+
* @param obj 检测对象
|
|
1058
|
+
* @param fields 默认Object.keys获取到的字段
|
|
1059
|
+
* @param callback 默认isEmpty
|
|
1060
|
+
* @return boolean
|
|
1061
|
+
*/
|
|
1062
|
+
export declare function objectFieldsEvery(obj: any, validateFunc: (fieldValue: any) => boolean, fields?: string[], defaultValue?: boolean): boolean;
|
|
1063
|
+
|
|
1064
|
+
export declare function objectFieldsSetNull(o: any, fields: string[]): Record<string, any>;
|
|
1065
|
+
|
|
1066
|
+
export declare function objectFieldsSetUndefined(o: any, fields: string[]): Record<string, any>;
|
|
1067
|
+
|
|
1068
|
+
/**
|
|
1069
|
+
* 对象字段校验
|
|
1070
|
+
* @param obj 检测对象
|
|
1071
|
+
* @param fields 默认Object.keys获取到的字段
|
|
1072
|
+
* @param callback 默认isNotEmpty
|
|
1073
|
+
* @return boolean
|
|
1074
|
+
*/
|
|
1075
|
+
export declare function objectFieldsValidate(obj: any, fields?: string[] | null, validateFunc?: (fieldValue: any) => boolean): boolean;
|
|
1076
|
+
|
|
1077
|
+
export declare function objectFieldsValidatePaths(record: Record<string, any>, paths: string[], check?: (val: any) => boolean): (readonly [string, boolean])[];
|
|
1078
|
+
|
|
1079
|
+
export declare function objectFieldsValidateVoidPaths(record: Record<string, any>, paths: string[]): string[];
|
|
1080
|
+
|
|
1081
|
+
export declare function objectForEach<T extends Record<string, any>>(obj: T, callback: (key: string, value: any, obj: T) => void): void;
|
|
1082
|
+
|
|
1083
|
+
export declare function objectGet(value: unknown, path?: string, defaultValue?: any): any;
|
|
1084
|
+
|
|
1085
|
+
export declare function objectHas(obj: unknown, fields: string | string[]): boolean;
|
|
1086
|
+
|
|
1087
|
+
export declare function objectHasKey<T, K extends PropertyKey>(obj: T, key: K): key is K & keyof T;
|
|
1088
|
+
|
|
1089
|
+
export declare function objectKeys(obj: any, opts?: {
|
|
1090
|
+
excludeKeys?: string[];
|
|
1091
|
+
includeKeys?: string[];
|
|
1092
|
+
}, keyMap?: (key: string) => string): any[];
|
|
1093
|
+
|
|
1094
|
+
export declare function objectOmit<O extends Record<string, any>>(input: O, check: any[] | ((value: any) => boolean)): Record<string, any>;
|
|
1095
|
+
|
|
1096
|
+
export declare function objectOmitFields<O extends object, F extends keyof O>(input: O, fields: F[]): Omit<O, F>;
|
|
1097
|
+
|
|
1098
|
+
export declare function objectPathsJoin(record: Record<string, any>, paths: string[], joinSymbol?: string): string;
|
|
1099
|
+
|
|
1100
|
+
export declare function objectPick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
1101
|
+
|
|
1102
|
+
export declare function objectRemoveFields(o: any, fields: string[]): Record<string, any>;
|
|
1103
|
+
|
|
1104
|
+
export declare function objectRemoveNullishFields<T extends Record<string, any>>(obj: T): Partial<T>;
|
|
1105
|
+
|
|
1106
|
+
export declare function objectSet<T extends Record<string, any>>(obj: T, path: string, val: unknown): void;
|
|
1107
|
+
|
|
1108
|
+
export declare function objectShallowGet(obj: any, field: string): any;
|
|
1109
|
+
|
|
1110
|
+
export declare function objectShallowMap(obj: Record<any, any>, keyFn: (key: any, value: any, obj: Record<any, any>) => string, valueFn: (value: any, key: any, obj: Record<any, any>) => any): Record<any, any>;
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* 对象字段校验
|
|
1114
|
+
* @param obj 检测对象
|
|
1115
|
+
* @param fields 默认Object.keys获取到的字段
|
|
1116
|
+
* @param callback 默认isEmpty
|
|
1117
|
+
* @return boolean
|
|
1118
|
+
*/
|
|
1119
|
+
export declare function objectSome(obj: any, validateFunc: (fieldValue: any) => boolean, fields?: string[] | null, defaultValue?: boolean): boolean;
|
|
1120
|
+
|
|
1121
|
+
export declare function objectSomeFields(input: any, fields: string[], func: (fieldValue: any, field: string) => boolean): boolean;
|
|
1122
|
+
|
|
1123
|
+
export declare function objectStringify(obj: Record<string, any>, allowDots?: boolean): string;
|
|
1124
|
+
|
|
1125
|
+
export declare function objectToArray<T extends Record<string, any>>(obj: Record<string, any>, callback: (key: string, value: any) => T): T[];
|
|
1126
|
+
|
|
1127
|
+
export declare function objectValueMap<T extends Record<string, any>, R>(input: T, valueGetter: (value: T[keyof T], key: keyof T, input: T) => R): Record<keyof T, R>;
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* 对象转url参数
|
|
1131
|
+
* @param {*} data
|
|
1132
|
+
* @param {*} isPrefix
|
|
1133
|
+
*/
|
|
1134
|
+
export declare function objToUrl(data: any, isPrefix?: boolean): string;
|
|
1135
|
+
|
|
1136
|
+
export declare function parseURL(path: string): {
|
|
1137
|
+
pathname: string;
|
|
1138
|
+
params: Record<string, string>;
|
|
1139
|
+
};
|
|
1140
|
+
|
|
1141
|
+
export declare function percentFormatter<T = unknown>(value: T, options?: {
|
|
1142
|
+
thousandth?: boolean;
|
|
1143
|
+
allowRound?: boolean;
|
|
1144
|
+
precision?: number;
|
|
1145
|
+
precisionPad?: boolean;
|
|
1146
|
+
}): string;
|
|
1147
|
+
|
|
1148
|
+
export declare function pipe<A extends unknown[], B>(ab: (this: void, ...a: A) => B): (...args: A) => B;
|
|
1149
|
+
|
|
1150
|
+
export declare function pipe<A extends unknown[], B, C>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C): (...args: A) => C;
|
|
1151
|
+
|
|
1152
|
+
export declare function pipe<A extends unknown[], B, C, D>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D): (...args: A) => D;
|
|
1153
|
+
|
|
1154
|
+
export declare function pipe<A extends unknown[], B, C, D, E>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E): (...args: A) => E;
|
|
1155
|
+
|
|
1156
|
+
export declare function pipe<A extends unknown[], B, C, D, E, F>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F): (...args: A) => F;
|
|
1157
|
+
|
|
1158
|
+
export declare function pipe<A extends unknown[], B, C, D, E, F, G>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G): (...args: A) => G;
|
|
1159
|
+
|
|
1160
|
+
export declare function pipe<A extends unknown[], B, C, D, E, F, G, H>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H): (...args: A) => H;
|
|
1161
|
+
|
|
1162
|
+
export declare function pipe<A extends unknown[], B, C, D, E, F, G, H, I>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H, hi: (this: void, h: H) => I): (...args: A) => I;
|
|
1163
|
+
|
|
1164
|
+
export declare function pipe<A extends unknown[], B, C, D, E, F, G, H, I, J>(ab: (this: void, ...a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H, hi: (this: void, h: H) => I, ij: (this: void, i: I) => J): (...args: A) => J;
|
|
1165
|
+
|
|
1166
|
+
export declare function pipeWith<A, B>(a: A, ab: (this: void, a: A) => B): B;
|
|
1167
|
+
|
|
1168
|
+
export declare function pipeWith<A, B, C>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C): C;
|
|
1169
|
+
|
|
1170
|
+
export declare function pipeWith<A, B, C, D>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D): D;
|
|
1171
|
+
|
|
1172
|
+
export declare function pipeWith<A, B, C, D, E>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E): E;
|
|
1173
|
+
|
|
1174
|
+
export declare function pipeWith<A, B, C, D, E, F>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F): F;
|
|
1175
|
+
|
|
1176
|
+
export declare function pipeWith<A, B, C, D, E, F, G>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G): G;
|
|
1177
|
+
|
|
1178
|
+
export declare function pipeWith<A, B, C, D, E, F, G, H>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H): H;
|
|
1179
|
+
|
|
1180
|
+
export declare function pipeWith<A, B, C, D, E, F, G, H, I>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H, hi: (this: void, h: H) => I): I;
|
|
1181
|
+
|
|
1182
|
+
export declare function pipeWith<A, B, C, D, E, F, G, H, I, J>(a: A, ab: (this: void, a: A) => B, bc: (this: void, b: B) => C, cd: (this: void, c: C) => D, de: (this: void, d: D) => E, ef: (this: void, e: E) => F, fg: (this: void, f: F) => G, gh: (this: void, g: G) => H, hi: (this: void, h: H) => I, ij: (this: void, i: I) => J): J;
|
|
1183
|
+
|
|
1184
|
+
declare interface Point {
|
|
1185
|
+
x: number;
|
|
1186
|
+
y: number;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
declare type Point_2<X extends string, Y extends string> = {
|
|
1190
|
+
[K in X | Y]: number;
|
|
1191
|
+
};
|
|
1192
|
+
|
|
1193
|
+
declare type Point_3<X extends string, Y extends string> = {
|
|
1194
|
+
[K in X | Y]: number;
|
|
1195
|
+
};
|
|
1196
|
+
|
|
1197
|
+
declare type Point_4<X extends string, Y extends string> = {
|
|
1198
|
+
[K in X | Y]: number;
|
|
1199
|
+
};
|
|
1200
|
+
|
|
1201
|
+
export declare function promiseQueue(arr: Promise<any>[]): Promise<any[]>;
|
|
1202
|
+
|
|
1203
|
+
export declare const qs: {
|
|
1204
|
+
stringify: typeof stringify;
|
|
1205
|
+
};
|
|
1206
|
+
|
|
1207
|
+
export declare function queryStructure(mapping: Mapping_2): MappingReuslt;
|
|
1208
|
+
|
|
1209
|
+
export declare function rangeDateFormatter<T = unknown>(value: T): string;
|
|
1210
|
+
|
|
1211
|
+
export declare function rangeMonthFormatter<T = unknown>(value: T): string;
|
|
1212
|
+
|
|
1213
|
+
/** TODO: 值类型检测需更完善一点 */
|
|
1214
|
+
export declare function rangeYearFormatter<T = unknown>(value: T): string;
|
|
1215
|
+
|
|
1216
|
+
export declare function readBlobAsBuffer(bolb: Blob): Promise<ArrayBuffer>;
|
|
1217
|
+
|
|
1218
|
+
export declare function readFileAsArrayBuffer(file: File): Promise<ArrayBuffer>;
|
|
1219
|
+
|
|
1220
|
+
export declare function readFileAsBuffer(file: File): Promise<ArrayBuffer>;
|
|
1221
|
+
|
|
1222
|
+
declare function readJsonFile<T = any>({ file, fallbackResult }: {
|
|
1223
|
+
file: File;
|
|
1224
|
+
fallbackResult?: T;
|
|
1225
|
+
}): Promise<T>;
|
|
1226
|
+
|
|
1227
|
+
export declare function readURLAsBuffer(url: string): Promise<ArrayBuffer>;
|
|
1228
|
+
|
|
1229
|
+
declare type Reducer<T, A> = (state: T, action: A) => T;
|
|
1230
|
+
|
|
1231
|
+
export declare function returnNotVoid<X, Y>(param1: X, param2: Y | (() => Y)): X | Y;
|
|
1232
|
+
|
|
1233
|
+
export declare function rgba2obj(rgba?: string): RGBColor;
|
|
1234
|
+
|
|
1235
|
+
export declare interface RGBColor {
|
|
1236
|
+
a?: number;
|
|
1237
|
+
b: number;
|
|
1238
|
+
g: number;
|
|
1239
|
+
r: number;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
export declare function runPromiseQueue(promises: Promise<any>[]): Promise<any[]>;
|
|
1243
|
+
|
|
1244
|
+
export declare function runQueuePromise(promises: (() => Promise<any>)[]): Promise<any[]>;
|
|
1245
|
+
|
|
1246
|
+
export declare function safeArray(arr: any): any[];
|
|
1247
|
+
|
|
1248
|
+
export declare function safeArrayJoin(arr: any, seperator?: string): string;
|
|
1249
|
+
|
|
1250
|
+
export declare function safeDateGetYear(date: Date): number;
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* 安全获取
|
|
1254
|
+
*/
|
|
1255
|
+
export declare function safeGet<T = any>(prop: any, ...opts: any): T;
|
|
1256
|
+
|
|
1257
|
+
export declare function selectFile({ accept, multiple }: {
|
|
1258
|
+
accept?: string;
|
|
1259
|
+
multiple?: 'multiple';
|
|
1260
|
+
}): Promise<File[]>;
|
|
1261
|
+
|
|
1262
|
+
export declare const setConfigStore: (nextStore: ConfigStore) => void;
|
|
1263
|
+
|
|
1264
|
+
export declare const setConfigStoreAtKey: <V>(key: string, value: V) => void;
|
|
1265
|
+
|
|
1266
|
+
export declare function setDOMStyle(element: any, styles: Record<string, any>): void;
|
|
1267
|
+
|
|
1268
|
+
export declare function setDOMStylePropertys(element: any, propertys: Record<string, any>): void;
|
|
1269
|
+
|
|
1270
|
+
export declare function setHtmlInputValue<T = any>(el: T, value: any, opts?: {
|
|
1271
|
+
dispatchEvent: boolean | 'bubbles';
|
|
1272
|
+
}): Promise<T>;
|
|
1273
|
+
|
|
1274
|
+
export declare function shareAmount(totalAmount: any, target: {
|
|
1275
|
+
items: Record<string, any>[];
|
|
1276
|
+
itemPercentage: (row: any) => number;
|
|
1277
|
+
itemField: string;
|
|
1278
|
+
itemShare?: (item: any, percentageAmount: number) => number;
|
|
1279
|
+
}): Record<string, any>[];
|
|
1280
|
+
|
|
1281
|
+
/**
|
|
1282
|
+
* 比较函数,支持字符串、数字、数组、[null, undefined]
|
|
1283
|
+
*/
|
|
1284
|
+
export declare function smartCompare(x: any, y: any, order?: 'asc' | 'desc' | 'none' | undefined | null): number;
|
|
1285
|
+
|
|
1286
|
+
declare interface SortCondition<T> {
|
|
1287
|
+
condition: (item: T) => any;
|
|
1288
|
+
order: 'asc' | 'desc';
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
declare interface SpecialEvent {
|
|
1292
|
+
type: 'focus';
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
declare interface SpecialEvent_2 {
|
|
1296
|
+
type: 'focus';
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
export declare function stopDOMEvent(event: any): void;
|
|
1300
|
+
|
|
1301
|
+
declare interface StoreResult<T, A> {
|
|
1302
|
+
getState: () => T;
|
|
1303
|
+
dispatch: (action: A) => void;
|
|
1304
|
+
subscribe: (listener: () => void) => () => void;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
declare function stringify(obj: any, unsafePrefix?: string): string;
|
|
1308
|
+
|
|
1309
|
+
export declare function stringInsert(value: any, strIndex: number, insert: any): string;
|
|
1310
|
+
|
|
1311
|
+
export declare function stringJoin(value: any, interval: number, joinStr: string): string;
|
|
1312
|
+
|
|
1313
|
+
export declare function stringReplaceAll(value: string, regOrStr: string | RegExp, replaceStr: string, apply?: (opts: {
|
|
1314
|
+
matchStr: string;
|
|
1315
|
+
matchStrIndex: number;
|
|
1316
|
+
matchCount: number;
|
|
1317
|
+
matchTotal: number;
|
|
1318
|
+
}) => boolean): string;
|
|
1319
|
+
|
|
1320
|
+
export declare function stringSplit(str: any, seperator: string): string[];
|
|
1321
|
+
|
|
1322
|
+
export declare function stringToKebabCase(str: string): string;
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* 字符串内字符个数统计
|
|
1326
|
+
* @param str
|
|
1327
|
+
* @param char
|
|
1328
|
+
* @returns
|
|
1329
|
+
*/
|
|
1330
|
+
export declare function stringWordCount(str: string, word: string): number;
|
|
1331
|
+
|
|
1332
|
+
export declare function substringSimilarity(a: string, b: string): 0 | 1;
|
|
1333
|
+
|
|
1334
|
+
export declare function subtract(arr: any[], options?: {
|
|
1335
|
+
replaceNaNItem?: number;
|
|
1336
|
+
replaceNaNResult?: number;
|
|
1337
|
+
}): number;
|
|
1338
|
+
|
|
1339
|
+
export declare function sum<T>(arr: T[], opts?: {
|
|
1340
|
+
replaceNaNItem?: number;
|
|
1341
|
+
replaceNaNResult?: number;
|
|
1342
|
+
}): number;
|
|
1343
|
+
|
|
1344
|
+
export declare function sumBy<T>(arr: T[], getter: string | ((item: T) => number), opts?: {
|
|
1345
|
+
replaceNaNItem?: number;
|
|
1346
|
+
replaceNaNResult?: number;
|
|
1347
|
+
}): number;
|
|
1348
|
+
|
|
1349
|
+
export declare function SWITCH(key: any, map: ISwitchMap): any;
|
|
1350
|
+
|
|
1351
|
+
export declare function switchCase(condition: any, cases: Record<any, any>): any;
|
|
1352
|
+
|
|
1353
|
+
export declare function toArray<T>(input: T | T[] | undefined): T[];
|
|
1354
|
+
|
|
1355
|
+
export declare function toDate(value: any, fallback?: Date): Date;
|
|
1356
|
+
|
|
1357
|
+
/**
|
|
1358
|
+
*
|
|
1359
|
+
* @param input
|
|
1360
|
+
* @param format yyyy MM dd HH mm ss
|
|
1361
|
+
* @param fallbackValue
|
|
1362
|
+
* @returns
|
|
1363
|
+
*/
|
|
1364
|
+
export declare function toFormatDate<FV = Date>(input: any, format?: string, fallbackValue?: FV): Date | FV;
|
|
1365
|
+
|
|
1366
|
+
export declare function toFormatUtcDate<FV = Date>(input: any, format?: string, fallbackValue?: FV): Date | FV;
|
|
1367
|
+
|
|
1368
|
+
export declare function toNumber(value: any, opts?: {
|
|
1369
|
+
nanReplace?: number;
|
|
1370
|
+
multiply?: number;
|
|
1371
|
+
}): number;
|
|
1372
|
+
|
|
1373
|
+
export declare function toQueryValue<K extends keyof Mapping>(k: K, value: Nullable<Mapping[K]>): { [k in K]: Nullable<Mapping[k]>; } | undefined;
|
|
1374
|
+
|
|
1375
|
+
export declare function toSafeNumber(value: any, options?: {
|
|
1376
|
+
multiply?: number;
|
|
1377
|
+
}): number;
|
|
1378
|
+
|
|
1379
|
+
export declare function toSafeString(val: unknown): string;
|
|
1380
|
+
|
|
1381
|
+
export declare function toSimplifiedChinese<T>(input: T, opts?: {
|
|
1382
|
+
excludeKey?: (key: string) => boolean;
|
|
1383
|
+
}): T;
|
|
1384
|
+
|
|
1385
|
+
declare function toString_2(value: any): string;
|
|
1386
|
+
export { toString_2 as toString }
|
|
1387
|
+
|
|
1388
|
+
export declare function toTraditionalChinese<T>(input: T, opts?: {
|
|
1389
|
+
excludeKey?: (key: string) => boolean;
|
|
1390
|
+
}): T;
|
|
1391
|
+
|
|
1392
|
+
export declare function transferNumberWithPx<T = unknown>(num: T): string | undefined;
|
|
1393
|
+
|
|
1394
|
+
export declare function treeCollect<T extends Record<string, any>>(treeData: T[], type?: 'pre' | 'post' | 'leaf-only', opts?: {
|
|
1395
|
+
leafField: string;
|
|
1396
|
+
}): T[];
|
|
1397
|
+
|
|
1398
|
+
export declare function treeDelete<T extends Record<string, any>>(tree: T[], callback: (node: T, nodeIndexes: number[]) => boolean, opts?: {
|
|
1399
|
+
leafField: string;
|
|
1400
|
+
}): T[];
|
|
1401
|
+
|
|
1402
|
+
export declare function treeDepth<T extends Record<string, any>>(nodes: T[], opts?: {
|
|
1403
|
+
leafField: string;
|
|
1404
|
+
}): number;
|
|
1405
|
+
|
|
1406
|
+
export declare function treeExcludeNodes<T extends IAbstractTreeNode>(tree: IAbstractTreeNode[], compare: (node: IAbstractTreeNode) => boolean): T[];
|
|
1407
|
+
|
|
1408
|
+
export declare function treeFilter<T extends Record<string, any>>(treeData: T[], callback: (node: T, opts: {
|
|
1409
|
+
flatSubNodes: T[];
|
|
1410
|
+
}) => boolean, opts?: {
|
|
1411
|
+
leafField: string;
|
|
1412
|
+
}): T[];
|
|
1413
|
+
|
|
1414
|
+
export declare function treeFind<T extends Record<string, any>>(nodes: T[], callback: (node: T, opts: {
|
|
1415
|
+
flatSubNodes: T[];
|
|
1416
|
+
}) => boolean, opts?: {
|
|
1417
|
+
leafField: string;
|
|
1418
|
+
}): T | null;
|
|
1419
|
+
|
|
1420
|
+
export declare function treeFindNodePath<T extends Record<string, any>>(nodes: T[], callback: (node: T, nodeIndexList: number[]) => boolean, opts?: {
|
|
1421
|
+
leafField: string;
|
|
1422
|
+
}): number[];
|
|
1423
|
+
|
|
1424
|
+
export declare function treeForeach<T extends Record<string, any>>(nodes: T[], callback: (node: T, opts: {
|
|
1425
|
+
flatSubNodes: T[];
|
|
1426
|
+
}) => void, opts?: {
|
|
1427
|
+
leafField: string;
|
|
1428
|
+
}): void;
|
|
1429
|
+
|
|
1430
|
+
export declare function treeMap<T extends Record<string, any>, R extends Record<string, any>>(nodes: T[], callback: (node: T, nodeIndexes: number[]) => R, opts?: {
|
|
1431
|
+
leafField: string;
|
|
1432
|
+
}): any;
|
|
1433
|
+
|
|
1434
|
+
export declare function treeNodeAddChilds<T extends Record<string, any>, R extends Record<string, any>>(nodes: T[], callback: (node: T, nodeIndexes: number[]) => R, childs: T[], opts?: {
|
|
1435
|
+
leafField: string;
|
|
1436
|
+
}): any;
|
|
1437
|
+
|
|
1438
|
+
export declare function treePathAddChildNodes<T extends Record<string, any>>(nodes: T[], targetPath: number[], childNodes: T[], opts?: {
|
|
1439
|
+
leafField: string;
|
|
1440
|
+
}): any;
|
|
1441
|
+
|
|
1442
|
+
export declare function treePathAppendNodes<T extends Record<string, any>>(tree: T[], targetPath: number[], appendNodes: T[], opts?: {
|
|
1443
|
+
leafField: string;
|
|
1444
|
+
}): any;
|
|
1445
|
+
|
|
1446
|
+
export declare function treePathDelete<T extends Record<string, any>>(tree: T[], targetPath: number[], opts?: {
|
|
1447
|
+
leafField: string;
|
|
1448
|
+
}): T[];
|
|
1449
|
+
|
|
1450
|
+
export declare function treePick<T extends Record<string, any>>(nodes: T[], callback: (node: T, opts: {
|
|
1451
|
+
flatSubNodes: T[];
|
|
1452
|
+
}) => boolean, opts?: {
|
|
1453
|
+
leafField: string;
|
|
1454
|
+
}): T[];
|
|
1455
|
+
|
|
1456
|
+
export declare function treeSort<T extends AbstractTreeNode>(treeData: T[], compare: (x: T, y: T) => number): T[];
|
|
1457
|
+
|
|
1458
|
+
/**
|
|
1459
|
+
* @param tree 树结构
|
|
1460
|
+
* @param childField 每个节点中子树的字段名
|
|
1461
|
+
* @returns 扁平数组
|
|
1462
|
+
*/
|
|
1463
|
+
export declare function treeToFlatArray(tree?: any[], childField?: string): any[];
|
|
1464
|
+
|
|
1465
|
+
export declare function triggerDOMEvent(element: HTMLElement, eventName: 'mousemove'): void;
|
|
1466
|
+
|
|
1467
|
+
export declare function uniqueBy<T extends object, K extends keyof T>(arr: T[], by: K): T[K][];
|
|
1468
|
+
|
|
1469
|
+
export declare function urlStringify(obj: Record<string, any>, prefix?: string, options?: {
|
|
1470
|
+
encode?: boolean;
|
|
1471
|
+
delimiter?: string;
|
|
1472
|
+
}): string;
|
|
1473
|
+
|
|
1474
|
+
export declare function uuid(): string;
|
|
1475
|
+
|
|
1476
|
+
declare type ValueOrFn<T> = T | (() => T);
|
|
1477
|
+
|
|
1478
|
+
declare type ValueOrFn_2<T> = T | (() => T);
|
|
1479
|
+
|
|
1480
|
+
declare type VoidLike = null | undefined | '' | [];
|
|
1481
|
+
|
|
1482
|
+
declare type VoidLike_2 = null | undefined | '' | [] | Record<string, never>;
|
|
1483
|
+
|
|
1484
|
+
export declare function when<V>(condition: ValueOrFn_2<boolean>, result: ValueOrFn_2<V>): {
|
|
1485
|
+
elseWhen(condition: ValueOrFn_2<boolean>, result: ValueOrFn_2<V>): any;
|
|
1486
|
+
default(defaultResult: ValueOrFn_2<V>): V;
|
|
1487
|
+
};
|
|
1488
|
+
|
|
1489
|
+
/**
|
|
1490
|
+
* 字符串内字符个数统计
|
|
1491
|
+
* @param str
|
|
1492
|
+
* @param char
|
|
1493
|
+
* @returns
|
|
1494
|
+
*/
|
|
1495
|
+
export declare function wordCount(str: string, word: string): number;
|
|
1496
|
+
|
|
1497
|
+
export declare function zipArrayObject(param: Record<string, any[]>): any[];
|
|
1498
|
+
|
|
1499
|
+
export { }
|