@pawover/kit 0.0.0-alpha.3 → 0.0.0-alpha.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/enums.d.ts +25 -0
  2. package/dist/enums.d.ts.map +1 -0
  3. package/dist/enums.js +25 -0
  4. package/dist/enums.js.map +1 -0
  5. package/dist/hooks-alova.d.ts +23 -0
  6. package/dist/hooks-alova.d.ts.map +1 -0
  7. package/dist/hooks-alova.js +39 -0
  8. package/dist/hooks-alova.js.map +1 -0
  9. package/dist/hooks-react.d.ts +89 -0
  10. package/dist/hooks-react.d.ts.map +1 -0
  11. package/dist/hooks-react.js +334 -0
  12. package/dist/hooks-react.js.map +1 -0
  13. package/dist/index.d.ts +2388 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +1361 -2
  16. package/dist/index.js.map +1 -0
  17. package/dist/patches-fetchEventSource.d.ts +806 -0
  18. package/dist/patches-fetchEventSource.d.ts.map +1 -0
  19. package/dist/patches-fetchEventSource.js +313 -0
  20. package/dist/patches-fetchEventSource.js.map +1 -0
  21. package/dist/vite.d.ts +13 -0
  22. package/dist/vite.d.ts.map +1 -0
  23. package/dist/vite.js +22 -0
  24. package/dist/vite.js.map +1 -0
  25. package/dist/zod.d.ts +105 -0
  26. package/dist/zod.d.ts.map +1 -0
  27. package/dist/zod.js +138 -0
  28. package/dist/zod.js.map +1 -0
  29. package/metadata.json +157 -0
  30. package/package.json +57 -35
  31. package/dist/enums/index.js +0 -20
  32. package/dist/hooks/react/index.js +0 -5
  33. package/dist/hooks/react/useCreation.js +0 -11
  34. package/dist/hooks/react/useLatest.js +0 -6
  35. package/dist/hooks/react/useMount.js +0 -29
  36. package/dist/hooks/react/useResponsive.js +0 -59
  37. package/dist/hooks/react/useUnmount.js +0 -17
  38. package/dist/types/enums/index.d.ts +0 -20
  39. package/dist/types/hooks/react/index.d.ts +0 -5
  40. package/dist/types/hooks/react/useCreation.d.ts +0 -2
  41. package/dist/types/hooks/react/useLatest.d.ts +0 -1
  42. package/dist/types/hooks/react/useMount.d.ts +0 -11
  43. package/dist/types/hooks/react/useResponsive.d.ts +0 -16
  44. package/dist/types/hooks/react/useUnmount.d.ts +0 -6
  45. package/dist/types/index.d.ts +0 -2
  46. package/dist/types/utils/array.d.ts +0 -76
  47. package/dist/types/utils/index.d.ts +0 -6
  48. package/dist/types/utils/object.d.ts +0 -53
  49. package/dist/types/utils/string.d.ts +0 -13
  50. package/dist/types/utils/to.d.ts +0 -5
  51. package/dist/types/utils/tree/index.d.ts +0 -6
  52. package/dist/types/utils/tree/rowsToTree.d.ts +0 -10
  53. package/dist/types/utils/tree/treeFilter.d.ts +0 -6
  54. package/dist/types/utils/tree/treeFind.d.ts +0 -8
  55. package/dist/types/utils/tree/treeForEach.d.ts +0 -5
  56. package/dist/types/utils/tree/treeMap.d.ts +0 -6
  57. package/dist/types/utils/tree/treeToRows.d.ts +0 -9
  58. package/dist/types/utils/tree/types.d.ts +0 -24
  59. package/dist/types/utils/typeof.d.ts +0 -29
  60. package/dist/utils/array.js +0 -196
  61. package/dist/utils/index.js +0 -6
  62. package/dist/utils/object.js +0 -138
  63. package/dist/utils/string.js +0 -70
  64. package/dist/utils/to.js +0 -16
  65. package/dist/utils/tree/index.js +0 -6
  66. package/dist/utils/tree/rowsToTree.js +0 -35
  67. package/dist/utils/tree/treeFilter.js +0 -92
  68. package/dist/utils/tree/treeFind.js +0 -82
  69. package/dist/utils/tree/treeForEach.js +0 -60
  70. package/dist/utils/tree/treeMap.js +0 -79
  71. package/dist/utils/tree/treeToRows.js +0 -13
  72. package/dist/utils/tree/types.js +0 -10
  73. package/dist/utils/typeof.js +0 -114
