@pawover/kit 0.0.0-alpha.2 → 0.0.0-alpha.20
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/enums.d.ts +24 -0
- package/dist/enums.js +24 -0
- package/dist/hooks-alova.d.ts +22 -0
- package/dist/hooks-alova.js +38 -0
- package/dist/hooks-react.d.ts +87 -0
- package/dist/hooks-react.js +295 -0
- package/dist/index.d.ts +382 -0
- package/dist/index.js +1123 -2
- package/dist/vite.d.ts +12 -0
- package/dist/vite.js +21 -0
- package/dist/zod.d.ts +104 -0
- package/dist/zod.js +137 -0
- package/metadata.json +139 -0
- package/package.json +46 -42
- package/dist/enums/index.js +0 -20
- package/dist/hooks/react/index.js +0 -5
- package/dist/hooks/react/useCreation.js +0 -11
- package/dist/hooks/react/useLatest.js +0 -6
- package/dist/hooks/react/useMount.js +0 -29
- package/dist/hooks/react/useResponsive.js +0 -59
- package/dist/hooks/react/useUnmount.js +0 -17
- package/dist/types/enums/index.d.ts +0 -20
- package/dist/types/hooks/react/index.d.ts +0 -5
- package/dist/types/hooks/react/useCreation.d.ts +0 -2
- package/dist/types/hooks/react/useLatest.d.ts +0 -1
- package/dist/types/hooks/react/useMount.d.ts +0 -11
- package/dist/types/hooks/react/useResponsive.d.ts +0 -16
- package/dist/types/hooks/react/useUnmount.d.ts +0 -6
- package/dist/types/index.d.ts +0 -2
- package/dist/types/utils/array.d.ts +0 -76
- package/dist/types/utils/index.d.ts +0 -6
- package/dist/types/utils/object.d.ts +0 -53
- package/dist/types/utils/string.d.ts +0 -13
- package/dist/types/utils/to.d.ts +0 -5
- package/dist/types/utils/tree/index.d.ts +0 -6
- package/dist/types/utils/tree/rowsToTree.d.ts +0 -10
- package/dist/types/utils/tree/treeFilter.d.ts +0 -6
- package/dist/types/utils/tree/treeFind.d.ts +0 -8
- package/dist/types/utils/tree/treeForEach.d.ts +0 -5
- package/dist/types/utils/tree/treeMap.d.ts +0 -6
- package/dist/types/utils/tree/treeToRows.d.ts +0 -9
- package/dist/types/utils/tree/types.d.ts +0 -24
- package/dist/types/utils/typeof.d.ts +0 -29
- package/dist/utils/array.js +0 -196
- package/dist/utils/index.js +0 -6
- package/dist/utils/object.js +0 -138
- package/dist/utils/string.js +0 -70
- package/dist/utils/to.js +0 -16
- package/dist/utils/tree/index.js +0 -6
- package/dist/utils/tree/rowsToTree.js +0 -35
- package/dist/utils/tree/treeFilter.js +0 -92
- package/dist/utils/tree/treeFind.js +0 -82
- package/dist/utils/tree/treeForEach.js +0 -60
- package/dist/utils/tree/treeMap.js +0 -79
- package/dist/utils/tree/treeToRows.js +0 -13
- package/dist/utils/tree/types.js +0 -10
- package/dist/utils/typeof.js +0 -114
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { Class, NonEmptyObject, Replace, SetOptional, UnionToTuple, ValueOf } from "type-fest";
|
|
2
|
+
import { assign } from "radashi";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/array/arrayCast.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 构造数组
|
|
8
|
+
* @param candidate 待构造项
|
|
9
|
+
* @param checkEmpty 是否检查 `undefined` 和 `null`
|
|
10
|
+
*/
|
|
11
|
+
declare function arrayCast<T>(candidate: T | T[], checkEmpty?: boolean): T[];
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/utils/array/arrayCompete.d.ts
|
|
14
|
+
/**
|
|
15
|
+
* 数组竞争
|
|
16
|
+
* - 返回在匹配函数的比较条件中获胜的最终项目,适用于更复杂的最小值/最大值计算
|
|
17
|
+
*
|
|
18
|
+
* @param initialList 数组
|
|
19
|
+
* @param match 匹配函数
|
|
20
|
+
*/
|
|
21
|
+
declare function arrayCompete<T>(initialList: readonly T[], match: (a: T, b: T) => T): T | null;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/utils/array/arrayCounting.d.ts
|
|
24
|
+
/**
|
|
25
|
+
* 统计数组的项目出现次数
|
|
26
|
+
* - 通过给定的标识符匹配函数,返回一个对象,其中键是回调函数返回的 key 值,每个值是一个整数,表示该 key 出现的次数
|
|
27
|
+
*
|
|
28
|
+
* @param initialList 初始数组
|
|
29
|
+
* @param match 匹配函数
|
|
30
|
+
*/
|
|
31
|
+
declare function arrayCounting<T, K extends PropertyKey>(initialList: readonly T[], match: (row: T) => K): Record<string, number>;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/utils/array/arrayDifference.d.ts
|
|
34
|
+
/**
|
|
35
|
+
* 求数组差集
|
|
36
|
+
*
|
|
37
|
+
* @param initialList 初始数组
|
|
38
|
+
* @param diffList 对比数组
|
|
39
|
+
* @param match 匹配函数
|
|
40
|
+
*/
|
|
41
|
+
declare function arrayDifference<T>(initialList: readonly T[], diffList: readonly T[], match?: (row: T) => unknown): T[];
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/utils/array/arrayFirst.d.ts
|
|
44
|
+
/**
|
|
45
|
+
* 获取数组第一项
|
|
46
|
+
*
|
|
47
|
+
* @param initialList 初始数组
|
|
48
|
+
* @param saveValue 安全值
|
|
49
|
+
*/
|
|
50
|
+
declare function arrayFirst<T>(initialList: readonly T[], saveValue?: T): T | undefined;
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/utils/array/arrayFork.d.ts
|
|
53
|
+
/**
|
|
54
|
+
* 数组分组过滤
|
|
55
|
+
* - 给定一个数组和一个条件,返回一个由两个数组组成的元组,其中第一个数组包含所有满足条件的项,第二个数组包含所有不满足条件的项
|
|
56
|
+
*
|
|
57
|
+
* @param initialList 初始数组
|
|
58
|
+
* @param match 条件匹配函数
|
|
59
|
+
*/
|
|
60
|
+
declare function arrayFork<T>(initialList: readonly T[], match: (item: T) => boolean): [T[], T[]];
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/utils/array/arrayIntersection.d.ts
|
|
63
|
+
/**
|
|
64
|
+
* 求数组交集
|
|
65
|
+
*
|
|
66
|
+
* @param initialList 初始数组
|
|
67
|
+
* @param diffList 对比数组
|
|
68
|
+
* @param match 匹配函数
|
|
69
|
+
*/
|
|
70
|
+
declare function arrayIntersection<T>(initialList: readonly T[], diffList: readonly T[], match?: (row: T) => unknown): T[];
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/utils/array/arrayLast.d.ts
|
|
73
|
+
/**
|
|
74
|
+
* 获取数组最后一项
|
|
75
|
+
*
|
|
76
|
+
* @param initialList 初始数组
|
|
77
|
+
* @param saveValue 安全值
|
|
78
|
+
*/
|
|
79
|
+
declare function arrayLast<T>(initialList: readonly T[], saveValue?: T): T | undefined;
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/utils/array/arrayMerge.d.ts
|
|
82
|
+
/**
|
|
83
|
+
* 数组合并
|
|
84
|
+
* - 通过给定的标识符匹配函数,用第二个数组中的匹配项替换第一个数组中匹配项的所有内容
|
|
85
|
+
*
|
|
86
|
+
* @param initialList 初始数组
|
|
87
|
+
* @param mergeList 待合并数组
|
|
88
|
+
* @param match 匹配函数
|
|
89
|
+
*/
|
|
90
|
+
declare function arrayMerge<T>(initialList: readonly T[], mergeList: readonly T[], match?: (item: T) => unknown): T[];
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/utils/array/arrayPick.d.ts
|
|
93
|
+
/**
|
|
94
|
+
* 数组选择
|
|
95
|
+
* - 一次性应用 `filter` 和 `map` 操作
|
|
96
|
+
*
|
|
97
|
+
* @param initialList 初始数组
|
|
98
|
+
* @param filter filter 函数
|
|
99
|
+
* @param mapper map 函数
|
|
100
|
+
*/
|
|
101
|
+
declare function arrayPick<T, K = T>(initialList: readonly T[], filter: (row: T, index: number) => boolean, mapper?: ((row: T, index: number) => K) | undefined): T[] | K[];
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/utils/array/arrayReplace.d.ts
|
|
104
|
+
/**
|
|
105
|
+
* 数组项替换
|
|
106
|
+
* - 在给定的数组中,替换符合匹配函数结果的项目。只替换第一个匹配项。始终返回原始数组的副本。
|
|
107
|
+
*
|
|
108
|
+
* @param initialList 初始数组
|
|
109
|
+
* @param newItem 替换项
|
|
110
|
+
* @param match 匹配函数
|
|
111
|
+
*/
|
|
112
|
+
declare function arrayReplace<T>(initialList: readonly T[], newItem: T, match: (row: T, index: number) => boolean): T[];
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/utils/array/arraySplit.d.ts
|
|
115
|
+
/**
|
|
116
|
+
* 数组切分
|
|
117
|
+
* - 将数组以指定的长度切分后,组合在高维数组中
|
|
118
|
+
*
|
|
119
|
+
* @param initialList 初始数组
|
|
120
|
+
* @param size 分割尺寸,默认 `10`
|
|
121
|
+
*/
|
|
122
|
+
declare function arraySplit<T>(initialList: readonly T[], size?: number): T[][];
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/utils/function/to.d.ts
|
|
125
|
+
/**
|
|
126
|
+
* @param promise
|
|
127
|
+
* @param errorExt - 可以传递给err对象的其他信息
|
|
128
|
+
*/
|
|
129
|
+
declare function to<T, U = Error>(promise: Readonly<Promise<T>>, errorExt?: UnknownObject): Promise<[U, undefined] | [null, T]>;
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/utils/object/cloneDeep.d.ts
|
|
132
|
+
interface CloningStrategy {
|
|
133
|
+
cloneMap: <K, V>(parent: Map<K, V>, track: (newParent: Map<K, V>) => Map<K, V>, clone: <T>(value: T) => T) => Map<K, V> | null;
|
|
134
|
+
cloneSet: <T>(parent: Set<T>, track: (newParent: Set<T>) => Set<T>, clone: <T>(value: T) => T) => Set<T> | null;
|
|
135
|
+
cloneArray: <T>(parent: readonly T[], track: (newParent: T[]) => T[], clone: <T>(value: T) => T) => T[] | null;
|
|
136
|
+
cloneObject: <T extends AnyObject>(parent: T, track: (newParent: T) => T, clone: <T>(value: T) => T) => T | null;
|
|
137
|
+
cloneOther: <T>(parent: T, track: (newParent: T) => T, clone: <T>(value: T) => T) => T | null;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* cloneDeep
|
|
141
|
+
* @reference https://github.com/radashi-org/radashi/blob/main/src/object/cloneDeep.ts
|
|
142
|
+
*/
|
|
143
|
+
declare function cloneDeep<T extends AnyObject>(root: T, customStrategy?: Partial<CloningStrategy>): T;
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/utils/object/enumEntries.d.ts
|
|
146
|
+
/**
|
|
147
|
+
* 返回枚举的属性的键/值数组
|
|
148
|
+
*
|
|
149
|
+
* @param enumeration 枚举
|
|
150
|
+
*/
|
|
151
|
+
declare function enumEntries<E extends AnyObject>(enumeration: NonEmptyObject<E>): [keyof E, E[keyof E]][];
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/utils/object/enumKeys.d.ts
|
|
154
|
+
/**
|
|
155
|
+
* 获取枚举所有属性的键
|
|
156
|
+
*
|
|
157
|
+
* @param enumeration 枚举
|
|
158
|
+
*/
|
|
159
|
+
declare function enumKeys<E extends AnyObject>(enumeration: NonEmptyObject<E>): [keyof E, ...(keyof E)[]];
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/utils/object/enumTypeCheck.d.ts
|
|
162
|
+
declare function enumTypeCheck<E extends AnyObject>(enumeration: E): E;
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/utils/object/enumValues.d.ts
|
|
165
|
+
/**
|
|
166
|
+
* 获取枚举所有属性的值
|
|
167
|
+
*
|
|
168
|
+
* @param enumeration 枚举
|
|
169
|
+
*/
|
|
170
|
+
declare function enumValues<E extends AnyObject>(enumeration: NonEmptyObject<E>): UnionToTuple<ValueOf<E>>;
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/utils/object/mapEntries.d.ts
|
|
173
|
+
declare function mapEntries<TKey extends PropertyKey, TValue, TNewKey extends PropertyKey, TNewValue>(obj: UnknownObject<TKey, TValue>, toEntry: (key: TKey, value: TValue) => [TNewKey, TNewValue]): UnknownObject<TNewKey, TNewValue>;
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/utils/object/objectAssign.d.ts
|
|
176
|
+
declare const objectAssign: typeof assign;
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/utils/object/objectEntries.d.ts
|
|
179
|
+
/**
|
|
180
|
+
* 返回对象的可枚举属性的键/值数组
|
|
181
|
+
*
|
|
182
|
+
* @param obj 对象
|
|
183
|
+
*/
|
|
184
|
+
declare function objectEntries<O extends AnyObject>(obj: O): [string & keyof O, O[keyof O]][];
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/utils/object/objectKeys.d.ts
|
|
187
|
+
/**
|
|
188
|
+
* 返回对象的可枚举属性和方法的名称
|
|
189
|
+
* - `Object.keys` 始终返回 `string[]` 类型,此函数可以返回具体类型
|
|
190
|
+
*
|
|
191
|
+
* @param obj 对象
|
|
192
|
+
*/
|
|
193
|
+
declare function objectKeys<O extends AnyObject>(obj: O): (keyof O)[];
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/utils/object/objectPick.d.ts
|
|
196
|
+
declare function objectPick<O extends AnyObject, K extends keyof O>(obj: O, keys: readonly K[]): Pick<O, K>;
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/utils/object/objectSwitch.d.ts
|
|
199
|
+
/**
|
|
200
|
+
* 对象反转
|
|
201
|
+
* - 返回交换了对象的可枚举属性的值/键对象
|
|
202
|
+
*
|
|
203
|
+
* @param obj 对象
|
|
204
|
+
*/
|
|
205
|
+
declare function objectSwitch<O extends AnyObject>(obj: NonEmptyObject<O>): Record<O[keyof O], keyof O>;
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region src/utils/object/objectValues.d.ts
|
|
208
|
+
/**
|
|
209
|
+
* 返回对象的可枚举属性的值数组
|
|
210
|
+
*
|
|
211
|
+
* @param obj 对象
|
|
212
|
+
*/
|
|
213
|
+
declare function objectValues<O extends AnyObject>(obj: O): UnionToTuple<ValueOf<O>>;
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/utils/string/stringInitialCase.d.ts
|
|
216
|
+
/**
|
|
217
|
+
* 首字母大小写
|
|
218
|
+
*/
|
|
219
|
+
declare function stringInitialCase(value: string, type: "lower" | "upper"): string;
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region src/utils/string/stringReplace.d.ts
|
|
222
|
+
declare function stringReplace<I extends string, S extends string, R extends string>(input: I, search: S, replacement: R): Replace<I, S, R>;
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/utils/string/stringToJson.d.ts
|
|
225
|
+
declare function stringToJson<R extends AnyObject = AnyObject, D extends R = R>(data: string | null | undefined, safeValue: D): R;
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/utils/string/stringToValues.d.ts
|
|
228
|
+
declare function stringToValues<T extends number | string = number>(data: string | null | undefined, valueType?: "number" | "string", splitSymbol?: string): T[];
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/utils/tree/types.d.ts
|
|
231
|
+
type RowKey = "id";
|
|
232
|
+
type ParentIdKey = "parentId";
|
|
233
|
+
type ChildrenKey = "children";
|
|
234
|
+
type Strategy = "pre" | "post" | "breadth";
|
|
235
|
+
interface BaseCallbackMeta<T> {
|
|
236
|
+
depth: number;
|
|
237
|
+
parents?: T[];
|
|
238
|
+
}
|
|
239
|
+
interface BaseOptions<T, CK extends string> {
|
|
240
|
+
childrenKey?: CK;
|
|
241
|
+
strategy?: Strategy;
|
|
242
|
+
getChildrenKey?: (row: T, meta: BaseCallbackMeta<T>) => CK | undefined;
|
|
243
|
+
}
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region src/utils/tree/treeFilter.d.ts
|
|
246
|
+
type TreeFilterOptions<T extends AnyObject, CK extends string = ChildrenKey> = BaseOptions<T, CK>;
|
|
247
|
+
type TreeFilterCallback<T extends AnyObject> = (row: T, meta: BaseCallbackMeta<T>) => boolean;
|
|
248
|
+
declare function treeFilter<T extends AnyObject, CK extends string = ChildrenKey>(tree: T[], callback: TreeFilterCallback<T>, options?: TreeFilterOptions<T, CK>): T[];
|
|
249
|
+
declare function treeFilter<T extends AnyObject, CK extends string = ChildrenKey>(tree: T, callback: TreeFilterCallback<T>, options?: TreeFilterOptions<T, CK>): T;
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/utils/tree/treeFind.d.ts
|
|
252
|
+
type TreeFindOptions<T extends AnyObject, CK extends string = ChildrenKey> = BaseOptions<T, CK>;
|
|
253
|
+
type TreeFindCallback<T extends AnyObject> = (row: T, meta: BaseCallbackMeta<T>) => boolean;
|
|
254
|
+
/**
|
|
255
|
+
* 查找树节点,找到第一个返回非空值的节点
|
|
256
|
+
*/
|
|
257
|
+
declare function treeFind<T extends AnyObject, CK extends string = ChildrenKey>(tree: T | T[], callback: TreeFindCallback<T>, options?: TreeFindOptions<T, CK>): T | undefined;
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region src/utils/tree/treeForEach.d.ts
|
|
260
|
+
type TreeForeachOptions<T extends AnyObject, CK extends string = ChildrenKey> = BaseOptions<T, CK>;
|
|
261
|
+
type TreeForeachCallback<T extends AnyObject> = (row: T, meta: BaseCallbackMeta<T>) => void;
|
|
262
|
+
declare function treeForEach<T extends AnyObject, CK extends string = ChildrenKey>(tree: T | T[], callback: TreeForeachCallback<T>, options?: TreeForeachOptions<T, CK>): void;
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/utils/tree/treeMap.d.ts
|
|
265
|
+
type TreeMapOptions<T extends AnyObject, CK extends string> = BaseOptions<T, CK>;
|
|
266
|
+
type TreeMapCallback<R extends AnyObject, T extends AnyObject> = (row: T, meta: BaseCallbackMeta<T>) => R;
|
|
267
|
+
declare function treeMap<R extends AnyObject, T extends AnyObject, CK extends string = ChildrenKey>(tree: T[], callback: TreeMapCallback<R, T>, options?: TreeMapOptions<T, CK>): TreeLike<R, CK>[];
|
|
268
|
+
declare function treeMap<R extends AnyObject, T extends AnyObject, CK extends string = ChildrenKey>(tree: T, callback: TreeMapCallback<R, T>, options?: TreeMapOptions<T, CK>): TreeLike<R, CK>;
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/utils/tree/rowsToTree.d.ts
|
|
271
|
+
interface RowsToTreeOptions<RK extends string = RowKey, PK extends string = ParentIdKey, CK extends string = ChildrenKey> {
|
|
272
|
+
rowKey?: RK;
|
|
273
|
+
parentIdKey?: PK;
|
|
274
|
+
childrenKey?: CK;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* 行结构 转 树结构
|
|
278
|
+
*/
|
|
279
|
+
declare function rowsToTree<T extends AnyObject = AnyObject, CK extends string = ChildrenKey, R = TreeLike<T, CK>, RK extends string = RowKey, PK extends string = ParentIdKey>(rows: T[], options?: RowsToTreeOptions<RK, PK, CK> | undefined): R[];
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/utils/tree/treeToRows.d.ts
|
|
282
|
+
type TreeToRowsOptions<T extends AnyObject, CK extends string = ChildrenKey> = TreeForeachOptions<T, CK>;
|
|
283
|
+
/**
|
|
284
|
+
* 树结构 转 行结构
|
|
285
|
+
*/
|
|
286
|
+
declare function treeToRows<T extends AnyObject, CK extends string = ChildrenKey, R extends AnyObject = SetOptional<T, CK>>(tree: T | T[], options?: TreeToRowsOptions<T, CK>): R[];
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/utils/typeof/isArray.d.ts
|
|
289
|
+
declare function isArray<T extends unknown[]>(value: unknown): value is T;
|
|
290
|
+
//#endregion
|
|
291
|
+
//#region src/utils/typeof/isAsyncFunction.d.ts
|
|
292
|
+
declare function isAsyncFunction<T extends AsyncFunc>(value: unknown): value is T;
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/utils/typeof/isBigInt.d.ts
|
|
295
|
+
declare function isBigInt<T extends bigint>(value: unknown): value is T;
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region src/utils/typeof/isBoolean.d.ts
|
|
298
|
+
declare function isBoolean<T extends boolean>(value: unknown): value is T;
|
|
299
|
+
//#endregion
|
|
300
|
+
//#region src/utils/typeof/isClass.d.ts
|
|
301
|
+
declare function isClass<T extends Class<AnyObject>>(value: unknown): value is T;
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region src/utils/typeof/isDate.d.ts
|
|
304
|
+
declare function isDate<T extends Date>(value: unknown): value is T;
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region src/utils/typeof/isEqual.d.ts
|
|
307
|
+
/**
|
|
308
|
+
* 判断给定的值是否相等
|
|
309
|
+
* @reference https://github.com/radashi-org/radashi/blob/main/src/typed/isEqual.ts
|
|
310
|
+
*
|
|
311
|
+
* @param {T} x
|
|
312
|
+
* @param {T} y
|
|
313
|
+
*/
|
|
314
|
+
declare function isEqual<T>(x: T, y: T): boolean;
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/utils/typeof/isError.d.ts
|
|
317
|
+
declare function isError<T extends Error>(value: unknown): value is T;
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region src/utils/typeof/isFile.d.ts
|
|
320
|
+
declare function isFile<T extends File>(value: unknown): value is T;
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region src/utils/typeof/isFunction.d.ts
|
|
323
|
+
declare function isFunction<T extends Func>(value: unknown): value is T;
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region src/utils/typeof/isGeneratorFunction.d.ts
|
|
326
|
+
declare function isGeneratorFunction<T extends Func>(value: unknown): value is T;
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region src/utils/typeof/isInteger.d.ts
|
|
329
|
+
declare function isInteger<T extends number>(value: unknown): value is T;
|
|
330
|
+
//#endregion
|
|
331
|
+
//#region src/utils/typeof/isIterable.d.ts
|
|
332
|
+
declare function isIterable<T extends Iterable<unknown>>(value: unknown): value is T;
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region src/utils/typeof/isMap.d.ts
|
|
335
|
+
declare function isMap<T extends Map<unknown, unknown>>(value: unknown): value is T;
|
|
336
|
+
//#endregion
|
|
337
|
+
//#region src/utils/typeof/isNull.d.ts
|
|
338
|
+
declare function isNull<T extends null>(value: unknown): value is T;
|
|
339
|
+
//#endregion
|
|
340
|
+
//#region src/utils/typeof/isNumber.d.ts
|
|
341
|
+
declare function isNumber<T extends number>(value: unknown): value is T;
|
|
342
|
+
//#endregion
|
|
343
|
+
//#region src/utils/typeof/isObject.d.ts
|
|
344
|
+
declare function isObject<T extends Record<PropertyKey, unknown>>(value: unknown): value is T;
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region src/utils/typeof/isPromise.d.ts
|
|
347
|
+
declare function isPromise<T extends Promise<unknown>>(value: unknown): value is T;
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region src/utils/typeof/isPromiseLike.d.ts
|
|
350
|
+
declare function isPromiseLike<T extends PromiseLike<unknown>>(value: unknown): value is T;
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region src/utils/typeof/isRegExp.d.ts
|
|
353
|
+
declare function isRegExp<T extends RegExp>(value: unknown): value is T;
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/utils/typeof/isSet.d.ts
|
|
356
|
+
declare function isSet<T extends Set<unknown>>(value: unknown): value is T;
|
|
357
|
+
//#endregion
|
|
358
|
+
//#region src/utils/typeof/isString.d.ts
|
|
359
|
+
declare function isString<T extends string>(value: unknown): value is T;
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region src/utils/typeof/isSymbol.d.ts
|
|
362
|
+
declare function isSymbol<T extends symbol>(value: unknown): value is T;
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region src/utils/typeof/isUndefined.d.ts
|
|
365
|
+
declare function isUndefined<T extends undefined>(value: unknown): value is T;
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region src/utils/typeof/isURLSearchParams.d.ts
|
|
368
|
+
declare function isURLSearchParams<T extends Window>(value: unknown): value is T;
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/utils/typeof/isWeakMap.d.ts
|
|
371
|
+
declare function isWeakMap<T extends WeakMap<AnyObject, unknown>>(value: unknown): value is T;
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region src/utils/typeof/isWeakSet.d.ts
|
|
374
|
+
declare function isWeakSet<T extends WeakSet<AnyObject>>(value: unknown): value is T;
|
|
375
|
+
//#endregion
|
|
376
|
+
//#region src/utils/typeof/isWebSocket.d.ts
|
|
377
|
+
declare function isWebSocket<T extends WebSocket>(value: unknown): value is T;
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/utils/typeof/isWindow.d.ts
|
|
380
|
+
declare function isWindow<T extends Window>(value: unknown): value is T;
|
|
381
|
+
//#endregion
|
|
382
|
+
export { arrayCast, arrayCompete, arrayCounting, arrayDifference, arrayFirst, arrayFork, arrayIntersection, arrayLast, arrayMerge, arrayPick, arrayReplace, arraySplit, cloneDeep, enumEntries, enumKeys, enumTypeCheck, enumValues, isArray, isAsyncFunction, isBigInt, isBoolean, isClass, isDate, isEqual, isError, isFile, isFunction, isGeneratorFunction, isInteger, isIterable, isMap, isNull, isNumber, isObject, isPromise, isPromiseLike, isRegExp, isSet, isString, isSymbol, isURLSearchParams, isUndefined, isWeakMap, isWeakSet, isWebSocket, isWindow, mapEntries, objectAssign, objectEntries, objectKeys, objectPick, objectSwitch, objectValues, rowsToTree, stringInitialCase, stringReplace, stringToJson, stringToValues, to, treeFilter, treeFind, treeForEach, treeMap, treeToRows };
|