@@ -0,0 +1,2388 @@
1
+ import { BigNumber, MathExpression, MathJsInstance, Matrix } from "mathjs";
2
+
3
+ //#region src/utils/array/arrayCast.d.ts
4
+
5
+ /**
6
+ * 构造数组
7
+ * @param candidate 待构造项
8
+ * @param checkEmpty 是否检查 `undefined` 和 `null`
9
+ */
10
+ declare function arrayCast<T>(candidate: T | T[], checkEmpty?: boolean): T[];
11
+ //#endregion
12
+ //#region src/utils/array/arrayCompete.d.ts
13
+ /**
14
+ * 数组竞争
15
+ * - 返回在匹配函数的比较条件中获胜的最终项目,适用于更复杂的最小值/最大值计算
16
+ *
17
+ * @param initialList 数组
18
+ * @param match 匹配函数
19
+ */
20
+ declare function arrayCompete<T>(initialList: readonly T[], match: (a: T, b: T) => T): T | null;
21
+ //#endregion
22
+ //#region src/utils/array/arrayCounting.d.ts
23
+ /**
24
+ * 统计数组的项目出现次数
25
+ * - 通过给定的标识符匹配函数,返回一个对象,其中键是回调函数返回的 key 值,每个值是一个整数,表示该 key 出现的次数
26
+ *
27
+ * @param initialList 初始数组
28
+ * @param match 匹配函数
29
+ */
30
+ declare function arrayCounting<T, K$1 extends PropertyKey>(initialList: readonly T[], match: (row: T) => K$1): Record<string, number>;
31
+ //#endregion
32
+ //#region src/utils/array/arrayDifference.d.ts
33
+ /**
34
+ * 求数组差集
35
+ *
36
+ * @param initialList 初始数组
37
+ * @param diffList 对比数组
38
+ * @param match 匹配函数
39
+ */
40
+ declare function arrayDifference<T>(initialList: readonly T[], diffList: readonly T[], match?: (row: T) => unknown): T[];
41
+ //#endregion
42
+ //#region src/utils/array/arrayFirst.d.ts
43
+ /**
44
+ * 获取数组第一项
45
+ *
46
+ * @param initialList 初始数组
47
+ * @param saveValue 安全值
48
+ */
49
+ declare function arrayFirst<T>(initialList: readonly T[], saveValue?: T): T | undefined;
50
+ //#endregion
51
+ //#region src/utils/array/arrayFork.d.ts
52
+ /**
53
+ * 数组分组过滤
54
+ * - 给定一个数组和一个条件,返回一个由两个数组组成的元组,其中第一个数组包含所有满足条件的项,第二个数组包含所有不满足条件的项
55
+ *
56
+ * @param initialList 初始数组
57
+ * @param match 条件匹配函数
58
+ */
59
+ declare function arrayFork<T>(initialList: readonly T[], match: (item: T) => boolean): [T[], T[]];
60
+ //#endregion
61
+ //#region src/utils/array/arrayIntersection.d.ts
62
+ /**
63
+ * 求数组交集
64
+ *
65
+ * @param initialList 初始数组
66
+ * @param diffList 对比数组
67
+ * @param match 匹配函数
68
+ */
69
+ declare function arrayIntersection<T>(initialList: readonly T[], diffList: readonly T[], match?: (row: T) => unknown): T[];
70
+ //#endregion
71
+ //#region src/utils/array/arrayLast.d.ts
72
+ /**
73
+ * 获取数组最后一项
74
+ *
75
+ * @param initialList 初始数组
76
+ * @param saveValue 安全值
77
+ */
78
+ declare function arrayLast<T>(initialList: readonly T[], saveValue?: T): T | undefined;
79
+ //#endregion
80
+ //#region src/utils/array/arrayMerge.d.ts
81
+ /**
82
+ * 数组合并
83
+ * - 通过给定的标识符匹配函数,用第二个数组中的匹配项替换第一个数组中匹配项的所有内容
84
+ *
85
+ * @param initialList 初始数组
86
+ * @param mergeList 待合并数组
87
+ * @param match 匹配函数
88
+ */
89
+ declare function arrayMerge<T>(initialList: readonly T[], mergeList: readonly T[], match?: (item: T) => unknown): T[];
90
+ //#endregion
91
+ //#region src/utils/array/arrayPick.d.ts
92
+ /**
93
+ * 数组选择
94
+ * - 一次性应用 `filter` 和 `map` 操作
95
+ *
96
+ * @param initialList 初始数组
97
+ * @param filter filter 函数
98
+ * @param mapper map 函数
99
+ */
100
+ declare function arrayPick<T, K$1 = T>(initialList: readonly T[], filter: (row: T, index: number) => boolean, mapper?: ((row: T, index: number) => K$1) | undefined): T[] | K$1[];
101
+ //#endregion
102
+ //#region src/utils/array/arrayReplace.d.ts
103
+ /**
104
+ * 数组项替换
105
+ * - 在给定的数组中,替换符合匹配函数结果的项目。只替换第一个匹配项。始终返回原始数组的副本。
106
+ *
107
+ * @param initialList 初始数组
108
+ * @param newItem 替换项
109
+ * @param match 匹配函数
110
+ */
111
+ declare function arrayReplace<T>(initialList: readonly T[], newItem: T, match: (row: T, index: number) => boolean): T[];
112
+ //#endregion
113
+ //#region src/utils/array/arraySplit.d.ts
114
+ /**
115
+ * 数组切分
116
+ * - 将数组以指定的长度切分后,组合在高维数组中
117
+ *
118
+ * @param initialList 初始数组
119
+ * @param size 分割尺寸,默认 `10`
120
+ */
121
+ declare function arraySplit<T>(initialList: readonly T[], size?: number): T[][];
122
+ //#endregion
123
+ //#region src/utils/function/to.d.ts
124
+ /**
125
+ * @param promise
126
+ * @param errorExt - 可以传递给err对象的其他信息
127
+ */
128
+ declare function to<T, U$1 = Error>(promise: Readonly<Promise<T>>, errorExt?: PlainObject): Promise<[U$1, undefined] | [null, T]>;
129
+ //#endregion
130
+ //#region src/utils/math/toMathBignumber.d.ts
131
+ /**
132
+ * 将任意类型的值转换为 `math.bignumber`
133
+ *
134
+ * @param mathJsInstance mathJs 实例
135
+ * @param value 任意类型的值
136
+ * @param saveValue 安全值
137
+ */
138
+ declare function toMathBignumber(mathJsInstance: MathJsInstance, value: unknown, saveValue?: BigNumber | undefined): BigNumber;
139
+ //#endregion
140
+ //#region src/utils/math/toMathDecimal.d.ts
141
+ /**
142
+ * 将任意类型的值转换为十进制数字字符串
143
+ *
144
+ * @param mathJsInstance mathJs 实例
145
+ * @param value 任意类型的值
146
+ * @param precision 精度
147
+ * @param isFormat 是否格式化为字符串
148
+ */
149
+ declare function toMathDecimal(mathJsInstance: MathJsInstance, value: unknown, precision?: number | undefined, isFormat?: true): string;
150
+ declare function toMathDecimal(mathJsInstance: MathJsInstance, value: unknown, precision?: number | undefined, isFormat?: false): BigNumber;
151
+ //#endregion
152
+ //#region src/utils/math/toMathEvaluate.d.ts
153
+ /**
154
+ * 数学表达式求值
155
+ *
156
+ * @param mathJsInstance mathJs 实例
157
+ * @param expr 表达式
158
+ * @param scope 键值映射
159
+ */
160
+ declare function toMathEvaluate(mathJsInstance: MathJsInstance, expr: MathExpression | Matrix, scope?: Record<string, BigNumber>): string;
161
+ //#endregion
162
+ //#region src/utils/object/cloneDeep.d.ts
163
+ interface CloningStrategy {
164
+ cloneMap: <K$1, V>(parent: Map<K$1, V>, track: (newParent: Map<K$1, V>) => Map<K$1, V>, clone: <T>(value: T) => T) => Map<K$1, V> | null;
165
+ cloneSet: <T>(parent: Set<T>, track: (newParent: Set<T>) => Set<T>, clone: <T>(value: T) => T) => Set<T> | null;
166
+ cloneArray: <T>(parent: readonly T[], track: (newParent: T[]) => T[], clone: <T>(value: T) => T) => T[] | null;
167
+ cloneObject: <T extends AnyObject>(parent: T, track: (newParent: T) => T, clone: <T>(value: T) => T) => T | null;
168
+ cloneOther: <T>(parent: T, track: (newParent: T) => T, clone: <T>(value: T) => T) => T | null;
169
+ }
170
+ /**
171
+ * cloneDeep
172
+ * @reference https://github.com/radashi-org/radashi/blob/main/src/object/cloneDeep.ts
173
+ */
174
+ declare function cloneDeep<T extends AnyObject>(root: T, customStrategy?: Partial<CloningStrategy>): T;
175
+ //#endregion
176
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/basic.d.ts
177
+ /**
178
+ Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
179
+
180
+ @category Class
181
+ */
182
+ type Class<T, Arguments extends unknown[] = any[]> = {
183
+ prototype: Pick<T, keyof T>;
184
+ new (...arguments_: Arguments): T;
185
+ };
186
+ //#endregion
187
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/union-to-intersection.d.ts
188
+ /**
189
+ Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
190
+
191
+ Inspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153).
192
+
193
+ @example
194
+ ```
195
+ import type {UnionToIntersection} from 'type-fest';
196
+
197
+ type Union = {the(): void} | {great(arg: string): void} | {escape: boolean};
198
+
199
+ type Intersection = UnionToIntersection<Union>;
200
+ //=> {the(): void; great(arg: string): void; escape: boolean};
201
+ ```
202
+
203
+ @category Type
204
+ */
205
+ type UnionToIntersection<Union> = (
206
+ // `extends unknown` is always going to be the case and is used to convert the
207
+ // `Union` into a [distributive conditional
208
+ // type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
209
+ Union extends unknown
210
+ // The union type is used as the only argument to a function since the union
211
+ // of function arguments is an intersection.
212
+ ? (distributedUnion: Union) => void
213
+ // This won't happen.
214
+ : never
215
+ // Infer the `Intersection` type since TypeScript represents the positional
216
+ // arguments of unions of functions as an intersection of the union.
217
+ ) extends ((mergedIntersection: infer Intersection) => void)
218
+ // The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`
219
+ ? Intersection & Union : never;
220
+ //#endregion
221
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/keys-of-union.d.ts
222
+ /**
223
+ Create a union of all keys from a given type, even those exclusive to specific union members.
224
+
225
+ Unlike the native `keyof` keyword, which returns keys present in **all** union members, this type returns keys from **any** member.
226
+
227
+ @link https://stackoverflow.com/a/49402091
228
+
229
+ @example
230
+ ```
231
+ import type {KeysOfUnion} from 'type-fest';
232
+
233
+ type A = {
234
+ common: string;
235
+ a: number;
236
+ };
237
+
238
+ type B = {
239
+ common: string;
240
+ b: string;
241
+ };
242
+
243
+ type C = {
244
+ common: string;
245
+ c: boolean;
246
+ };
247
+
248
+ type Union = A | B | C;
249
+
250
+ type CommonKeys = keyof Union;
251
+ //=> 'common'
252
+
253
+ type AllKeys = KeysOfUnion<Union>;
254
+ //=> 'common' | 'a' | 'b' | 'c'
255
+ ```
256
+
257
+ @category Object
258
+ */
259
+ type KeysOfUnion<ObjectType> =
260
+ // Hack to fix https://github.com/sindresorhus/type-fest/issues/1008
261
+ keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;
262
+ //#endregion
263
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/is-any.d.ts
264
+ /**
265
+ Returns a boolean for whether the given type is `any`.
266
+
267
+ @link https://stackoverflow.com/a/49928360/1490091
268
+
269
+ Useful in type utilities, such as disallowing `any`s to be passed to a function.
270
+
271
+ @example
272
+ ```
273
+ import type {IsAny} from 'type-fest';
274
+
275
+ const typedObject = {a: 1, b: 2} as const;
276
+ const anyObject: any = {a: 1, b: 2};
277
+
278
+ function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(object: O, key: K) {
279
+ return object[key];
280
+ }
281
+
282
+ const typedA = get(typedObject, 'a');
283
+ //=> 1
284
+
285
+ const anyA = get(anyObject, 'a');
286
+ //=> any
287
+ ```
288
+
289
+ @category Type Guard
290
+ @category Utilities
291
+ */
292
+ type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
293
+ //#endregion
294
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/is-optional-key-of.d.ts
295
+ /**
296
+ Returns a boolean for whether the given key is an optional key of type.
297
+
298
+ This is useful when writing utility types or schema validators that need to differentiate `optional` keys.
299
+
300
+ @example
301
+ ```
302
+ import type {IsOptionalKeyOf} from 'type-fest';
303
+
304
+ type User = {
305
+ name: string;
306
+ surname: string;
307
+
308
+ luckyNumber?: number;
309
+ };
310
+
311
+ type Admin = {
312
+ name: string;
313
+ surname?: string;
314
+ };
315
+
316
+ type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
317
+ //=> true
318
+
319
+ type T2 = IsOptionalKeyOf<User, 'name'>;
320
+ //=> false
321
+
322
+ type T3 = IsOptionalKeyOf<User, 'name' | 'luckyNumber'>;
323
+ //=> boolean
324
+
325
+ type T4 = IsOptionalKeyOf<User | Admin, 'name'>;
326
+ //=> false
327
+
328
+ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
329
+ //=> boolean
330
+ ```
331
+
332
+ @category Type Guard
333
+ @category Utilities
334
+ */
335
+ type IsOptionalKeyOf<Type extends object, Key$1 extends keyof Type> = IsAny<Type | Key$1> extends true ? never : Key$1 extends keyof Type ? Type extends Record<Key$1, Type[Key$1]> ? false : true : false;
336
+ //#endregion
337
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/optional-keys-of.d.ts
338
+ /**
339
+ Extract all optional keys from the given type.
340
+
341
+ This is useful when you want to create a new type that contains different type values for the optional keys only.
342
+
343
+ @example
344
+ ```
345
+ import type {OptionalKeysOf, Except} from 'type-fest';
346
+
347
+ type User = {
348
+ name: string;
349
+ surname: string;
350
+
351
+ luckyNumber?: number;
352
+ };
353
+
354
+ const REMOVE_FIELD = Symbol('remove field symbol');
355
+ type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
356
+ [Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
357
+ };
358
+
359
+ const update1: UpdateOperation<User> = {
360
+ name: 'Alice',
361
+ };
362
+
363
+ const update2: UpdateOperation<User> = {
364
+ name: 'Bob',
365
+ luckyNumber: REMOVE_FIELD,
366
+ };
367
+ ```
368
+
369
+ @category Utilities
370
+ */
371
+ type OptionalKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
372
+ ? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
373
+ : never;
374
+ //#endregion
375
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/required-keys-of.d.ts
376
+ /**
377
+ Extract all required keys from the given type.
378
+
379
+ This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...
380
+
381
+ @example
382
+ ```
383
+ import type {RequiredKeysOf} from 'type-fest';
384
+
385
+ declare function createValidation<
386
+ Entity extends object,
387
+ Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
388
+ >(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
389
+
390
+ type User = {
391
+ name: string;
392
+ surname: string;
393
+ luckyNumber?: number;
394
+ };
395
+
396
+ const validator1 = createValidation<User>('name', value => value.length < 25);
397
+ const validator2 = createValidation<User>('surname', value => value.length < 25);
398
+
399
+ // @ts-expect-error
400
+ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
401
+ // Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
402
+ ```
403
+
404
+ @category Utilities
405
+ */
406
+ type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
407
+ ? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
408
+ //#endregion
409
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/has-required-keys.d.ts
410
+ /**
411
+ Creates a type that represents `true` or `false` depending on whether the given type has any required fields.
412
+
413
+ This is useful when you want to create an API whose behavior depends on the presence or absence of required fields.
414
+
415
+ @example
416
+ ```
417
+ import type {HasRequiredKeys} from 'type-fest';
418
+
419
+ type GeneratorOptions<Template extends object> = {
420
+ prop1: number;
421
+ prop2: string;
422
+ } & (HasRequiredKeys<Template> extends true
423
+ ? {template: Template}
424
+ : {template?: Template});
425
+
426
+ type Template1 = {
427
+ optionalSubParam?: string;
428
+ };
429
+
430
+ type Template2 = {
431
+ requiredSubParam: string;
432
+ };
433
+
434
+ type Options1 = GeneratorOptions<Template1>;
435
+ type Options2 = GeneratorOptions<Template2>;
436
+
437
+ const optA: Options1 = {
438
+ prop1: 0,
439
+ prop2: 'hi',
440
+ };
441
+ const optB: Options1 = {
442
+ prop1: 0,
443
+ prop2: 'hi',
444
+ template: {},
445
+ };
446
+ const optC: Options1 = {
447
+ prop1: 0,
448
+ prop2: 'hi',
449
+ template: {
450
+ optionalSubParam: 'optional value',
451
+ },
452
+ };
453
+
454
+ const optD: Options2 = {
455
+ prop1: 0,
456
+ prop2: 'hi',
457
+ template: {
458
+ requiredSubParam: 'required value',
459
+ },
460
+ };
461
+
462
+ ```
463
+
464
+ @category Utilities
465
+ */
466
+ type HasRequiredKeys<BaseType extends object> = RequiredKeysOf<BaseType> extends never ? false : true;
467
+ //#endregion
468
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/is-never.d.ts
469
+ /**
470
+ Returns a boolean for whether the given type is `never`.
471
+
472
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
473
+ @link https://stackoverflow.com/a/53984913/10292952
474
+ @link https://www.zhenghao.io/posts/ts-never
475
+
476
+ Useful in type utilities, such as checking if something does not occur.
477
+
478
+ @example
479
+ ```
480
+ import type {IsNever, And} from 'type-fest';
481
+
482
+ type A = IsNever<never>;
483
+ //=> true
484
+
485
+ type B = IsNever<any>;
486
+ //=> false
487
+
488
+ type C = IsNever<unknown>;
489
+ //=> false
490
+
491
+ type D = IsNever<never[]>;
492
+ //=> false
493
+
494
+ type E = IsNever<object>;
495
+ //=> false
496
+
497
+ type F = IsNever<string>;
498
+ //=> false
499
+ ```
500
+
501
+ @example
502
+ ```
503
+ import type {IsNever} from 'type-fest';
504
+
505
+ type IsTrue<T> = T extends true ? true : false;
506
+
507
+ // When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
508
+ type A = IsTrue<never>;
509
+ // ^? type A = never
510
+
511
+ // If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
512
+ type IsTrueFixed<T> =
513
+ IsNever<T> extends true ? false : T extends true ? true : false;
514
+
515
+ type B = IsTrueFixed<never>;
516
+ // ^? type B = false
517
+ ```
518
+
519
+ @category Type Guard
520
+ @category Utilities
521
+ */
522
+ type IsNever<T> = [T] extends [never] ? true : false;
523
+ //#endregion
524
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/if.d.ts
525
+ /**
526
+ An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
527
+
528
+ Use-cases:
529
+ - You can use this in combination with `Is*` types to create an if-else-like experience. For example, `If<IsAny<any>, 'is any', 'not any'>`.
530
+
531
+ Note:
532
+ - Returns a union of if branch and else branch if the given type is `boolean` or `any`. For example, `If<boolean, 'Y', 'N'>` will return `'Y' | 'N'`.
533
+ - Returns the else branch if the given type is `never`. For example, `If<never, 'Y', 'N'>` will return `'N'`.
534
+
535
+ @example
536
+ ```
537
+ import type {If} from 'type-fest';
538
+
539
+ type A = If<true, 'yes', 'no'>;
540
+ //=> 'yes'
541
+
542
+ type B = If<false, 'yes', 'no'>;
543
+ //=> 'no'
544
+
545
+ type C = If<boolean, 'yes', 'no'>;
546
+ //=> 'yes' | 'no'
547
+
548
+ type D = If<any, 'yes', 'no'>;
549
+ //=> 'yes' | 'no'
550
+
551
+ type E = If<never, 'yes', 'no'>;
552
+ //=> 'no'
553
+ ```
554
+
555
+ @example
556
+ ```
557
+ import type {If, IsAny, IsNever} from 'type-fest';
558
+
559
+ type A = If<IsAny<unknown>, 'is any', 'not any'>;
560
+ //=> 'not any'
561
+
562
+ type B = If<IsNever<never>, 'is never', 'not never'>;
563
+ //=> 'is never'
564
+ ```
565
+
566
+ @example
567
+ ```
568
+ import type {If, IsEqual} from 'type-fest';
569
+
570
+ type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
571
+
572
+ type A = IfEqual<string, string, 'equal', 'not equal'>;
573
+ //=> 'equal'
574
+
575
+ type B = IfEqual<string, number, 'equal', 'not equal'>;
576
+ //=> 'not equal'
577
+ ```
578
+
579
+ Note: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:
580
+
581
+ @example
582
+ ```
583
+ import type {If, IsEqual, StringRepeat} from 'type-fest';
584
+
585
+ type HundredZeroes = StringRepeat<'0', 100>;
586
+
587
+ // The following implementation is not tail recursive
588
+ type Includes<S extends string, Char extends string> =
589
+ S extends `${infer First}${infer Rest}`
590
+ ? If<IsEqual<First, Char>,
591
+ 'found',
592
+ Includes<Rest, Char>>
593
+ : 'not found';
594
+
595
+ // Hence, instantiations with long strings will fail
596
+ // @ts-expect-error
597
+ type Fails = Includes<HundredZeroes, '1'>;
598
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
599
+ // Error: Type instantiation is excessively deep and possibly infinite.
600
+
601
+ // However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
602
+ type IncludesWithoutIf<S extends string, Char extends string> =
603
+ S extends `${infer First}${infer Rest}`
604
+ ? IsEqual<First, Char> extends true
605
+ ? 'found'
606
+ : IncludesWithoutIf<Rest, Char>
607
+ : 'not found';
608
+
609
+ // Now, instantiations with long strings will work
610
+ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
611
+ //=> 'not found'
612
+ ```
613
+
614
+ @category Type Guard
615
+ @category Utilities
616
+ */
617
+ type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
618
+ //#endregion
619
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/internal/type.d.ts
620
+ /**
621
+ An if-else-like type that resolves depending on whether the given type is `any` or `never`.
622
+
623
+ @example
624
+ ```
625
+ // When `T` is a NOT `any` or `never` (like `string`) => Returns `IfNotAnyOrNever` branch
626
+ type A = IfNotAnyOrNever<string, 'VALID', 'IS_ANY', 'IS_NEVER'>;
627
+ //=> 'VALID'
628
+
629
+ // When `T` is `any` => Returns `IfAny` branch
630
+ type B = IfNotAnyOrNever<any, 'VALID', 'IS_ANY', 'IS_NEVER'>;
631
+ //=> 'IS_ANY'
632
+
633
+ // When `T` is `never` => Returns `IfNever` branch
634
+ type C = IfNotAnyOrNever<never, 'VALID', 'IS_ANY', 'IS_NEVER'>;
635
+ //=> 'IS_NEVER'
636
+ ```
637
+
638
+ Note: Wrapping a tail-recursive type with `IfNotAnyOrNever` makes the implementation non-tail-recursive. To fix this, move the recursion into a helper type. Refer to the following example:
639
+
640
+ @example
641
+ ```ts
642
+ import type {StringRepeat} from 'type-fest';
643
+
644
+ type NineHundredNinetyNineSpaces = StringRepeat<' ', 999>;
645
+
646
+ // The following implementation is not tail recursive
647
+ type TrimLeft<S extends string> = IfNotAnyOrNever<S, S extends ` ${infer R}` ? TrimLeft<R> : S>;
648
+
649
+ // Hence, instantiations with long strings will fail
650
+ // @ts-expect-error
651
+ type T1 = TrimLeft<NineHundredNinetyNineSpaces>;
652
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
653
+ // Error: Type instantiation is excessively deep and possibly infinite.
654
+
655
+ // To fix this, move the recursion into a helper type
656
+ type TrimLeftOptimised<S extends string> = IfNotAnyOrNever<S, _TrimLeftOptimised<S>>;
657
+
658
+ type _TrimLeftOptimised<S extends string> = S extends ` ${infer R}` ? _TrimLeftOptimised<R> : S;
659
+
660
+ type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
661
+ //=> ''
662
+ ```
663
+ */
664
+ type IfNotAnyOrNever<T, IfNotAnyOrNever$1, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever$1>>;
665
+ //#endregion
666
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/simplify.d.ts
667
+ /**
668
+ Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
669
+
670
+ @example
671
+ ```
672
+ import type {Simplify} from 'type-fest';
673
+
674
+ type PositionProps = {
675
+ top: number;
676
+ left: number;
677
+ };
678
+
679
+ type SizeProps = {
680
+ width: number;
681
+ height: number;
682
+ };
683
+
684
+ // In your editor, hovering over `Props` will show a flattened object with all the properties.
685
+ type Props = Simplify<PositionProps & SizeProps>;
686
+ ```
687
+
688
+ Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.
689
+
690
+ If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.
691
+
692
+ @example
693
+ ```
694
+ import type {Simplify} from 'type-fest';
695
+
696
+ interface SomeInterface {
697
+ foo: number;
698
+ bar?: string;
699
+ baz: number | undefined;
700
+ }
701
+
702
+ type SomeType = {
703
+ foo: number;
704
+ bar?: string;
705
+ baz: number | undefined;
706
+ };
707
+
708
+ const literal = {foo: 123, bar: 'hello', baz: 456};
709
+ const someType: SomeType = literal;
710
+ const someInterface: SomeInterface = literal;
711
+
712
+ declare function fn(object: Record<string, unknown>): void;
713
+
714
+ fn(literal); // Good: literal object type is sealed
715
+ fn(someType); // Good: type is sealed
716
+ // @ts-expect-error
717
+ fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
718
+ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
719
+ ```
720
+
721
+ @link https://github.com/microsoft/TypeScript/issues/15300
722
+ @see {@link SimplifyDeep}
723
+ @category Object
724
+ */
725
+ type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
726
+ //#endregion
727
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/is-equal.d.ts
728
+ /**
729
+ Returns a boolean for whether the two given types are equal.
730
+
731
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
732
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
733
+
734
+ Use-cases:
735
+ - If you want to make a conditional branch based on the result of a comparison of two types.
736
+
737
+ @example
738
+ ```
739
+ import type {IsEqual} from 'type-fest';
740
+
741
+ // This type returns a boolean for whether the given array includes the given item.
742
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
743
+ type Includes<Value extends readonly any[], Item> =
744
+ Value extends readonly [Value[0], ...infer rest]
745
+ ? IsEqual<Value[0], Item> extends true
746
+ ? true
747
+ : Includes<rest, Item>
748
+ : false;
749
+ ```
750
+
751
+ @category Type Guard
752
+ @category Utilities
753
+ */
754
+ type IsEqual<A$1, B$1> = [A$1] extends [B$1] ? [B$1] extends [A$1] ? _IsEqual<A$1, B$1> : false : false;
755
+ // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
756
+ type _IsEqual<A$1, B$1> = (<G>() => G extends A$1 & G | G ? 1 : 2) extends (<G>() => G extends B$1 & G | G ? 1 : 2) ? true : false;
757
+ //#endregion
758
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/omit-index-signature.d.ts
759
+ /**
760
+ Omit any index signatures from the given object type, leaving only explicitly defined properties.
761
+
762
+ This is the counterpart of `PickIndexSignature`.
763
+
764
+ Use-cases:
765
+ - Remove overly permissive signatures from third-party types.
766
+
767
+ This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747).
768
+
769
+ It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record<string, unknown>`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', unknown>`.
770
+
771
+ (The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.)
772
+
773
+ ```
774
+ const indexed: Record<string, unknown> = {}; // Allowed
775
+
776
+ // @ts-expect-error
777
+ const keyed: Record<'foo', unknown> = {}; // Error
778
+ // => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
779
+ ```
780
+
781
+ Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another:
782
+
783
+ ```
784
+ type Indexed = {} extends Record<string, unknown>
785
+ ? '✅ `{}` is assignable to `Record<string, unknown>`'
786
+ : '❌ `{}` is NOT assignable to `Record<string, unknown>`';
787
+ // => '✅ `{}` is assignable to `Record<string, unknown>`'
788
+
789
+ type Keyed = {} extends Record<'foo' | 'bar', unknown>
790
+ ? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`'
791
+ : '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`';
792
+ // => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"
793
+ ```
794
+
795
+ Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`...
796
+
797
+ ```
798
+ type OmitIndexSignature<ObjectType> = {
799
+ [KeyType in keyof ObjectType // Map each key of `ObjectType`...
800
+ ]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
801
+ };
802
+ ```
803
+
804
+ ...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
805
+
806
+ ```
807
+ type OmitIndexSignature<ObjectType> = {
808
+ [KeyType in keyof ObjectType
809
+ // Is `{}` assignable to `Record<KeyType, unknown>`?
810
+ as {} extends Record<KeyType, unknown>
811
+ ? never // ✅ `{}` is assignable to `Record<KeyType, unknown>`
812
+ : KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
813
+ ]: ObjectType[KeyType];
814
+ };
815
+ ```
816
+
817
+ If `{}` is assignable, it means that `KeyType` is an index signature and we want to remove it. If it is not assignable, `KeyType` is a "real" key and we want to keep it.
818
+
819
+ @example
820
+ ```
821
+ import type {OmitIndexSignature} from 'type-fest';
822
+
823
+ type Example = {
824
+ // These index signatures will be removed.
825
+ [x: string]: any;
826
+ [x: number]: any;
827
+ [x: symbol]: any;
828
+ [x: `head-${string}`]: string;
829
+ [x: `${string}-tail`]: string;
830
+ [x: `head-${string}-tail`]: string;
831
+ [x: `${bigint}`]: string;
832
+ [x: `embedded-${number}`]: string;
833
+
834
+ // These explicitly defined keys will remain.
835
+ foo: 'bar';
836
+ qux?: 'baz';
837
+ };
838
+
839
+ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
840
+ // => { foo: 'bar'; qux?: 'baz' | undefined; }
841
+ ```
842
+
843
+ @see {@link PickIndexSignature}
844
+ @category Object
845
+ */
846
+ type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
847
+ //#endregion
848
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/pick-index-signature.d.ts
849
+ /**
850
+ Pick only index signatures from the given object type, leaving out all explicitly defined properties.
851
+
852
+ This is the counterpart of `OmitIndexSignature`.
853
+
854
+ @example
855
+ ```
856
+ import type {PickIndexSignature} from 'type-fest';
857
+
858
+ declare const symbolKey: unique symbol;
859
+
860
+ type Example = {
861
+ // These index signatures will remain.
862
+ [x: string]: unknown;
863
+ [x: number]: unknown;
864
+ [x: symbol]: unknown;
865
+ [x: `head-${string}`]: string;
866
+ [x: `${string}-tail`]: string;
867
+ [x: `head-${string}-tail`]: string;
868
+ [x: `${bigint}`]: string;
869
+ [x: `embedded-${number}`]: string;
870
+
871
+ // These explicitly defined keys will be removed.
872
+ ['kebab-case-key']: string;
873
+ [symbolKey]: string;
874
+ foo: 'bar';
875
+ qux?: 'baz';
876
+ };
877
+
878
+ type ExampleIndexSignature = PickIndexSignature<Example>;
879
+ // {
880
+ // [x: string]: unknown;
881
+ // [x: number]: unknown;
882
+ // [x: symbol]: unknown;
883
+ // [x: `head-${string}`]: string;
884
+ // [x: `${string}-tail`]: string;
885
+ // [x: `head-${string}-tail`]: string;
886
+ // [x: `${bigint}`]: string;
887
+ // [x: `embedded-${number}`]: string;
888
+ // }
889
+ ```
890
+
891
+ @see {@link OmitIndexSignature}
892
+ @category Object
893
+ */
894
+ type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
895
+ //#endregion
896
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/merge.d.ts
897
+ // Merges two objects without worrying about index signatures.
898
+ type SimpleMerge<Destination, Source> = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source;
899
+
900
+ /**
901
+ Merge two types into a new type. Keys of the second type overrides keys of the first type.
902
+
903
+ @example
904
+ ```
905
+ import type {Merge} from 'type-fest';
906
+
907
+ type Foo = {
908
+ [x: string]: unknown;
909
+ [x: number]: unknown;
910
+ foo: string;
911
+ bar: symbol;
912
+ };
913
+
914
+ type Bar = {
915
+ [x: number]: number;
916
+ [x: symbol]: unknown;
917
+ bar: Date;
918
+ baz: boolean;
919
+ };
920
+
921
+ export type FooBar = Merge<Foo, Bar>;
922
+ // => {
923
+ // [x: string]: unknown;
924
+ // [x: number]: number;
925
+ // [x: symbol]: unknown;
926
+ // foo: string;
927
+ // bar: Date;
928
+ // baz: boolean;
929
+ // }
930
+ ```
931
+
932
+ @category Object
933
+ */
934
+ type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
935
+ //#endregion
936
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/internal/object.d.ts
937
+ /**
938
+ Works similar to the built-in `Pick` utility type, except for the following differences:
939
+ - Distributes over union types and allows picking keys from any member of the union type.
940
+ - Primitives types are returned as-is.
941
+ - Picks all keys if `Keys` is `any`.
942
+ - Doesn't pick `number` from a `string` index signature.
943
+
944
+ @example
945
+ ```
946
+ type ImageUpload = {
947
+ url: string;
948
+ size: number;
949
+ thumbnailUrl: string;
950
+ };
951
+
952
+ type VideoUpload = {
953
+ url: string;
954
+ duration: number;
955
+ encodingFormat: string;
956
+ };
957
+
958
+ // Distributes over union types and allows picking keys from any member of the union type
959
+ type MediaDisplay = HomomorphicPick<ImageUpload | VideoUpload, "url" | "size" | "duration">;
960
+ //=> {url: string; size: number} | {url: string; duration: number}
961
+
962
+ // Primitive types are returned as-is
963
+ type Primitive = HomomorphicPick<string | number, 'toUpperCase' | 'toString'>;
964
+ //=> string | number
965
+
966
+ // Picks all keys if `Keys` is `any`
967
+ type Any = HomomorphicPick<{a: 1; b: 2} | {c: 3}, any>;
968
+ //=> {a: 1; b: 2} | {c: 3}
969
+
970
+ // Doesn't pick `number` from a `string` index signature
971
+ type IndexSignature = HomomorphicPick<{[k: string]: unknown}, number>;
972
+ //=> {}
973
+ */
974
+ type HomomorphicPick<T, Keys extends KeysOfUnion<T>> = { [P in keyof T as Extract<P, Keys>]: T[P] };
975
+ /**
976
+ Merges user specified options with default options.
977
+
978
+ @example
979
+ ```
980
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
981
+ type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
982
+ type SpecifiedOptions = {leavesOnly: true};
983
+
984
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
985
+ //=> {maxRecursionDepth: 10; leavesOnly: true}
986
+ ```
987
+
988
+ @example
989
+ ```
990
+ // Complains if default values are not provided for optional options
991
+
992
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
993
+ type DefaultPathsOptions = {maxRecursionDepth: 10};
994
+ type SpecifiedOptions = {};
995
+
996
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
997
+ // ~~~~~~~~~~~~~~~~~~~
998
+ // Property 'leavesOnly' is missing in type 'DefaultPathsOptions' but required in type '{ maxRecursionDepth: number; leavesOnly: boolean; }'.
999
+ ```
1000
+
1001
+ @example
1002
+ ```
1003
+ // Complains if an option's default type does not conform to the expected type
1004
+
1005
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
1006
+ type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'};
1007
+ type SpecifiedOptions = {};
1008
+
1009
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
1010
+ // ~~~~~~~~~~~~~~~~~~~
1011
+ // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
1012
+ ```
1013
+
1014
+ @example
1015
+ ```
1016
+ // Complains if an option's specified type does not conform to the expected type
1017
+
1018
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
1019
+ type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
1020
+ type SpecifiedOptions = {leavesOnly: 'yes'};
1021
+
1022
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
1023
+ // ~~~~~~~~~~~~~~~~
1024
+ // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
1025
+ ```
1026
+ */
1027
+ type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required<Options>>>>;
1028
+ //#endregion
1029
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/except.d.ts
1030
+ /**
1031
+ Filter out keys from an object.
1032
+
1033
+ Returns `never` if `Exclude` is strictly equal to `Key`.
1034
+ Returns `never` if `Key` extends `Exclude`.
1035
+ Returns `Key` otherwise.
1036
+
1037
+ @example
1038
+ ```
1039
+ type Filtered = Filter<'foo', 'foo'>;
1040
+ //=> never
1041
+ ```
1042
+
1043
+ @example
1044
+ ```
1045
+ type Filtered = Filter<'bar', string>;
1046
+ //=> never
1047
+ ```
1048
+
1049
+ @example
1050
+ ```
1051
+ type Filtered = Filter<'bar', 'foo'>;
1052
+ //=> 'bar'
1053
+ ```
1054
+
1055
+ @see {Except}
1056
+ */
1057
+ type Filter<KeyType$1, ExcludeType> = IsEqual<KeyType$1, ExcludeType> extends true ? never : (KeyType$1 extends ExcludeType ? never : KeyType$1);
1058
+ type ExceptOptions = {
1059
+ /**
1060
+ Disallow assigning non-specified properties.
1061
+ Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
1062
+ @default false
1063
+ */
1064
+ requireExactProps?: boolean;
1065
+ };
1066
+ type DefaultExceptOptions = {
1067
+ requireExactProps: false;
1068
+ };
1069
+
1070
+ /**
1071
+ Create a type from an object type without certain keys.
1072
+
1073
+ We recommend setting the `requireExactProps` option to `true`.
1074
+
1075
+ This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
1076
+
1077
+ This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
1078
+
1079
+ @example
1080
+ ```
1081
+ import type {Except} from 'type-fest';
1082
+
1083
+ type Foo = {
1084
+ a: number;
1085
+ b: string;
1086
+ };
1087
+
1088
+ type FooWithoutA = Except<Foo, 'a'>;
1089
+ //=> {b: string}
1090
+
1091
+ // @ts-expect-error
1092
+ const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
1093
+ //=> errors: 'a' does not exist in type '{ b: string; }'
1094
+
1095
+ type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
1096
+ //=> {a: number} & Partial<Record<"b", never>>
1097
+
1098
+ // @ts-expect-error
1099
+ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
1100
+ //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
1101
+
1102
+ // The `Omit` utility type doesn't work when omitting specific keys from objects containing index signatures.
1103
+
1104
+ // Consider the following example:
1105
+
1106
+ type UserData = {
1107
+ [metadata: string]: string;
1108
+ email: string;
1109
+ name: string;
1110
+ role: 'admin' | 'user';
1111
+ };
1112
+
1113
+ // `Omit` clearly doesn't behave as expected in this case:
1114
+ type PostPayload = Omit<UserData, 'email'>;
1115
+ //=> { [x: string]: string; [x: number]: string; }
1116
+
1117
+ // In situations like this, `Except` works better.
1118
+ // It simply removes the `email` key while preserving all the other keys.
1119
+ type PostPayloadFixed = Except<UserData, 'email'>;
1120
+ //=> { [x: string]: string; name: string; role: 'admin' | 'user'; }
1121
+ ```
1122
+
1123
+ @category Object
1124
+ */
1125
+ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
1126
+ type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType] } & (Options['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {});
1127
+ //#endregion
1128
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/require-at-least-one.d.ts
1129
+ /**
1130
+ Create a type that requires at least one of the given keys. The remaining keys are kept as is.
1131
+
1132
+ @example
1133
+ ```
1134
+ import type {RequireAtLeastOne} from 'type-fest';
1135
+
1136
+ type Responder = {
1137
+ text?: () => string;
1138
+ json?: () => string;
1139
+ secure?: boolean;
1140
+ };
1141
+
1142
+ const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
1143
+ json: () => '{"message": "ok"}',
1144
+ secure: true,
1145
+ };
1146
+ ```
1147
+
1148
+ @category Object
1149
+ */
1150
+ type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, If<IsNever<KeysType>, never, _RequireAtLeastOne<ObjectType, If<IsAny<KeysType>, keyof ObjectType, KeysType>>>>;
1151
+ type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = {
1152
+ // For each `Key` in `KeysType` make a mapped type:
1153
+ [Key in KeysType]-?: Required<Pick<ObjectType, Key>> &
1154
+ // 1. Make `Key`'s type required
1155
+ // 2. Make all other keys in `KeysType` optional
1156
+ Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] &
1157
+ // 3. Add the remaining keys not in `KeysType`
1158
+ Except<ObjectType, KeysType>;
1159
+ //#endregion
1160
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/non-empty-object.d.ts
1161
+ /**
1162
+ Represents an object with at least 1 non-optional key.
1163
+
1164
+ This is useful when you need an object where all keys are optional, but there must be at least 1 key.
1165
+
1166
+ @example
1167
+ ```
1168
+ import type {NonEmptyObject} from 'type-fest';
1169
+
1170
+ type User = {
1171
+ name: string;
1172
+ surname: string;
1173
+ id: number;
1174
+ };
1175
+
1176
+ type UpdateRequest<Entity extends object> = NonEmptyObject<Partial<Entity>>;
1177
+
1178
+ const update1: UpdateRequest<User> = {
1179
+ name: 'Alice',
1180
+ surname: 'Acme',
1181
+ };
1182
+
1183
+ // At least 1 key is required, therefore this will report a 2322 error:
1184
+ // Type '{}' is not assignable to type 'UpdateRequest<User>'
1185
+ // @ts-expect-error
1186
+ const update2: UpdateRequest<User> = {};
1187
+ ```
1188
+
1189
+ @see Use `IsEmptyObject` to check whether an object is empty.
1190
+
1191
+ @category Object
1192
+ */
1193
+ type NonEmptyObject<T extends object> = HasRequiredKeys<T> extends true ? T : RequireAtLeastOne<T, keyof T>;
1194
+ //#endregion
1195
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/union-to-tuple.d.ts
1196
+ /**
1197
+ Returns the last element of a union type.
1198
+
1199
+ @example
1200
+ ```
1201
+ type Last = LastOfUnion<1 | 2 | 3>;
1202
+ //=> 3
1203
+ ```
1204
+ */
1205
+ type LastOfUnion<T> = UnionToIntersection<T extends any ? () => T : never> extends (() => (infer R)) ? R : never;
1206
+
1207
+ /**
1208
+ Convert a union type into an unordered tuple type of its elements.
1209
+
1210
+ "Unordered" means the elements of the tuple are not guaranteed to be in the same order as in the union type. The arrangement can appear random and may change at any time.
1211
+
1212
+ This can be useful when you have objects with a finite set of keys and want a type defining only the allowed keys, but do not want to repeat yourself.
1213
+
1214
+ @example
1215
+ ```
1216
+ import type {UnionToTuple} from 'type-fest';
1217
+
1218
+ type Numbers = 1 | 2 | 3;
1219
+ type NumbersTuple = UnionToTuple<Numbers>;
1220
+ //=> [1, 2, 3]
1221
+ ```
1222
+
1223
+ @example
1224
+ ```
1225
+ import type {UnionToTuple} from 'type-fest';
1226
+
1227
+ const pets = {
1228
+ dog: '🐶',
1229
+ cat: '🐱',
1230
+ snake: '🐍',
1231
+ };
1232
+
1233
+ type Pet = keyof typeof pets;
1234
+ //=> 'dog' | 'cat' | 'snake'
1235
+
1236
+ const petList = Object.keys(pets) as UnionToTuple<Pet>;
1237
+ //=> ['dog', 'cat', 'snake']
1238
+ ```
1239
+
1240
+ @category Array
1241
+ */
1242
+ type UnionToTuple<T, L = LastOfUnion<T>> = IsNever<T> extends false ? [...UnionToTuple<Exclude<T, L>>, L] : [];
1243
+ //#endregion
1244
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/set-optional.d.ts
1245
+ /**
1246
+ Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the `SetRequired` type.
1247
+
1248
+ Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional.
1249
+
1250
+ @example
1251
+ ```
1252
+ import type {SetOptional} from 'type-fest';
1253
+
1254
+ type Foo = {
1255
+ a: number;
1256
+ b?: string;
1257
+ c: boolean;
1258
+ };
1259
+
1260
+ type SomeOptional = SetOptional<Foo, 'b' | 'c'>;
1261
+ // type SomeOptional = {
1262
+ // a: number;
1263
+ // b?: string; // Was already optional and still is.
1264
+ // c?: boolean; // Is now optional.
1265
+ // }
1266
+ ```
1267
+
1268
+ @category Object
1269
+ */
1270
+ type SetOptional<BaseType, Keys extends keyof BaseType> = (BaseType extends ((...arguments_: never) => any) ? (...arguments_: Parameters<BaseType>) => ReturnType<BaseType> : unknown) & _SetOptional<BaseType, Keys>;
1271
+ type _SetOptional<BaseType, Keys extends keyof BaseType> = BaseType extends unknown // To distribute `BaseType` when it's a union type.
1272
+ ? Simplify<
1273
+ // Pick just the keys that are readonly from the base type.
1274
+ Except<BaseType, Keys> &
1275
+ // Pick the keys that should be mutable from the base type and make them mutable.
1276
+ Partial<HomomorphicPick<BaseType, Keys>>> : never;
1277
+ //#endregion
1278
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/value-of.d.ts
1279
+ /**
1280
+ Create a union of the given object's values, and optionally specify which keys to get the values from.
1281
+
1282
+ Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31438) if you want to have this type as a built-in in TypeScript.
1283
+
1284
+ @example
1285
+ ```
1286
+ import type {ValueOf} from 'type-fest';
1287
+
1288
+ type A = ValueOf<{id: number; name: string; active: boolean}>;
1289
+ //=> number | string | boolean
1290
+
1291
+ type B = ValueOf<{id: number; name: string; active: boolean}, 'name'>;
1292
+ //=> string
1293
+
1294
+ type C = ValueOf<{id: number; name: string; active: boolean}, 'id' | 'name'>;
1295
+ //=> number | string
1296
+ ```
1297
+
1298
+ @category Object
1299
+ */
1300
+ type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
1301
+ //#endregion
1302
+ //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/replace.d.ts
1303
+ type ReplaceOptions = {
1304
+ all?: boolean;
1305
+ };
1306
+ type DefaultReplaceOptions = {
1307
+ all: false;
1308
+ };
1309
+
1310
+ /**
1311
+ Represents a string with some or all matches replaced by a replacement.
1312
+
1313
+ Use-case:
1314
+ - `kebab-case-path` to `dotted.path.notation`
1315
+ - Changing date/time format: `01-08-2042` → `01/08/2042`
1316
+ - Manipulation of type properties, for example, removal of prefixes
1317
+
1318
+ @example
1319
+ ```
1320
+ import type {Replace} from 'type-fest';
1321
+
1322
+ declare function replace<
1323
+ Input extends string,
1324
+ Search extends string,
1325
+ Replacement extends string,
1326
+ >(
1327
+ input: Input,
1328
+ search: Search,
1329
+ replacement: Replacement
1330
+ ): Replace<Input, Search, Replacement>;
1331
+
1332
+ declare function replaceAll<
1333
+ Input extends string,
1334
+ Search extends string,
1335
+ Replacement extends string,
1336
+ >(
1337
+ input: Input,
1338
+ search: Search,
1339
+ replacement: Replacement
1340
+ ): Replace<Input, Search, Replacement, {all: true}>;
1341
+
1342
+ // The return type is the exact string literal, not just `string`.
1343
+
1344
+ replace('hello ?', '?', '🦄');
1345
+ //=> 'hello 🦄'
1346
+
1347
+ replace('hello ??', '?', '❓');
1348
+ //=> 'hello ❓?'
1349
+
1350
+ replaceAll('10:42:00', ':', '-');
1351
+ //=> '10-42-00'
1352
+
1353
+ replaceAll('__userName__', '__', '');
1354
+ //=> 'userName'
1355
+
1356
+ replaceAll('My Cool Title', ' ', '');
1357
+ //=> 'MyCoolTitle'
1358
+ ```
1359
+
1360
+ @category String
1361
+ @category Template literal
1362
+ */
1363
+ type Replace<Input extends string, Search extends string, Replacement extends string, Options extends ReplaceOptions = {}> = _Replace<Input, Search, Replacement, ApplyDefaultOptions<ReplaceOptions, DefaultReplaceOptions, Options>>;
1364
+ type _Replace<Input extends string, Search extends string, Replacement extends string, Options extends Required<ReplaceOptions>, Accumulator extends string = ''> = Search extends string // For distributing `Search`
1365
+ ? Replacement extends string // For distributing `Replacement`
1366
+ ? Input extends `${infer Head}${Search}${infer Tail}` ? Options['all'] extends true ? _Replace<Tail, Search, Replacement, Options, `${Accumulator}${Head}${Replacement}`> : `${Head}${Replacement}${Tail}` : `${Accumulator}${Input}` : never : never;
1367
+ //#endregion
1368
+ //#region src/utils/object/enumEntries.d.ts
1369
+ /**
1370
+ * 返回枚举的属性的键/值数组
1371
+ *
1372
+ * @param enumeration 枚举
1373
+ */
1374
+ declare function enumEntries<E extends AnyObject>(enumeration: NonEmptyObject<E>): [keyof E, E[keyof E]][];
1375
+ //#endregion
1376
+ //#region src/utils/object/enumKeys.d.ts
1377
+ /**
1378
+ * 获取枚举所有属性的键
1379
+ *
1380
+ * @param enumeration 枚举
1381
+ */
1382
+ declare function enumKeys<E extends AnyObject>(enumeration: NonEmptyObject<E>): [keyof E, ...(keyof E)[]];
1383
+ //#endregion
1384
+ //#region src/utils/object/enumTypeCheck.d.ts
1385
+ declare function enumTypeCheck<E extends AnyObject>(enumeration: E): E & Record<PropertyKey, unknown>;
1386
+ //#endregion
1387
+ //#region src/utils/object/enumValues.d.ts
1388
+ /**
1389
+ * 获取枚举所有属性的值
1390
+ *
1391
+ * @param enumeration 枚举
1392
+ */
1393
+ declare function enumValues<E extends AnyObject>(enumeration: NonEmptyObject<E>): UnionToTuple<ValueOf<E>>;
1394
+ //#endregion
1395
+ //#region src/utils/object/mapEntries.d.ts
1396
+ declare function mapEntries<K$1 extends PropertyKey, V, NK extends PropertyKey, NV>(obj: PlainObject<K$1, V>, toEntry: (key: K$1, value: V) => [NK, NV]): PlainObject<NK, NV>;
1397
+ //#endregion
1398
+ //#region node_modules/.pnpm/radashi@12.7.1/node_modules/radashi/dist/radashi.d.cts
1399
+
1400
+ interface BigInt {
1401
+ /**
1402
+ * Returns a string representation of an object.
1403
+ * @param radix Specifies a radix for converting numeric values to strings.
1404
+ */
1405
+ toString(radix?: number): string;
1406
+ /** Returns a string representation appropriate to the host environment's current locale. */
1407
+ toLocaleString(locales?: any, options?: BigIntToLocaleStringOptions): string;
1408
+ /** Returns the primitive value of the specified object. */
1409
+ valueOf(): bigint;
1410
+ readonly [Symbol.toStringTag]: "BigInt";
1411
+ }
1412
+ /**
1413
+ * A typed array of 64-bit signed integer values. The contents are initialized to 0. If the
1414
+ * requested number of bytes could not be allocated, an exception is raised.
1415
+ */
1416
+ interface BigInt64Array$1 {
1417
+ /** The size in bytes of each element in the array. */
1418
+ readonly BYTES_PER_ELEMENT: number;
1419
+ /** The ArrayBuffer instance referenced by the array. */
1420
+ readonly buffer: ArrayBufferLike;
1421
+ /** The length in bytes of the array. */
1422
+ readonly byteLength: number;
1423
+ /** The offset in bytes of the array. */
1424
+ readonly byteOffset: number;
1425
+ /**
1426
+ * Returns the this object after copying a section of the array identified by start and end
1427
+ * to the same array starting at position target
1428
+ * @param target If target is negative, it is treated as length+target where length is the
1429
+ * length of the array.
1430
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
1431
+ * is treated as length+end.
1432
+ * @param end If not specified, length of the this object is used as its default value.
1433
+ */
1434
+ copyWithin(target: number, start: number, end?: number): this;
1435
+ /** Yields index, value pairs for every entry in the array. */
1436
+ entries(): IterableIterator<[number, bigint]>;
1437
+ /**
1438
+ * Determines whether all the members of an array satisfy the specified test.
1439
+ * @param predicate A function that accepts up to three arguments. The every method calls
1440
+ * the predicate function for each element in the array until the predicate returns false,
1441
+ * or until the end of the array.
1442
+ * @param thisArg An object to which the this keyword can refer in the predicate function.
1443
+ * If thisArg is omitted, undefined is used as the this value.
1444
+ */
1445
+ every(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): boolean;
1446
+ /**
1447
+ * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
1448
+ * @param value value to fill array section with
1449
+ * @param start index to start filling the array at. If start is negative, it is treated as
1450
+ * length+start where length is the length of the array.
1451
+ * @param end index to stop filling the array at. If end is negative, it is treated as
1452
+ * length+end.
1453
+ */
1454
+ fill(value: bigint, start?: number, end?: number): this;
1455
+ /**
1456
+ * Returns the elements of an array that meet the condition specified in a callback function.
1457
+ * @param predicate A function that accepts up to three arguments. The filter method calls
1458
+ * the predicate function one time for each element in the array.
1459
+ * @param thisArg An object to which the this keyword can refer in the predicate function.
1460
+ * If thisArg is omitted, undefined is used as the this value.
1461
+ */
1462
+ filter(predicate: (value: bigint, index: number, array: BigInt64Array$1) => any, thisArg?: any): BigInt64Array$1;
1463
+ /**
1464
+ * Returns the value of the first element in the array where predicate is true, and undefined
1465
+ * otherwise.
1466
+ * @param predicate find calls predicate once for each element of the array, in ascending
1467
+ * order, until it finds one where predicate returns true. If such an element is found, find
1468
+ * immediately returns that element value. Otherwise, find returns undefined.
1469
+ * @param thisArg If provided, it will be used as the this value for each invocation of
1470
+ * predicate. If it is not provided, undefined is used instead.
1471
+ */
1472
+ find(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): bigint | undefined;
1473
+ /**
1474
+ * Returns the index of the first element in the array where predicate is true, and -1
1475
+ * otherwise.
1476
+ * @param predicate find calls predicate once for each element of the array, in ascending
1477
+ * order, until it finds one where predicate returns true. If such an element is found,
1478
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
1479
+ * @param thisArg If provided, it will be used as the this value for each invocation of
1480
+ * predicate. If it is not provided, undefined is used instead.
1481
+ */
1482
+ findIndex(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): number;
1483
+ /**
1484
+ * Performs the specified action for each element in an array.
1485
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
1486
+ * callbackfn function one time for each element in the array.
1487
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
1488
+ * If thisArg is omitted, undefined is used as the this value.
1489
+ */
1490
+ forEach(callbackfn: (value: bigint, index: number, array: BigInt64Array$1) => void, thisArg?: any): void;
1491
+ /**
1492
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
1493
+ * @param searchElement The element to search for.
1494
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
1495
+ */
1496
+ includes(searchElement: bigint, fromIndex?: number): boolean;
1497
+ /**
1498
+ * Returns the index of the first occurrence of a value in an array.
1499
+ * @param searchElement The value to locate in the array.
1500
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
1501
+ * search starts at index 0.
1502
+ */
1503
+ indexOf(searchElement: bigint, fromIndex?: number): number;
1504
+ /**
1505
+ * Adds all the elements of an array separated by the specified separator string.
1506
+ * @param separator A string used to separate one element of an array from the next in the
1507
+ * resulting String. If omitted, the array elements are separated with a comma.
1508
+ */
1509
+ join(separator?: string): string;
1510
+ /** Yields each index in the array. */
1511
+ keys(): IterableIterator<number>;
1512
+ /**
1513
+ * Returns the index of the last occurrence of a value in an array.
1514
+ * @param searchElement The value to locate in the array.
1515
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
1516
+ * search starts at index 0.
1517
+ */
1518
+ lastIndexOf(searchElement: bigint, fromIndex?: number): number;
1519
+ /** The length of the array. */
1520
+ readonly length: number;
1521
+ /**
1522
+ * Calls a defined callback function on each element of an array, and returns an array that
1523
+ * contains the results.
1524
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
1525
+ * callbackfn function one time for each element in the array.
1526
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
1527
+ * If thisArg is omitted, undefined is used as the this value.
1528
+ */
1529
+ map(callbackfn: (value: bigint, index: number, array: BigInt64Array$1) => bigint, thisArg?: any): BigInt64Array$1;
1530
+ /**
1531
+ * Calls the specified callback function for all the elements in an array. The return value of
1532
+ * the callback function is the accumulated result, and is provided as an argument in the next
1533
+ * call to the callback function.
1534
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
1535
+ * callbackfn function one time for each element in the array.
1536
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
1537
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
1538
+ * instead of an array value.
1539
+ */
1540
+ reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => bigint): bigint;
1541
+ /**
1542
+ * Calls the specified callback function for all the elements in an array. The return value of
1543
+ * the callback function is the accumulated result, and is provided as an argument in the next
1544
+ * call to the callback function.
1545
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
1546
+ * callbackfn function one time for each element in the array.
1547
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
1548
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
1549
+ * instead of an array value.
1550
+ */
1551
+ reduce<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => U$1, initialValue: U$1): U$1;
1552
+ /**
1553
+ * Calls the specified callback function for all the elements in an array, in descending order.
1554
+ * The return value of the callback function is the accumulated result, and is provided as an
1555
+ * argument in the next call to the callback function.
1556
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
1557
+ * the callbackfn function one time for each element in the array.
1558
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
1559
+ * the accumulation. The first call to the callbackfn function provides this value as an
1560
+ * argument instead of an array value.
1561
+ */
1562
+ reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => bigint): bigint;
1563
+ /**
1564
+ * Calls the specified callback function for all the elements in an array, in descending order.
1565
+ * The return value of the callback function is the accumulated result, and is provided as an
1566
+ * argument in the next call to the callback function.
1567
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
1568
+ * the callbackfn function one time for each element in the array.
1569
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
1570
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
1571
+ * instead of an array value.
1572
+ */
1573
+ reduceRight<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => U$1, initialValue: U$1): U$1;
1574
+ /** Reverses the elements in the array. */
1575
+ reverse(): this;
1576
+ /**
1577
+ * Sets a value or an array of values.
1578
+ * @param array A typed or untyped array of values to set.
1579
+ * @param offset The index in the current array at which the values are to be written.
1580
+ */
1581
+ set(array: ArrayLike<bigint>, offset?: number): void;
1582
+ /**
1583
+ * Returns a section of an array.
1584
+ * @param start The beginning of the specified portion of the array.
1585
+ * @param end The end of the specified portion of the array.
1586
+ */
1587
+ slice(start?: number, end?: number): BigInt64Array$1;
1588
+ /**
1589
+ * Determines whether the specified callback function returns true for any element of an array.
1590
+ * @param predicate A function that accepts up to three arguments. The some method calls the
1591
+ * predicate function for each element in the array until the predicate returns true, or until
1592
+ * the end of the array.
1593
+ * @param thisArg An object to which the this keyword can refer in the predicate function.
1594
+ * If thisArg is omitted, undefined is used as the this value.
1595
+ */
1596
+ some(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): boolean;
1597
+ /**
1598
+ * Sorts the array.
1599
+ * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.
1600
+ */
1601
+ sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;
1602
+ /**
1603
+ * Gets a new BigInt64Array view of the ArrayBuffer store for this array, referencing the elements
1604
+ * at begin, inclusive, up to end, exclusive.
1605
+ * @param begin The index of the beginning of the array.
1606
+ * @param end The index of the end of the array.
1607
+ */
1608
+ subarray(begin?: number, end?: number): BigInt64Array$1;
1609
+ /** Converts the array to a string by using the current locale. */
1610
+ toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;
1611
+ /** Returns a string representation of the array. */
1612
+ toString(): string;
1613
+ /** Returns the primitive value of the specified object. */
1614
+ valueOf(): BigInt64Array$1;
1615
+ /** Yields each value in the array. */
1616
+ values(): IterableIterator<bigint>;
1617
+ [Symbol.iterator](): IterableIterator<bigint>;
1618
+ readonly [Symbol.toStringTag]: "BigInt64Array";
1619
+ [index: number]: bigint;
1620
+ }
1621
+ /**
1622
+ * A typed array of 64-bit unsigned integer values. The contents are initialized to 0. If the
1623
+ * requested number of bytes could not be allocated, an exception is raised.
1624
+ */
1625
+ interface BigUint64Array$1 {
1626
+ /** The size in bytes of each element in the array. */
1627
+ readonly BYTES_PER_ELEMENT: number;
1628
+ /** The ArrayBuffer instance referenced by the array. */
1629
+ readonly buffer: ArrayBufferLike;
1630
+ /** The length in bytes of the array. */
1631
+ readonly byteLength: number;
1632
+ /** The offset in bytes of the array. */
1633
+ readonly byteOffset: number;
1634
+ /**
1635
+ * Returns the this object after copying a section of the array identified by start and end
1636
+ * to the same array starting at position target
1637
+ * @param target If target is negative, it is treated as length+target where length is the
1638
+ * length of the array.
1639
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
1640
+ * is treated as length+end.
1641
+ * @param end If not specified, length of the this object is used as its default value.
1642
+ */
1643
+ copyWithin(target: number, start: number, end?: number): this;
1644
+ /** Yields index, value pairs for every entry in the array. */
1645
+ entries(): IterableIterator<[number, bigint]>;
1646
+ /**
1647
+ * Determines whether all the members of an array satisfy the specified test.
1648
+ * @param predicate A function that accepts up to three arguments. The every method calls
1649
+ * the predicate function for each element in the array until the predicate returns false,
1650
+ * or until the end of the array.
1651
+ * @param thisArg An object to which the this keyword can refer in the predicate function.
1652
+ * If thisArg is omitted, undefined is used as the this value.
1653
+ */
1654
+ every(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): boolean;
1655
+ /**
1656
+ * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
1657
+ * @param value value to fill array section with
1658
+ * @param start index to start filling the array at. If start is negative, it is treated as
1659
+ * length+start where length is the length of the array.
1660
+ * @param end index to stop filling the array at. If end is negative, it is treated as
1661
+ * length+end.
1662
+ */
1663
+ fill(value: bigint, start?: number, end?: number): this;
1664
+ /**
1665
+ * Returns the elements of an array that meet the condition specified in a callback function.
1666
+ * @param predicate A function that accepts up to three arguments. The filter method calls
1667
+ * the predicate function one time for each element in the array.
1668
+ * @param thisArg An object to which the this keyword can refer in the predicate function.
1669
+ * If thisArg is omitted, undefined is used as the this value.
1670
+ */
1671
+ filter(predicate: (value: bigint, index: number, array: BigUint64Array$1) => any, thisArg?: any): BigUint64Array$1;
1672
+ /**
1673
+ * Returns the value of the first element in the array where predicate is true, and undefined
1674
+ * otherwise.
1675
+ * @param predicate find calls predicate once for each element of the array, in ascending
1676
+ * order, until it finds one where predicate returns true. If such an element is found, find
1677
+ * immediately returns that element value. Otherwise, find returns undefined.
1678
+ * @param thisArg If provided, it will be used as the this value for each invocation of
1679
+ * predicate. If it is not provided, undefined is used instead.
1680
+ */
1681
+ find(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): bigint | undefined;
1682
+ /**
1683
+ * Returns the index of the first element in the array where predicate is true, and -1
1684
+ * otherwise.
1685
+ * @param predicate find calls predicate once for each element of the array, in ascending
1686
+ * order, until it finds one where predicate returns true. If such an element is found,
1687
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
1688
+ * @param thisArg If provided, it will be used as the this value for each invocation of
1689
+ * predicate. If it is not provided, undefined is used instead.
1690
+ */
1691
+ findIndex(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): number;
1692
+ /**
1693
+ * Performs the specified action for each element in an array.
1694
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
1695
+ * callbackfn function one time for each element in the array.
1696
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
1697
+ * If thisArg is omitted, undefined is used as the this value.
1698
+ */
1699
+ forEach(callbackfn: (value: bigint, index: number, array: BigUint64Array$1) => void, thisArg?: any): void;
1700
+ /**
1701
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
1702
+ * @param searchElement The element to search for.
1703
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
1704
+ */
1705
+ includes(searchElement: bigint, fromIndex?: number): boolean;
1706
+ /**
1707
+ * Returns the index of the first occurrence of a value in an array.
1708
+ * @param searchElement The value to locate in the array.
1709
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
1710
+ * search starts at index 0.
1711
+ */
1712
+ indexOf(searchElement: bigint, fromIndex?: number): number;
1713
+ /**
1714
+ * Adds all the elements of an array separated by the specified separator string.
1715
+ * @param separator A string used to separate one element of an array from the next in the
1716
+ * resulting String. If omitted, the array elements are separated with a comma.
1717
+ */
1718
+ join(separator?: string): string;
1719
+ /** Yields each index in the array. */
1720
+ keys(): IterableIterator<number>;
1721
+ /**
1722
+ * Returns the index of the last occurrence of a value in an array.
1723
+ * @param searchElement The value to locate in the array.
1724
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
1725
+ * search starts at index 0.
1726
+ */
1727
+ lastIndexOf(searchElement: bigint, fromIndex?: number): number;
1728
+ /** The length of the array. */
1729
+ readonly length: number;
1730
+ /**
1731
+ * Calls a defined callback function on each element of an array, and returns an array that
1732
+ * contains the results.
1733
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
1734
+ * callbackfn function one time for each element in the array.
1735
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
1736
+ * If thisArg is omitted, undefined is used as the this value.
1737
+ */
1738
+ map(callbackfn: (value: bigint, index: number, array: BigUint64Array$1) => bigint, thisArg?: any): BigUint64Array$1;
1739
+ /**
1740
+ * Calls the specified callback function for all the elements in an array. The return value of
1741
+ * the callback function is the accumulated result, and is provided as an argument in the next
1742
+ * call to the callback function.
1743
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
1744
+ * callbackfn function one time for each element in the array.
1745
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
1746
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
1747
+ * instead of an array value.
1748
+ */
1749
+ reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => bigint): bigint;
1750
+ /**
1751
+ * Calls the specified callback function for all the elements in an array. The return value of
1752
+ * the callback function is the accumulated result, and is provided as an argument in the next
1753
+ * call to the callback function.
1754
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
1755
+ * callbackfn function one time for each element in the array.
1756
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
1757
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
1758
+ * instead of an array value.
1759
+ */
1760
+ reduce<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => U$1, initialValue: U$1): U$1;
1761
+ /**
1762
+ * Calls the specified callback function for all the elements in an array, in descending order.
1763
+ * The return value of the callback function is the accumulated result, and is provided as an
1764
+ * argument in the next call to the callback function.
1765
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
1766
+ * the callbackfn function one time for each element in the array.
1767
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
1768
+ * the accumulation. The first call to the callbackfn function provides this value as an
1769
+ * argument instead of an array value.
1770
+ */
1771
+ reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => bigint): bigint;
1772
+ /**
1773
+ * Calls the specified callback function for all the elements in an array, in descending order.
1774
+ * The return value of the callback function is the accumulated result, and is provided as an
1775
+ * argument in the next call to the callback function.
1776
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
1777
+ * the callbackfn function one time for each element in the array.
1778
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
1779
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
1780
+ * instead of an array value.
1781
+ */
1782
+ reduceRight<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => U$1, initialValue: U$1): U$1;
1783
+ /** Reverses the elements in the array. */
1784
+ reverse(): this;
1785
+ /**
1786
+ * Sets a value or an array of values.
1787
+ * @param array A typed or untyped array of values to set.
1788
+ * @param offset The index in the current array at which the values are to be written.
1789
+ */
1790
+ set(array: ArrayLike<bigint>, offset?: number): void;
1791
+ /**
1792
+ * Returns a section of an array.
1793
+ * @param start The beginning of the specified portion of the array.
1794
+ * @param end The end of the specified portion of the array.
1795
+ */
1796
+ slice(start?: number, end?: number): BigUint64Array$1;
1797
+ /**
1798
+ * Determines whether the specified callback function returns true for any element of an array.
1799
+ * @param predicate A function that accepts up to three arguments. The some method calls the
1800
+ * predicate function for each element in the array until the predicate returns true, or until
1801
+ * the end of the array.
1802
+ * @param thisArg An object to which the this keyword can refer in the predicate function.
1803
+ * If thisArg is omitted, undefined is used as the this value.
1804
+ */
1805
+ some(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): boolean;
1806
+ /**
1807
+ * Sorts the array.
1808
+ * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.
1809
+ */
1810
+ sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;
1811
+ /**
1812
+ * Gets a new BigUint64Array view of the ArrayBuffer store for this array, referencing the elements
1813
+ * at begin, inclusive, up to end, exclusive.
1814
+ * @param begin The index of the beginning of the array.
1815
+ * @param end The index of the end of the array.
1816
+ */
1817
+ subarray(begin?: number, end?: number): BigUint64Array$1;
1818
+ /** Converts the array to a string by using the current locale. */
1819
+ toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;
1820
+ /** Returns a string representation of the array. */
1821
+ toString(): string;
1822
+ /** Returns the primitive value of the specified object. */
1823
+ valueOf(): BigUint64Array$1;
1824
+ /** Yields each value in the array. */
1825
+ values(): IterableIterator<bigint>;
1826
+ [Symbol.iterator](): IterableIterator<bigint>;
1827
+ readonly [Symbol.toStringTag]: "BigUint64Array";
1828
+ [index: number]: bigint;
1829
+ }
1830
+ interface BigIntToLocaleStringOptions {
1831
+ /**
1832
+ * The locale matching algorithm to use.The default is "best fit". For information about this option, see the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation Intl page}.
1833
+ */
1834
+ localeMatcher?: string;
1835
+ /**
1836
+ * The formatting style to use , the default is "decimal".
1837
+ */
1838
+ style?: string;
1839
+ numberingSystem?: string;
1840
+ /**
1841
+ * The unit to use in unit formatting, Possible values are core unit identifiers, defined in UTS #35, Part 2, Section 6. A subset of units from the full list was selected for use in ECMAScript. Pairs of simple units can be concatenated with "-per-" to make a compound unit. There is no default value; if the style is "unit", the unit property must be provided.
1842
+ */
1843
+ unit?: string;
1844
+ /**
1845
+ * The unit formatting style to use in unit formatting, the defaults is "short".
1846
+ */
1847
+ unitDisplay?: string;
1848
+ /**
1849
+ * The currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as "USD" for the US dollar, "EUR" for the euro, or "CNY" for the Chinese RMB — see the Current currency & funds code list. There is no default value; if the style is "currency", the currency property must be provided. It is only used when [[Style]] has the value "currency".
1850
+ */
1851
+ currency?: string;
1852
+ /**
1853
+ * How to display the currency in currency formatting. It is only used when [[Style]] has the value "currency". The default is "symbol".
1854
+ *
1855
+ * "symbol" to use a localized currency symbol such as €,
1856
+ *
1857
+ * "code" to use the ISO currency code,
1858
+ *
1859
+ * "name" to use a localized currency name such as "dollar"
1860
+ */
1861
+ currencyDisplay?: string;
1862
+ /**
1863
+ * Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. The default is true.
1864
+ */
1865
+ useGrouping?: boolean;
1866
+ /**
1867
+ * The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1.
1868
+ */
1869
+ minimumIntegerDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
1870
+ /**
1871
+ * The minimum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number and percent formatting is 0; the default for currency formatting is the number of minor unit digits provided by the {@link http://www.currency-iso.org/en/home/tables/table-a1.html ISO 4217 currency codes list} (2 if the list doesn't provide that information).
1872
+ */
1873
+ minimumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
1874
+ /**
1875
+ * The maximum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number formatting is the larger of minimumFractionDigits and 3; the default for currency formatting is the larger of minimumFractionDigits and the number of minor unit digits provided by the {@link http://www.currency-iso.org/en/home/tables/table-a1.html ISO 4217 currency codes list} (2 if the list doesn't provide that information); the default for percent formatting is the larger of minimumFractionDigits and 0.
1876
+ */
1877
+ maximumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
1878
+ /**
1879
+ * The minimum number of significant digits to use. Possible values are from 1 to 21; the default is 1.
1880
+ */
1881
+ minimumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
1882
+ /**
1883
+ * The maximum number of significant digits to use. Possible values are from 1 to 21; the default is 21.
1884
+ */
1885
+ maximumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
1886
+ /**
1887
+ * The formatting that should be displayed for the number, the defaults is "standard"
1888
+ *
1889
+ * "standard" plain number formatting
1890
+ *
1891
+ * "scientific" return the order-of-magnitude for formatted number.
1892
+ *
1893
+ * "engineering" return the exponent of ten when divisible by three
1894
+ *
1895
+ * "compact" string representing exponent, defaults is using the "short" form
1896
+ */
1897
+ notation?: string;
1898
+ /**
1899
+ * used only when notation is "compact"
1900
+ */
1901
+ compactDisplay?: string;
1902
+ }
1903
+ /**
1904
+ * The `Any` class does not exist at runtime. It's used in type
1905
+ * definitions to detect an `any` type.
1906
+ *
1907
+ * ```ts
1908
+ * type IsAny<T> = [T] extends [Any] ? 'is any' : 'is not any'
1909
+ * ```
1910
+ */
1911
+ declare class Any {
1912
+ private any;
1913
+ }
1914
+ /**
1915
+ * Represents a class constructor.
1916
+ */
1917
+
1918
+ /**
1919
+ * Get all properties **not using** the `?:` type operator.
1920
+ */
1921
+ type RequiredKeys<T> = T extends any ? keyof T extends infer K ? K extends keyof T ? Omit<T, K> extends T ? never : K : never : never : never;
1922
+ /**
1923
+ * Get all properties using the `?:` type operator.
1924
+ */
1925
+ type OptionalKeys<T> = T extends any ? keyof T extends infer K ? K extends keyof T ? Omit<T, K> extends T ? K : never : never : never : never;
1926
+ /**
1927
+ * Resolves to `true` if `Left` and `Right` are exactly the same type.
1928
+ *
1929
+ * Otherwise false.
1930
+ */
1931
+ type IsExactType<Left, Right> = [Left] extends [Any] ? [Right] extends [Any] ? true : false : (<U$1>() => U$1 extends Left ? 1 : 0) extends (<U$1>() => U$1 extends Right ? 1 : 0) ? true : false;
1932
+ type Primitive = number | string | boolean | symbol | bigint | null | undefined | void;
1933
+ /**
1934
+ * Coerce a primitive type to its boxed equivalent.
1935
+ *
1936
+ * @example
1937
+ * ```ts
1938
+ * type A = BoxedPrimitive<string>
1939
+ * // ^? String
1940
+ * type B = BoxedPrimitive<number>
1941
+ * // ^? Number
1942
+ * ```
1943
+ */
1944
+ type BoxedPrimitive<T = any> = T extends string ? String : T extends number ? Number : T extends boolean ? Boolean : T extends bigint ? BigInt : T extends symbol ? Symbol : never;
1945
+ type TypedArray$1 = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array$1 | BigUint64Array$1 | DataView | ArrayBuffer | SharedArrayBuffer;
1946
+ /**
1947
+ * Add your own classes to this registry by extending its interface
1948
+ * with what's called “declaration merging” in TypeScript.
1949
+ *
1950
+ * All property types in this registry type may be treated specially
1951
+ * by any of Radashi's complex types. For example, `assign` will avoid
1952
+ * merging with types in this registry.
1953
+ */
1954
+ interface CustomClassRegistry {}
1955
+ /**
1956
+ * This type represents any custom class that was "registered" through
1957
+ * the `CustomClassRegistry` type.
1958
+ */
1959
+ type CustomClass = CustomClassRegistry[keyof CustomClassRegistry];
1960
+ /**
1961
+ * These types are implemented natively.
1962
+ *
1963
+ * Note that boxed primitives like `Boolean` (different from
1964
+ * `boolean`) are not included, because `boolean extends Boolean ? 1 :
1965
+ * 0` resolves to 1.
1966
+ */
1967
+ type BuiltInType = ES2021.BuiltInType | WebAPI.BuiltInType | NodeJS.BuiltInType;
1968
+ declare namespace ES2020 {
1969
+ type BuiltInType = Primitive | Promise<any> | Date | RegExp | Error | readonly any[] | ReadonlyMap<any, any> | ReadonlySet<any> | WeakMap<WeakKey, any> | WeakSet<WeakKey> | TypedArray$1 | Function;
1970
+ }
1971
+ declare namespace ES2021 {
1972
+ type BuiltInType = ES2020.BuiltInType | GlobalObjectType<'FinalizationRegistry'> | GlobalObjectType<'WeakRef'>;
1973
+ }
1974
+ declare namespace NodeJS {
1975
+ type BuiltInType = GlobalObjectType<'Buffer'>;
1976
+ }
1977
+ declare namespace WebAPI {
1978
+ type BuiltInType = GlobalObjectType<'AbortController'> | GlobalObjectType<'AbortSignal'> | GlobalObjectType<'Blob'> | GlobalObjectType<'Body'> | GlobalObjectType<'CompressionStream'> | GlobalObjectType<'Crypto'> | GlobalObjectType<'CustomEvent'> | GlobalObjectType<'DecompressionStream'> | GlobalObjectType<'Event'> | GlobalObjectType<'EventTarget'> | GlobalObjectType<'FormData'> | GlobalObjectType<'Headers'> | GlobalObjectType<'MessageChannel'> | GlobalObjectType<'Navigator'> | GlobalObjectType<'ReadableStream'> | GlobalObjectType<'ReadableStreamBYOBReader'> | GlobalObjectType<'ReadableStreamDefaultController'> | GlobalObjectType<'ReadableStreamDefaultReader'> | GlobalObjectType<'SubtleCrypto'> | GlobalObjectType<'TextDecoder'> | GlobalObjectType<'TextDecoderStream'> | GlobalObjectType<'TextEncoder'> | GlobalObjectType<'TextEncoderStream'> | GlobalObjectType<'TransformStream'> | GlobalObjectType<'TransformStreamDefaultController'> | GlobalObjectType<'URL'> | GlobalObjectType<'URLSearchParams'> | GlobalObjectType<'WebSocket'> | GlobalObjectType<'WritableStream'> | GlobalObjectType<'WritableStreamDefaultController'> | GlobalObjectType<'WritableStreamDefaultWriter'> | WebDocumentAPI.BuiltInType;
1979
+ }
1980
+ declare namespace WebDocumentAPI {
1981
+ type BuiltInType = GlobalObjectType<'Node'> | GlobalObjectType<'NodeList'> | GlobalObjectType<'NodeIterator'> | GlobalObjectType<'HTMLCollection'> | GlobalObjectType<'CSSStyleDeclaration'> | GlobalObjectType<'DOMStringList'> | GlobalObjectType<'DOMTokenList'>;
1982
+ }
1983
+ type GlobalObjectType<Identifier extends string> = [Identifier] extends [Any] ? never : keyof Identifier extends never ? never : typeof globalThis extends { [P in Identifier]: any } ? InstanceType<(typeof globalThis)[Identifier]> : never;
1984
+
1985
+ /**
1986
+ * Converts a `PromiseLike` to a `Promise<Result>`.
1987
+ *
1988
+ * Note: If the given promise throws a non-Error value, it will be
1989
+ * rethrown.
1990
+ *
1991
+ * @see https://radashi.js.org/reference/async/toResult
1992
+ * @example
1993
+ * ```ts
1994
+ * import { toResult, Result } from 'radashi'
1995
+ *
1996
+ * const good = async (): Promise<number> => 1
1997
+ * const bad = async (): Promise<number> => { throw new Error('bad') }
1998
+ *
1999
+ * const goodResult = await toResult(good())
2000
+ * // => [undefined, 1]
2001
+ *
2002
+ * const badResult = await toResult(bad())
2003
+ * // => [Error('bad'), undefined]
2004
+ * ```
2005
+ * @version 12.4.0
2006
+ */
2007
+
2008
+ /**
2009
+ * The return type for `assign`.
2010
+ *
2011
+ * It recursively merges object types that are not native objects. The
2012
+ * root objects are always merged.
2013
+ *
2014
+ * @see https://radashi.js.org/reference/object/assign
2015
+ */
2016
+ type Assign<TInitial extends object, TOverride extends object> = TInitial extends any ? TOverride extends any ? SimplifyMutable<Omit<TInitial, keyof TOverride> & Omit<TOverride, keyof TInitial> & (Pick<TInitial, keyof TInitial & keyof TOverride> extends infer TConflictInitial ? Pick<TOverride, keyof TInitial & keyof TOverride> extends infer TConflictOverride ? { [K in RequiredKeys<TConflictOverride>]: AssignDeep<TConflictInitial[K & keyof TConflictInitial], TConflictOverride[K]> } & { [K in RequiredKeys<TConflictInitial> & OptionalKeys<TConflictOverride>]: AssignDeep<TConflictInitial[K], TConflictOverride[K], true> } & { [K in OptionalKeys<TConflictInitial> & OptionalKeys<TConflictOverride>]?: AssignDeep<TConflictInitial[K], TConflictOverride[K], true> } : unknown : unknown)> : never : never;
2017
+ /**
2018
+ * Mimic the `Simplify` type and also remove `readonly` modifiers.
2019
+ */
2020
+ type SimplifyMutable<T> = {} & { -readonly [P in keyof T]: T[P] };
2021
+ /**
2022
+ * This represents a value that should only be replaced if it exists
2023
+ * as an initial value; never deeply assigned into.
2024
+ */
2025
+ type AtomicValue = BuiltInType | CustomClass | BoxedPrimitive;
2026
+ /**
2027
+ * Handle mixed types when merging nested plain objects.
2028
+ *
2029
+ * For example, if the type `TOverride` includes both `string` and `{ n:
2030
+ * number }` in a union, `AssignDeep` will treat `string` as
2031
+ * unmergeable and `{ n: number }` as mergeable.
2032
+ */
2033
+ type AssignDeep<TInitial, TOverride, IsOptional = false> = never
2034
+ /**
2035
+ * When a native type is found in TInitial, it will only exist in
2036
+ * the result type if the override is optional.
2037
+ */ | (TInitial extends AtomicValue ? IsOptional extends true ? TInitial : never : never)
2038
+ /**
2039
+ * When a native type is found in TOverride, it will always exists
2040
+ * in the result type.
2041
+ */ | (TOverride extends AtomicValue ? TOverride : never)
2042
+ /**
2043
+ * Deep assignment is handled in this branch.
2044
+ *
2045
+ * 1. Exclude any native types from TInitial and TOverride
2046
+ * 2. If a non-native object type is not found in TInitial, simply
2047
+ * replace TInitial (or use "A | B" if the override is optional)
2048
+ * 3. For each non-native object type in TOverride, deep assign to
2049
+ * every non-native object in TInitial
2050
+ * 4. For each non-object type in TOverride, simply replace TInitial
2051
+ * (or use "A | B" if the override is optional)
2052
+ */ | (Exclude<TOverride, AtomicValue> extends infer TOverride ? Exclude<TInitial, Exclude<AtomicValue, void>> extends infer TInitial ? [Extract<TInitial, object>] extends [never] ? TOverride | (IsOptional extends true ? TInitial : never) : TInitial extends object ? TOverride extends object ? IsExactType<TOverride, TInitial> extends true ? TOverride : Assign<TInitial, TOverride> :
2053
+ // 4.
2054
+ TOverride | (IsOptional extends true ? TInitial : never) : Extract<TOverride, object> | (IsOptional extends true ? TInitial : never) : never : never);
2055
+
2056
+ /**
2057
+ * Creates a shallow copy of the given object/value.
2058
+ *
2059
+ * @see https://radashi.js.org/reference/object/clone
2060
+ * @example
2061
+ * ```ts
2062
+ * const original = { a: 1, b: { c: 3 } }
2063
+ * const cloned = clone(original)
2064
+ * // => { a: 1, b: { c: 3 } }
2065
+ * original !== cloned
2066
+ * // => true
2067
+ * original.b === cloned.b
2068
+ * // => true
2069
+ * ```
2070
+ * @version 12.1.0
2071
+ */
2072
+ //#endregion
2073
+ //#region src/utils/object/objectAssign.d.ts
2074
+ /**
2075
+ * 递归地将第二个对象合并到第一个对象的副本中
2076
+ * - 只有普通对象才会递归合并
2077
+ *
2078
+ * @param initial 初始对象
2079
+ * @param override 待合并对象
2080
+ */
2081
+ declare function objectAssign<I$1 extends PlainObject, O extends PlainObject>(initial: I$1, override: O): Assign<I$1, O>;
2082
+ //#endregion
2083
+ //#region src/utils/object/objectCrush.d.ts
2084
+ type Crush<T> = T extends readonly (infer U)[] ? Record<string, U extends object ? unknown : U> : Simplify<UnionToIntersection<keyof T extends infer Prop ? Prop extends keyof T ? T[Prop] extends infer Value ? ([Extract<Value, object>] extends [never] ? never : Record<string, unknown>) | ([Exclude<Value, object>] extends [never] ? never : [Extract<Value, object>] extends [never] ? { [P in Prop]: Value } : Record<string, unknown>) : never : never : never>>;
2085
+ declare function objectCrush<T extends PlainObject>(value: T): Crush<T>;
2086
+ //#endregion
2087
+ //#region src/utils/object/objectEntries.d.ts
2088
+ /**
2089
+ * 返回对象的可枚举属性的键/值数组
2090
+ *
2091
+ * @param obj 对象
2092
+ */
2093
+ declare function objectEntries<O extends AnyObject>(obj: O): [string & keyof O, O[keyof O]][];
2094
+ //#endregion
2095
+ //#region src/utils/object/objectKeys.d.ts
2096
+ /**
2097
+ * 返回对象的可枚举属性和方法的名称
2098
+ * - `Object.keys` 始终返回 `string[]` 类型,此函数可以返回具体类型
2099
+ *
2100
+ * @param obj 对象
2101
+ */
2102
+ declare function objectKeys<O extends AnyObject>(obj: O): (keyof O)[];
2103
+ //#endregion
2104
+ //#region src/utils/object/objectPick.d.ts
2105
+ declare function objectPick<O extends AnyObject, K$1 extends keyof O>(obj: O, keys: readonly K$1[]): Pick<O, K$1>;
2106
+ //#endregion
2107
+ //#region src/utils/object/objectSwitch.d.ts
2108
+ /**
2109
+ * 对象反转
2110
+ * - 返回交换了对象的可枚举属性的值/键对象
2111
+ *
2112
+ * @param obj 对象
2113
+ */
2114
+ declare function objectSwitch<O extends AnyObject>(obj: NonEmptyObject<O>): Record<O[keyof O], keyof O>;
2115
+ //#endregion
2116
+ //#region src/utils/object/objectValues.d.ts
2117
+ /**
2118
+ * 返回对象的可枚举属性的值数组
2119
+ *
2120
+ * @param obj 对象
2121
+ */
2122
+ declare function objectValues<O extends AnyObject>(obj: O): UnionToTuple<ValueOf<O>>;
2123
+ //#endregion
2124
+ //#region src/utils/string/stringInitialCase.d.ts
2125
+ /**
2126
+ * 字符串首字母大小写
2127
+ * - 包含非西欧字母字符时,不处理
2128
+ * - 纯字母且全大写时,不处理
2129
+ * - 纯字母且非全大写时,首字母小写,其余保留
2130
+ * - 纯字母且非全大写时,首字母大写,其余保留
2131
+ *
2132
+ * @param input 待处理字符串
2133
+ * @param caseType 大小写类型
2134
+ */
2135
+ declare function stringInitialCase(input: string, caseType?: "lower" | "upper" | undefined): string;
2136
+ //#endregion
2137
+ //#region src/utils/string/stringReplace.d.ts
2138
+ /**
2139
+ * 字符串替换
2140
+ * - 替换第一个匹配项
2141
+ *
2142
+ * @param input 待处理字符串
2143
+ * @param search 匹配项
2144
+ * @param replacement 替换项
2145
+ */
2146
+ declare function stringReplace<I$1 extends string, S extends string, R$1 extends string>(input: I$1, search: S, replacement: R$1): Replace<I$1, S, R$1>;
2147
+ //#endregion
2148
+ //#region src/utils/string/stringTemplate.d.ts
2149
+ /**
2150
+ * 字符串模板替换
2151
+ *
2152
+ * @param input 待处理字符串
2153
+ * @param template 模板对象
2154
+ * @param regex 模板匹配正则
2155
+ */
2156
+ declare function stringTemplate(input: string, template: PlainObject, regex?: RegExp): string;
2157
+ //#endregion
2158
+ //#region src/utils/string/stringToJson.d.ts
2159
+ /**
2160
+ * 处理 JSON 字符串
2161
+ *
2162
+ * @param input 待处理字符串
2163
+ * @param safeValue 安全值
2164
+ */
2165
+ declare function stringToJson<R$1 extends AnyObject = AnyObject, D extends R$1 = R$1>(input: string | null | undefined, safeValue: D): R$1;
2166
+ //#endregion
2167
+ //#region src/utils/string/stringToNumber.d.ts
2168
+ /**
2169
+ * 从字符串中提取数字字符串
2170
+ *
2171
+ * @param input 待处理字符串
2172
+ */
2173
+ declare function stringToNumber(input: string): string;
2174
+ //#endregion
2175
+ //#region src/utils/string/stringToValues.d.ts
2176
+ /**
2177
+ * 字符串分割为数组
2178
+ *
2179
+ * @param input 待处理字符串
2180
+ * @param valueType 数组中每一项的类型
2181
+ * @param splitSymbol 分隔符,默认为 `,`
2182
+ */
2183
+ declare function stringToValues(input: string | null | undefined, valueType?: "number" | undefined, splitSymbol?: string | undefined): number[];
2184
+ declare function stringToValues(input: string | null | undefined, valueType: "string", splitSymbol?: string | undefined): string[];
2185
+ //#endregion
2186
+ //#region src/utils/tree/types.d.ts
2187
+ type RowKey = "id";
2188
+ type ParentIdKey = "parentId";
2189
+ type ChildrenKey = "children";
2190
+ type Strategy = "pre" | "post" | "breadth";
2191
+ interface BaseCallbackMeta<T> {
2192
+ depth: number;
2193
+ parents?: T[];
2194
+ }
2195
+ interface BaseOptions<T, CK extends string> {
2196
+ childrenKey?: CK;
2197
+ strategy?: Strategy;
2198
+ getChildrenKey?: ((row: T, meta: BaseCallbackMeta<T>) => CK) | undefined;
2199
+ }
2200
+ //#endregion
2201
+ //#region src/utils/tree/treeFilter.d.ts
2202
+ type TreeFilterOptions<T extends AnyObject, CK extends string = ChildrenKey> = BaseOptions<T, CK>;
2203
+ type TreeFilterCallback<T extends AnyObject> = (row: T, meta: BaseCallbackMeta<T>) => boolean;
2204
+ declare function treeFilter<T extends AnyObject, CK extends string = ChildrenKey>(tree: T[], callback: TreeFilterCallback<T>, options?: TreeFilterOptions<T, CK>): T[];
2205
+ declare function treeFilter<T extends AnyObject, CK extends string = ChildrenKey>(tree: T, callback: TreeFilterCallback<T>, options?: TreeFilterOptions<T, CK>): T;
2206
+ //#endregion
2207
+ //#region src/utils/tree/treeFind.d.ts
2208
+ type TreeFindOptions<T extends AnyObject, CK extends string = ChildrenKey> = BaseOptions<T, CK>;
2209
+ type TreeFindCallback<T extends AnyObject> = (row: T, meta: BaseCallbackMeta<T>) => boolean;
2210
+ /**
2211
+ * 查找树节点,找到第一个返回非空值的节点
2212
+ */
2213
+ declare function treeFind<T extends AnyObject, CK extends string = ChildrenKey>(tree: T | T[], callback: TreeFindCallback<T>, options?: TreeFindOptions<T, CK>): T | undefined;
2214
+ //#endregion
2215
+ //#region src/utils/tree/treeForEach.d.ts
2216
+ type TreeForeachOptions<T extends AnyObject, CK extends string = ChildrenKey> = BaseOptions<T, CK>;
2217
+ type TreeForeachCallback<T extends AnyObject> = (row: T, meta: BaseCallbackMeta<T>) => void;
2218
+ declare function treeForEach<T extends AnyObject, CK extends string = ChildrenKey>(tree: T | T[], callback: TreeForeachCallback<T>, options?: TreeForeachOptions<T, CK>): void;
2219
+ //#endregion
2220
+ //#region src/utils/tree/treeMap.d.ts
2221
+ type TreeMapOptions<T extends AnyObject, CK extends string> = BaseOptions<T, CK>;
2222
+ type TreeMapCallback<R$1 extends AnyObject, T extends AnyObject> = (row: T, meta: BaseCallbackMeta<T>) => R$1;
2223
+ declare function treeMap<R$1 extends AnyObject, T extends AnyObject, CK extends string = ChildrenKey>(tree: T[], callback: TreeMapCallback<R$1, T>, options?: TreeMapOptions<T, CK>): TreeLike<R$1, CK>[];
2224
+ declare function treeMap<R$1 extends AnyObject, T extends AnyObject, CK extends string = ChildrenKey>(tree: T, callback: TreeMapCallback<R$1, T>, options?: TreeMapOptions<T, CK>): TreeLike<R$1, CK>;
2225
+ //#endregion
2226
+ //#region src/utils/tree/rowsToTree.d.ts
2227
+ interface RowsToTreeOptions<RK extends string = RowKey, PK extends string = ParentIdKey, CK extends string = ChildrenKey> {
2228
+ rowKey?: RK;
2229
+ parentIdKey?: PK;
2230
+ childrenKey?: CK;
2231
+ }
2232
+ /**
2233
+ * 行结构 转 树结构
2234
+ */
2235
+ declare function rowsToTree<T extends AnyObject = AnyObject, CK extends string = ChildrenKey, R$1 = TreeLike<T, CK>, RK extends string = RowKey, PK extends string = ParentIdKey>(rows: T[], options?: RowsToTreeOptions<RK, PK, CK> | undefined): R$1[];
2236
+ //#endregion
2237
+ //#region src/utils/tree/treeToRows.d.ts
2238
+ type TreeToRowsOptions<T extends AnyObject, CK extends string = ChildrenKey> = TreeForeachOptions<T, CK>;
2239
+ /**
2240
+ * 树结构 转 行结构
2241
+ */
2242
+ declare function treeToRows<T extends AnyObject, CK extends string = ChildrenKey, R$1 extends AnyObject = SetOptional<T, CK>>(tree: T | T[], options?: TreeToRowsOptions<T, CK>): R$1[];
2243
+ //#endregion
2244
+ //#region src/utils/typeof/isAbortSignal.d.ts
2245
+ declare function isAbortSignal(value: unknown): value is AbortSignal;
2246
+ //#endregion
2247
+ //#region src/utils/typeof/isArray.d.ts
2248
+ type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
2249
+ declare function isArray(value: unknown): value is unknown[];
2250
+ declare function isTypedArray(value: unknown): value is TypedArray;
2251
+ //#endregion
2252
+ //#region src/utils/typeof/isBigInt.d.ts
2253
+ declare function isBigInt(value: unknown): value is bigint;
2254
+ //#endregion
2255
+ //#region src/utils/typeof/isBlob.d.ts
2256
+ declare function isBlob(value: unknown): value is Blob;
2257
+ //#endregion
2258
+ //#region src/utils/typeof/isBoolean.d.ts
2259
+ declare function isBoolean(value: unknown): value is boolean;
2260
+ //#endregion
2261
+ //#region src/utils/typeof/isClass.d.ts
2262
+ declare function isClass(value: unknown): value is Class<AnyObject>;
2263
+ //#endregion
2264
+ //#region src/utils/typeof/isDate.d.ts
2265
+ declare function isDate(value: unknown): value is Date;
2266
+ //#endregion
2267
+ //#region src/utils/typeof/isEqual.d.ts
2268
+ /**
2269
+ * 检查给定的值是否相等
2270
+ * @reference https://github.com/radashi-org/radashi/blob/main/src/typed/isEqual.ts
2271
+ *
2272
+ * @param {T} x
2273
+ * @param {T} y
2274
+ */
2275
+ declare function isEqual<T>(x: T, y: T): boolean;
2276
+ //#endregion
2277
+ //#region src/utils/typeof/isError.d.ts
2278
+ declare function isError(value: unknown): value is Error;
2279
+ //#endregion
2280
+ //#region src/utils/typeof/isFalsy.d.ts
2281
+ declare function isFalsy(value: unknown): boolean;
2282
+ declare function isFalsyLike(value: unknown): boolean;
2283
+ //#endregion
2284
+ //#region src/utils/typeof/isFile.d.ts
2285
+ declare function isFile(value: unknown): value is File;
2286
+ //#endregion
2287
+ //#region src/utils/typeof/isFunction.d.ts
2288
+ declare function isFunction(value: unknown): value is AnyFunction;
2289
+ declare function isAsyncFunction(value: unknown): value is AnyAsyncFunction;
2290
+ declare function isGeneratorFunction(value: unknown): value is AnyGeneratorFunction;
2291
+ declare function isAsyncGeneratorFunction(value: unknown): value is AnyAsyncGeneratorFunction;
2292
+ //#endregion
2293
+ //#region src/utils/typeof/isIterable.d.ts
2294
+ declare function isIterable(value: unknown): value is {
2295
+ [Symbol.iterator]: () => Iterator<unknown>;
2296
+ };
2297
+ //#endregion
2298
+ //#region src/utils/typeof/isMap.d.ts
2299
+ declare function isMap(value: unknown): value is Map<unknown, unknown>;
2300
+ declare function isWeakMap(value: unknown): value is WeakMap<AnyObject, unknown>;
2301
+ //#endregion
2302
+ //#region src/utils/typeof/isNaN.d.ts
2303
+ declare function isNaN(value: unknown): value is number;
2304
+ //#endregion
2305
+ //#region src/utils/typeof/isNull.d.ts
2306
+ declare function isNull(value: unknown): value is null;
2307
+ //#endregion
2308
+ //#region src/utils/typeof/isNumber.d.ts
2309
+ declare function isNumber(value: unknown): value is number;
2310
+ /**
2311
+ * 检查 value 是否为整数
2312
+ *
2313
+ * @param value - 待检查值
2314
+ * @param safeCheck - 是否附加安全数检查
2315
+ */
2316
+ declare function isInteger(value: unknown, safeCheck?: boolean): value is number;
2317
+ /**
2318
+ * 检查 value 是否为正整数
2319
+ * - 未考虑 value 为 0 的情况
2320
+ *
2321
+ * @param value - 待检查值
2322
+ * @param safeCheck - 是否附加安全数检查
2323
+ */
2324
+ declare function isPositiveInteger(value: unknown, safeCheck?: boolean): value is number;
2325
+ /**
2326
+ * 检查 value 是否为负整数
2327
+ * - 未考虑 value 为 0 的情况
2328
+ *
2329
+ * @param value - 待检查值
2330
+ * @param safeCheck - 是否附加安全数检查
2331
+ */
2332
+ declare function isNegativeInteger(value: unknown, safeCheck?: boolean): value is number;
2333
+ declare function isInfinity(value: unknown): value is number;
2334
+ declare function isInfinityLike(value: unknown): boolean;
2335
+ //#endregion
2336
+ //#region src/utils/typeof/isObject.d.ts
2337
+ /**
2338
+ * 判断是否为对象类型
2339
+ * - 可选是否检查原型为 `Object.prototype`,防止原型链污染
2340
+ *
2341
+ * @param value - 待检查值
2342
+ * @param prototypeCheck - 是否进行原型检查,默认 `true`
2343
+ */
2344
+ declare function isObject(value: unknown, prototypeCheck?: boolean): value is Record<PropertyKey, unknown>;
2345
+ //#endregion
2346
+ //#region src/utils/typeof/isPromise.d.ts
2347
+ declare function isPromise(value: unknown): value is Promise<unknown>;
2348
+ declare function isPromiseLike(value: unknown): value is PromiseLike<unknown>;
2349
+ //#endregion
2350
+ //#region src/utils/typeof/isReadableStream.d.ts
2351
+ /**
2352
+ * Checks if a value is a WHATWG ReadableStream instance.
2353
+ *
2354
+ * - Uses `Object.prototype.toString` where supported (modern browsers, Node.js ≥18).
2355
+ * - Falls back to duck-typing in older environments.
2356
+ * - Resistant to basic forgery, but not 100% secure in all polyfill scenarios.
2357
+ *
2358
+ * ⚠️ Note: In older Node.js (<18) or with non-compliant polyfills, this may return false positives or negatives.
2359
+ */
2360
+ declare function isReadableStream(value: unknown): value is ReadableStream;
2361
+ //#endregion
2362
+ //#region src/utils/typeof/isRegExp.d.ts
2363
+ declare function isRegExp(value: unknown): value is RegExp;
2364
+ //#endregion
2365
+ //#region src/utils/typeof/isSet.d.ts
2366
+ declare function isSet(value: unknown): value is Set<unknown>;
2367
+ declare function isWeakSet(value: unknown): value is WeakSet<AnyObject>;
2368
+ //#endregion
2369
+ //#region src/utils/typeof/isString.d.ts
2370
+ declare function isString(value: unknown): value is string;
2371
+ //#endregion
2372
+ //#region src/utils/typeof/isSymbol.d.ts
2373
+ declare function isSymbol(value: unknown): value is symbol;
2374
+ //#endregion
2375
+ //#region src/utils/typeof/isUndefined.d.ts
2376
+ declare function isUndefined(value: unknown): value is undefined;
2377
+ //#endregion
2378
+ //#region src/utils/typeof/isURLSearchParams.d.ts
2379
+ declare function isURLSearchParams(value: unknown): value is URLSearchParams;
2380
+ //#endregion
2381
+ //#region src/utils/typeof/isWebSocket.d.ts
2382
+ declare function isWebSocket(value: unknown): value is WebSocket;
2383
+ //#endregion
2384
+ //#region src/utils/typeof/isWindow.d.ts
2385
+ declare function isWindow(value: unknown): value is Window;
2386
+ //#endregion
2387
+ export { arrayCast, arrayCompete, arrayCounting, arrayDifference, arrayFirst, arrayFork, arrayIntersection, arrayLast, arrayMerge, arrayPick, arrayReplace, arraySplit, cloneDeep, enumEntries, enumKeys, enumTypeCheck, enumValues, isAbortSignal, isArray, isAsyncFunction, isAsyncGeneratorFunction, isBigInt, isBlob, isBoolean, isClass, isDate, isEqual, isError, isFalsy, isFalsyLike, isFile, isFunction, isGeneratorFunction, isInfinity, isInfinityLike, isInteger, isIterable, isMap, isNaN, isNegativeInteger, isNull, isNumber, isObject, isPositiveInteger, isPromise, isPromiseLike, isReadableStream, isRegExp, isSet, isString, isSymbol, isTypedArray, isURLSearchParams, isUndefined, isWeakMap, isWeakSet, isWebSocket, isWindow, mapEntries, objectAssign, objectCrush, objectEntries, objectKeys, objectPick, objectSwitch, objectValues, rowsToTree, stringInitialCase, stringReplace, stringTemplate, stringToJson, stringToNumber, stringToValues, to, toMathBignumber, toMathDecimal, toMathEvaluate, treeFilter, treeFind, treeForEach, treeMap, treeToRows };
2388
+ //# sourceMappingURL=index.d.ts.map