@pawover/kit 0.0.0-beta.8 → 0.0.1

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 (47) hide show
  1. package/package.json +89 -62
  2. package/packages/hooks/dist/alova.d.ts +31 -0
  3. package/packages/hooks/dist/alova.js +64 -0
  4. package/packages/hooks/dist/index.d.ts +1 -0
  5. package/packages/hooks/dist/index.js +0 -0
  6. package/packages/hooks/dist/metadata.json +16 -0
  7. package/packages/hooks/dist/react.d.ts +164 -0
  8. package/packages/hooks/dist/react.js +2112 -0
  9. package/packages/utils/dist/index.d.ts +4293 -0
  10. package/packages/utils/dist/index.js +1527 -0
  11. package/packages/utils/dist/math.d.ts +54 -0
  12. package/packages/utils/dist/math.js +56 -0
  13. package/packages/utils/dist/metadata.json +14 -0
  14. package/packages/utils/dist/string-DCWqoW4P.js +793 -0
  15. package/packages/utils/dist/vite.d.ts +16 -0
  16. package/packages/utils/dist/vite.js +26 -0
  17. package/packages/zod/dist/index.d.ts +58 -0
  18. package/packages/zod/dist/index.js +61 -0
  19. package/dist/enums.d.ts +0 -25
  20. package/dist/enums.d.ts.map +0 -1
  21. package/dist/enums.js +0 -25
  22. package/dist/enums.js.map +0 -1
  23. package/dist/hooks-alova.d.ts +0 -23
  24. package/dist/hooks-alova.d.ts.map +0 -1
  25. package/dist/hooks-alova.js +0 -39
  26. package/dist/hooks-alova.js.map +0 -1
  27. package/dist/hooks-react.d.ts +0 -95
  28. package/dist/hooks-react.d.ts.map +0 -1
  29. package/dist/hooks-react.js +0 -328
  30. package/dist/hooks-react.js.map +0 -1
  31. package/dist/index.d.ts +0 -3726
  32. package/dist/index.d.ts.map +0 -1
  33. package/dist/index.js +0 -1469
  34. package/dist/index.js.map +0 -1
  35. package/dist/patches-fetchEventSource.d.ts +0 -815
  36. package/dist/patches-fetchEventSource.d.ts.map +0 -1
  37. package/dist/patches-fetchEventSource.js +0 -316
  38. package/dist/patches-fetchEventSource.js.map +0 -1
  39. package/dist/vite.d.ts +0 -13
  40. package/dist/vite.d.ts.map +0 -1
  41. package/dist/vite.js +0 -23
  42. package/dist/vite.js.map +0 -1
  43. package/dist/zod.d.ts +0 -109
  44. package/dist/zod.d.ts.map +0 -1
  45. package/dist/zod.js +0 -143
  46. package/dist/zod.js.map +0 -1
  47. package/metadata.json +0 -167
package/dist/index.d.ts DELETED
@@ -1,3726 +0,0 @@
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[]): T | undefined;
50
- declare function arrayFirst<T>(initialList: readonly T[], saveValue: T): T;
51
- //#endregion
52
- //#region src/utils/array/arrayFork.d.ts
53
- /**
54
- * 数组分组过滤
55
- * - 给定一个数组和一个条件,返回一个由两个数组组成的元组,其中第一个数组包含所有满足条件的项,第二个数组包含所有不满足条件的项
56
- *
57
- * @param initialList 初始数组
58
- * @param match 条件匹配函数
59
- */
60
- declare function arrayFork<T>(initialList: readonly T[], match: (item: T) => boolean): [T[], T[]];
61
- //#endregion
62
- //#region src/utils/array/arrayIntersection.d.ts
63
- /**
64
- * 求数组交集
65
- *
66
- * @param initialList 初始数组
67
- * @param diffList 对比数组
68
- * @param match 匹配函数
69
- */
70
- declare function arrayIntersection<T>(initialList: readonly T[], diffList: readonly T[], match?: (row: T) => unknown): T[];
71
- //#endregion
72
- //#region src/utils/array/arrayLast.d.ts
73
- /**
74
- * 获取数组最后一项
75
- *
76
- * @param initialList 初始数组
77
- * @param saveValue 安全值
78
- */
79
- declare function arrayLast<T>(initialList: readonly T[]): T | undefined;
80
- declare function arrayLast<T>(initialList: readonly T[], saveValue: T): T;
81
- //#endregion
82
- //#region src/utils/array/arrayMerge.d.ts
83
- /**
84
- * 数组合并
85
- * - 通过给定的标识符匹配函数,用第二个数组中的匹配项替换第一个数组中匹配项的所有内容
86
- *
87
- * @param initialList 初始数组
88
- * @param mergeList 待合并数组
89
- * @param match 匹配函数
90
- */
91
- declare function arrayMerge<T>(initialList: readonly T[], mergeList: readonly T[], match?: (item: T) => unknown): T[];
92
- //#endregion
93
- //#region src/utils/array/arrayPick.d.ts
94
- /**
95
- * 数组选择
96
- * - 一次性应用 `filter` 和 `map` 操作
97
- *
98
- * @param initialList 初始数组
99
- * @param filter filter 函数
100
- * @param mapper map 函数
101
- */
102
- 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[];
103
- //#endregion
104
- //#region src/utils/array/arrayReplace.d.ts
105
- /**
106
- * 数组项替换
107
- * - 在给定的数组中,替换符合匹配函数结果的项目。只替换第一个匹配项。始终返回原始数组的副本。
108
- *
109
- * @param initialList 初始数组
110
- * @param newItem 替换项
111
- * @param match 匹配函数
112
- */
113
- declare function arrayReplace<T>(initialList: readonly T[], newItem: T, match: (row: T, index: number) => boolean): T[];
114
- //#endregion
115
- //#region src/utils/array/arraySplit.d.ts
116
- /**
117
- * 数组切分
118
- * - 将数组以指定的长度切分后,组合在高维数组中
119
- *
120
- * @param initialList 初始数组
121
- * @param size 分割尺寸,默认 `10`
122
- */
123
- declare function arraySplit<T>(initialList: readonly T[], size?: number): T[][];
124
- //#endregion
125
- //#region src/utils/device/isMobile.d.ts
126
- /**
127
- * 检测当前设备是否为移动设备
128
- *
129
- * @param maxWidth - 移动设备最大宽度(默认 768px)
130
- * @param dpi - 标准 DPI 基准(默认 160)
131
- */
132
- declare function isMobile(maxWidth?: number, dpi?: number): boolean;
133
- /**
134
- * 检测当前设备是否为IOS移动设备
135
- *
136
- * @param maxWidth - 移动设备最大宽度(默认 768px)
137
- * @param dpi - 标准 DPI 基准(默认 160)
138
- */
139
- declare function isISOMobile(maxWidth?: number, dpi?: number): boolean;
140
- //#endregion
141
- //#region src/utils/device/isTablet.d.ts
142
- /**
143
- * 检测当前设备是否为平板
144
- *
145
- * @param minWidth - 平板最小宽度(默认 768px)
146
- * @param maxWidth - 平板最大宽度(默认 1200px)
147
- * @param dpi - 标准 DPI 基准(默认 160)
148
- */
149
- declare function isTablet(minWidth?: number, maxWidth?: number, dpi?: number): boolean;
150
- //#endregion
151
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/basic.d.ts
152
- /**
153
- Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
154
-
155
- @category Class
156
- */
157
- type Class<T, Arguments extends unknown[] = any[]> = {
158
- prototype: Pick<T, keyof T>;
159
- new (...arguments_: Arguments): T;
160
- };
161
- //#endregion
162
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/union-to-intersection.d.ts
163
- /**
164
- 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).
165
-
166
- Inspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153).
167
-
168
- @example
169
- ```
170
- import type {UnionToIntersection} from 'type-fest';
171
-
172
- type Union = {the(): void} | {great(arg: string): void} | {escape: boolean};
173
-
174
- type Intersection = UnionToIntersection<Union>;
175
- //=> {the(): void; great(arg: string): void; escape: boolean};
176
- ```
177
-
178
- @category Type
179
- */
180
- type UnionToIntersection<Union> = (
181
- // `extends unknown` is always going to be the case and is used to convert the
182
- // `Union` into a [distributive conditional
183
- // type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
184
- Union extends unknown
185
- // The union type is used as the only argument to a function since the union
186
- // of function arguments is an intersection.
187
- ? (distributedUnion: Union) => void
188
- // This won't happen.
189
- : never
190
- // Infer the `Intersection` type since TypeScript represents the positional
191
- // arguments of unions of functions as an intersection of the union.
192
- ) extends ((mergedIntersection: infer Intersection) => void)
193
- // The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`
194
- ? Intersection & Union : never;
195
- //#endregion
196
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/keys-of-union.d.ts
197
- /**
198
- Create a union of all keys from a given type, even those exclusive to specific union members.
199
-
200
- Unlike the native `keyof` keyword, which returns keys present in **all** union members, this type returns keys from **any** member.
201
-
202
- @link https://stackoverflow.com/a/49402091
203
-
204
- @example
205
- ```
206
- import type {KeysOfUnion} from 'type-fest';
207
-
208
- type A = {
209
- common: string;
210
- a: number;
211
- };
212
-
213
- type B = {
214
- common: string;
215
- b: string;
216
- };
217
-
218
- type C = {
219
- common: string;
220
- c: boolean;
221
- };
222
-
223
- type Union = A | B | C;
224
-
225
- type CommonKeys = keyof Union;
226
- //=> 'common'
227
-
228
- type AllKeys = KeysOfUnion<Union>;
229
- //=> 'common' | 'a' | 'b' | 'c'
230
- ```
231
-
232
- @category Object
233
- */
234
- type KeysOfUnion<ObjectType> =
235
- // Hack to fix https://github.com/sindresorhus/type-fest/issues/1008
236
- keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;
237
- //#endregion
238
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/is-any.d.ts
239
- /**
240
- Returns a boolean for whether the given type is `any`.
241
-
242
- @link https://stackoverflow.com/a/49928360/1490091
243
-
244
- Useful in type utilities, such as disallowing `any`s to be passed to a function.
245
-
246
- @example
247
- ```
248
- import type {IsAny} from 'type-fest';
249
-
250
- const typedObject = {a: 1, b: 2} as const;
251
- const anyObject: any = {a: 1, b: 2};
252
-
253
- function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(object: O, key: K) {
254
- return object[key];
255
- }
256
-
257
- const typedA = get(typedObject, 'a');
258
- //=> 1
259
-
260
- const anyA = get(anyObject, 'a');
261
- //=> any
262
- ```
263
-
264
- @category Type Guard
265
- @category Utilities
266
- */
267
- type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
268
- //#endregion
269
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/is-optional-key-of.d.ts
270
- /**
271
- Returns a boolean for whether the given key is an optional key of type.
272
-
273
- This is useful when writing utility types or schema validators that need to differentiate `optional` keys.
274
-
275
- @example
276
- ```
277
- import type {IsOptionalKeyOf} from 'type-fest';
278
-
279
- type User = {
280
- name: string;
281
- surname: string;
282
-
283
- luckyNumber?: number;
284
- };
285
-
286
- type Admin = {
287
- name: string;
288
- surname?: string;
289
- };
290
-
291
- type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
292
- //=> true
293
-
294
- type T2 = IsOptionalKeyOf<User, 'name'>;
295
- //=> false
296
-
297
- type T3 = IsOptionalKeyOf<User, 'name' | 'luckyNumber'>;
298
- //=> boolean
299
-
300
- type T4 = IsOptionalKeyOf<User | Admin, 'name'>;
301
- //=> false
302
-
303
- type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
304
- //=> boolean
305
- ```
306
-
307
- @category Type Guard
308
- @category Utilities
309
- */
310
- type IsOptionalKeyOf<Type$1 extends object, Key$2 extends keyof Type$1> = IsAny<Type$1 | Key$2> extends true ? never : Key$2 extends keyof Type$1 ? Type$1 extends Record<Key$2, Type$1[Key$2]> ? false : true : false;
311
- //#endregion
312
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/optional-keys-of.d.ts
313
- /**
314
- Extract all optional keys from the given type.
315
-
316
- This is useful when you want to create a new type that contains different type values for the optional keys only.
317
-
318
- @example
319
- ```
320
- import type {OptionalKeysOf, Except} from 'type-fest';
321
-
322
- type User = {
323
- name: string;
324
- surname: string;
325
-
326
- luckyNumber?: number;
327
- };
328
-
329
- const REMOVE_FIELD = Symbol('remove field symbol');
330
- type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
331
- [Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
332
- };
333
-
334
- const update1: UpdateOperation<User> = {
335
- name: 'Alice',
336
- };
337
-
338
- const update2: UpdateOperation<User> = {
339
- name: 'Bob',
340
- luckyNumber: REMOVE_FIELD,
341
- };
342
- ```
343
-
344
- @category Utilities
345
- */
346
- type OptionalKeysOf<Type$1 extends object> = Type$1 extends unknown // For distributing `Type`
347
- ? (keyof { [Key in keyof Type$1 as IsOptionalKeyOf<Type$1, Key> extends false ? never : Key]: never }) & keyof Type$1 // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
348
- : never;
349
- //#endregion
350
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/required-keys-of.d.ts
351
- /**
352
- Extract all required keys from the given type.
353
-
354
- 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...
355
-
356
- @example
357
- ```
358
- import type {RequiredKeysOf} from 'type-fest';
359
-
360
- declare function createValidation<
361
- Entity extends object,
362
- Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
363
- >(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
364
-
365
- type User = {
366
- name: string;
367
- surname: string;
368
- luckyNumber?: number;
369
- };
370
-
371
- const validator1 = createValidation<User>('name', value => value.length < 25);
372
- const validator2 = createValidation<User>('surname', value => value.length < 25);
373
-
374
- // @ts-expect-error
375
- const validator3 = createValidation<User>('luckyNumber', value => value > 0);
376
- // Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
377
- ```
378
-
379
- @category Utilities
380
- */
381
- type RequiredKeysOf<Type$1 extends object> = Type$1 extends unknown // For distributing `Type`
382
- ? Exclude<keyof Type$1, OptionalKeysOf<Type$1>> : never;
383
- //#endregion
384
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/is-never.d.ts
385
- /**
386
- Returns a boolean for whether the given type is `never`.
387
-
388
- @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
389
- @link https://stackoverflow.com/a/53984913/10292952
390
- @link https://www.zhenghao.io/posts/ts-never
391
-
392
- Useful in type utilities, such as checking if something does not occur.
393
-
394
- @example
395
- ```
396
- import type {IsNever, And} from 'type-fest';
397
-
398
- type A = IsNever<never>;
399
- //=> true
400
-
401
- type B = IsNever<any>;
402
- //=> false
403
-
404
- type C = IsNever<unknown>;
405
- //=> false
406
-
407
- type D = IsNever<never[]>;
408
- //=> false
409
-
410
- type E = IsNever<object>;
411
- //=> false
412
-
413
- type F = IsNever<string>;
414
- //=> false
415
- ```
416
-
417
- @example
418
- ```
419
- import type {IsNever} from 'type-fest';
420
-
421
- type IsTrue<T> = T extends true ? true : false;
422
-
423
- // When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
424
- type A = IsTrue<never>;
425
- // ^? type A = never
426
-
427
- // If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
428
- type IsTrueFixed<T> =
429
- IsNever<T> extends true ? false : T extends true ? true : false;
430
-
431
- type B = IsTrueFixed<never>;
432
- // ^? type B = false
433
- ```
434
-
435
- @category Type Guard
436
- @category Utilities
437
- */
438
- type IsNever<T> = [T] extends [never] ? true : false;
439
- //#endregion
440
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/if.d.ts
441
- /**
442
- An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
443
-
444
- Use-cases:
445
- - 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'>`.
446
-
447
- Note:
448
- - 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'`.
449
- - Returns the else branch if the given type is `never`. For example, `If<never, 'Y', 'N'>` will return `'N'`.
450
-
451
- @example
452
- ```
453
- import type {If} from 'type-fest';
454
-
455
- type A = If<true, 'yes', 'no'>;
456
- //=> 'yes'
457
-
458
- type B = If<false, 'yes', 'no'>;
459
- //=> 'no'
460
-
461
- type C = If<boolean, 'yes', 'no'>;
462
- //=> 'yes' | 'no'
463
-
464
- type D = If<any, 'yes', 'no'>;
465
- //=> 'yes' | 'no'
466
-
467
- type E = If<never, 'yes', 'no'>;
468
- //=> 'no'
469
- ```
470
-
471
- @example
472
- ```
473
- import type {If, IsAny, IsNever} from 'type-fest';
474
-
475
- type A = If<IsAny<unknown>, 'is any', 'not any'>;
476
- //=> 'not any'
477
-
478
- type B = If<IsNever<never>, 'is never', 'not never'>;
479
- //=> 'is never'
480
- ```
481
-
482
- @example
483
- ```
484
- import type {If, IsEqual} from 'type-fest';
485
-
486
- type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
487
-
488
- type A = IfEqual<string, string, 'equal', 'not equal'>;
489
- //=> 'equal'
490
-
491
- type B = IfEqual<string, number, 'equal', 'not equal'>;
492
- //=> 'not equal'
493
- ```
494
-
495
- 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:
496
-
497
- @example
498
- ```
499
- import type {If, IsEqual, StringRepeat} from 'type-fest';
500
-
501
- type HundredZeroes = StringRepeat<'0', 100>;
502
-
503
- // The following implementation is not tail recursive
504
- type Includes<S extends string, Char extends string> =
505
- S extends `${infer First}${infer Rest}`
506
- ? If<IsEqual<First, Char>,
507
- 'found',
508
- Includes<Rest, Char>>
509
- : 'not found';
510
-
511
- // Hence, instantiations with long strings will fail
512
- // @ts-expect-error
513
- type Fails = Includes<HundredZeroes, '1'>;
514
- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
515
- // Error: Type instantiation is excessively deep and possibly infinite.
516
-
517
- // However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
518
- type IncludesWithoutIf<S extends string, Char extends string> =
519
- S extends `${infer First}${infer Rest}`
520
- ? IsEqual<First, Char> extends true
521
- ? 'found'
522
- : IncludesWithoutIf<Rest, Char>
523
- : 'not found';
524
-
525
- // Now, instantiations with long strings will work
526
- type Works = IncludesWithoutIf<HundredZeroes, '1'>;
527
- //=> 'not found'
528
- ```
529
-
530
- @category Type Guard
531
- @category Utilities
532
- */
533
- type If<Type$1 extends boolean, IfBranch, ElseBranch> = IsNever<Type$1> extends true ? ElseBranch : Type$1 extends true ? IfBranch : ElseBranch;
534
- //#endregion
535
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/unknown-array.d.ts
536
- /**
537
- Represents an array with `unknown` value.
538
-
539
- Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
540
-
541
- @example
542
- ```
543
- import type {UnknownArray} from 'type-fest';
544
-
545
- type IsArray<T> = T extends UnknownArray ? true : false;
546
-
547
- type A = IsArray<['foo']>;
548
- //=> true
549
-
550
- type B = IsArray<readonly number[]>;
551
- //=> true
552
-
553
- type C = IsArray<string>;
554
- //=> false
555
- ```
556
-
557
- @category Type
558
- @category Array
559
- */
560
- type UnknownArray = readonly unknown[];
561
- //#endregion
562
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/internal/type.d.ts
563
- /**
564
- Returns a boolean for whether A is false.
565
-
566
- @example
567
- ```
568
- type A = Not<true>;
569
- //=> false
570
-
571
- type B = Not<false>;
572
- //=> true
573
- ```
574
- */
575
- type Not<A$1 extends boolean> = A$1 extends true ? false : A$1 extends false ? true : never;
576
- /**
577
- An if-else-like type that resolves depending on whether the given type is `any` or `never`.
578
-
579
- @example
580
- ```
581
- // When `T` is a NOT `any` or `never` (like `string`) => Returns `IfNotAnyOrNever` branch
582
- type A = IfNotAnyOrNever<string, 'VALID', 'IS_ANY', 'IS_NEVER'>;
583
- //=> 'VALID'
584
-
585
- // When `T` is `any` => Returns `IfAny` branch
586
- type B = IfNotAnyOrNever<any, 'VALID', 'IS_ANY', 'IS_NEVER'>;
587
- //=> 'IS_ANY'
588
-
589
- // When `T` is `never` => Returns `IfNever` branch
590
- type C = IfNotAnyOrNever<never, 'VALID', 'IS_ANY', 'IS_NEVER'>;
591
- //=> 'IS_NEVER'
592
- ```
593
-
594
- 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:
595
-
596
- @example
597
- ```ts
598
- import type {StringRepeat} from 'type-fest';
599
-
600
- type NineHundredNinetyNineSpaces = StringRepeat<' ', 999>;
601
-
602
- // The following implementation is not tail recursive
603
- type TrimLeft<S extends string> = IfNotAnyOrNever<S, S extends ` ${infer R}` ? TrimLeft<R> : S>;
604
-
605
- // Hence, instantiations with long strings will fail
606
- // @ts-expect-error
607
- type T1 = TrimLeft<NineHundredNinetyNineSpaces>;
608
- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
609
- // Error: Type instantiation is excessively deep and possibly infinite.
610
-
611
- // To fix this, move the recursion into a helper type
612
- type TrimLeftOptimised<S extends string> = IfNotAnyOrNever<S, _TrimLeftOptimised<S>>;
613
-
614
- type _TrimLeftOptimised<S extends string> = S extends ` ${infer R}` ? _TrimLeftOptimised<R> : S;
615
-
616
- type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
617
- //=> ''
618
- ```
619
- */
620
- type IfNotAnyOrNever<T, IfNotAnyOrNever$1, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever$1>>;
621
- /**
622
- Indicates the value of `exactOptionalPropertyTypes` compiler option.
623
- */
624
- type IsExactOptionalPropertyTypesEnabled = [(string | undefined)?] extends [string?] ? false : true;
625
- //#endregion
626
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/internal/array.d.ts
627
- /**
628
- Transforms a tuple type by replacing it's rest element with a single element that has the same type as the rest element, while keeping all the non-rest elements intact.
629
-
630
- @example
631
- ```
632
- type A = CollapseRestElement<[string, string, ...number[]]>;
633
- //=> [string, string, number]
634
-
635
- type B = CollapseRestElement<[...string[], number, number]>;
636
- //=> [string, number, number]
637
-
638
- type C = CollapseRestElement<[string, string, ...Array<number | bigint>]>;
639
- //=> [string, string, number | bigint]
640
-
641
- type D = CollapseRestElement<[string, number]>;
642
- //=> [string, number]
643
- ```
644
-
645
- Note: Optional modifiers (`?`) are removed from elements unless the `exactOptionalPropertyTypes` compiler option is disabled. When disabled, there's an additional `| undefined` for optional elements.
646
-
647
- @example
648
- ```
649
- // `exactOptionalPropertyTypes` enabled
650
- type A = CollapseRestElement<[string?, string?, ...number[]]>;
651
- //=> [string, string, number]
652
-
653
- // `exactOptionalPropertyTypes` disabled
654
- type B = CollapseRestElement<[string?, string?, ...number[]]>;
655
- //=> [string | undefined, string | undefined, number]
656
- ```
657
- */
658
- type CollapseRestElement<TArray extends UnknownArray> = IfNotAnyOrNever<TArray, _CollapseRestElement<TArray>>;
659
- type _CollapseRestElement<TArray extends UnknownArray, ForwardAccumulator extends UnknownArray = [], BackwardAccumulator extends UnknownArray = []> = TArray extends UnknownArray // For distributing `TArray`
660
- ? keyof TArray & `${number}` extends never
661
- // Enters this branch, if `TArray` is empty (e.g., []),
662
- // or `TArray` contains no non-rest elements preceding the rest element (e.g., `[...string[]]` or `[...string[], string]`).
663
- ? TArray extends readonly [...infer Rest, infer Last] ? _CollapseRestElement<Rest, ForwardAccumulator, [Last, ...BackwardAccumulator]> // Accumulate elements that are present after the rest element.
664
- : TArray extends readonly [] ? [...ForwardAccumulator, ...BackwardAccumulator] : [...ForwardAccumulator, TArray[number], ...BackwardAccumulator] // Add the rest element between the accumulated elements.
665
- : TArray extends readonly [(infer First)?, ...infer Rest] ? _CollapseRestElement<Rest, [...ForwardAccumulator, '0' extends OptionalKeysOf<TArray> ? If<IsExactOptionalPropertyTypesEnabled, First, First | undefined> // Add `| undefined` for optional elements, if `exactOptionalPropertyTypes` is disabled.
666
- : First], BackwardAccumulator> : never // Should never happen, since `[(infer First)?, ...infer Rest]` is a top-type for arrays.
667
- : never; // Should never happen
668
- //#endregion
669
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/numeric.d.ts
670
- type _Numeric = number | bigint;
671
- type Zero = 0 | 0n;
672
-
673
- /**
674
- Matches the hidden `Infinity` type.
675
-
676
- Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/32277) if you want to have this type as a built-in in TypeScript.
677
-
678
- @see {@link NegativeInfinity}
679
-
680
- @category Numeric
681
- */
682
- // See https://github.com/microsoft/TypeScript/issues/31752
683
- // eslint-disable-next-line no-loss-of-precision
684
-
685
- /**
686
- A negative `number`/`bigint` (`-∞ < x < 0`)
687
-
688
- Use-case: Validating and documenting parameters.
689
-
690
- @see {@link NegativeInteger}
691
- @see {@link NonNegative}
692
-
693
- @category Numeric
694
- */
695
- type Negative<T extends _Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never;
696
- /**
697
- Returns a boolean for whether the given number is a negative number.
698
-
699
- @see {@link Negative}
700
-
701
- @example
702
- ```
703
- import type {IsNegative} from 'type-fest';
704
-
705
- type ShouldBeFalse = IsNegative<1>;
706
- type ShouldBeTrue = IsNegative<-1>;
707
- ```
708
-
709
- @category Numeric
710
- */
711
- type IsNegative<T extends _Numeric> = T extends Negative<T> ? true : false;
712
- //#endregion
713
- //#region node_modules/.pnpm/tagged-tag@1.0.0/node_modules/tagged-tag/index.d.ts
714
- declare const tag: unique symbol;
715
- //#endregion
716
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/tagged.d.ts
717
- // eslint-disable-next-line type-fest/require-exported-types
718
- type TagContainer<Token> = {
719
- readonly [tag]: Token;
720
- };
721
- type Tag<Token extends PropertyKey, TagMetadata> = TagContainer<{ [K in Token]: TagMetadata }>;
722
-
723
- /**
724
- Attach a "tag" to an arbitrary type. This allows you to create distinct types, that aren't assignable to one another, for distinct concepts in your program that should not be interchangeable, even if their runtime values have the same type. (See examples.)
725
-
726
- A type returned by `Tagged` can be passed to `Tagged` again, to create a type with multiple tags.
727
-
728
- [Read more about tagged types.](https://medium.com/@KevinBGreene/surviving-the-typescript-ecosystem-branding-and-type-tagging-6cf6e516523d)
729
-
730
- A tag's name is usually a string (and must be a string, number, or symbol), but each application of a tag can also contain an arbitrary type as its "metadata". See {@link GetTagMetadata} for examples and explanation.
731
-
732
- A type `A` returned by `Tagged` is assignable to another type `B` returned by `Tagged` if and only if:
733
- - the underlying (untagged) type of `A` is assignable to the underlying type of `B`;
734
- - `A` contains at least all the tags `B` has;
735
- - and the metadata type for each of `A`'s tags is assignable to the metadata type of `B`'s corresponding tag.
736
-
737
- There have been several discussions about adding similar features to TypeScript. Unfortunately, nothing has (yet) moved forward:
738
- - [Microsoft/TypeScript#202](https://github.com/microsoft/TypeScript/issues/202)
739
- - [Microsoft/TypeScript#4895](https://github.com/microsoft/TypeScript/issues/4895)
740
- - [Microsoft/TypeScript#33290](https://github.com/microsoft/TypeScript/pull/33290)
741
-
742
- @example
743
- ```
744
- import type {Tagged} from 'type-fest';
745
-
746
- type AccountNumber = Tagged<number, 'AccountNumber'>;
747
- type AccountBalance = Tagged<number, 'AccountBalance'>;
748
-
749
- function createAccountNumber(): AccountNumber {
750
- // As you can see, casting from a `number` (the underlying type being tagged) is allowed.
751
- return 2 as AccountNumber;
752
- }
753
-
754
- declare function getMoneyForAccount(accountNumber: AccountNumber): AccountBalance;
755
-
756
- // This will compile successfully.
757
- getMoneyForAccount(createAccountNumber());
758
-
759
- // But this won't, because it has to be explicitly passed as an `AccountNumber` type!
760
- // Critically, you could not accidentally use an `AccountBalance` as an `AccountNumber`.
761
- // @ts-expect-error
762
- getMoneyForAccount(2);
763
-
764
- // You can also use tagged values like their underlying, untagged type.
765
- // I.e., this will compile successfully because an `AccountNumber` can be used as a regular `number`.
766
- // In this sense, the underlying base type is not hidden, which differentiates tagged types from opaque types in other languages.
767
- const accountNumber = createAccountNumber() + 2;
768
- ```
769
-
770
- @example
771
- ```
772
- import type {Tagged} from 'type-fest';
773
-
774
- // You can apply multiple tags to a type by using `Tagged` repeatedly.
775
- type Url = Tagged<string, 'URL'>;
776
- type SpecialCacheKey = Tagged<Url, 'SpecialCacheKey'>;
777
-
778
- // You can also pass a union of tag names, so this is equivalent to the above, although it doesn't give you the ability to assign distinct metadata to each tag.
779
- type SpecialCacheKey2 = Tagged<string, 'URL' | 'SpecialCacheKey'>;
780
- ```
781
-
782
- @category Type
783
- */
784
- type Tagged<Type$1, TagName extends PropertyKey, TagMetadata = never> = Type$1 & Tag<TagName, TagMetadata>;
785
- /**
786
- Revert a tagged type back to its original type by removing all tags.
787
-
788
- Why is this necessary?
789
-
790
- 1. Use a `Tagged` type as object keys
791
- 2. Prevent TS4058 error: "Return type of exported function has or is using name X from external module Y but cannot be named"
792
-
793
- @example
794
- ```
795
- import type {Tagged, UnwrapTagged} from 'type-fest';
796
-
797
- type AccountType = Tagged<'SAVINGS' | 'CHECKING', 'AccountType'>;
798
-
799
- const moneyByAccountType: Record<UnwrapTagged<AccountType>, number> = {
800
- SAVINGS: 99,
801
- CHECKING: 0.1,
802
- };
803
-
804
- // Without UnwrapTagged, the following expression would throw a type error.
805
- const money = moneyByAccountType.SAVINGS; // TS error: Property 'SAVINGS' does not exist
806
-
807
- // Attempting to pass an non-Tagged type to UnwrapTagged will raise a type error.
808
- // @ts-expect-error
809
- type WontWork = UnwrapTagged<string>;
810
- ```
811
-
812
- @category Type
813
- */
814
- type UnwrapTagged<TaggedType extends Tag<PropertyKey, any>> = RemoveAllTags<TaggedType>;
815
- type RemoveAllTags<T> = T extends Tag<PropertyKey, any> ? { [ThisTag in keyof T[typeof tag]]: T extends Tagged<infer Type, ThisTag, T[typeof tag][ThisTag]> ? RemoveAllTags<Type> : never }[keyof T[typeof tag]] : T;
816
-
817
- /**
818
- Note: The `Opaque` type is deprecated in favor of `Tagged`.
819
-
820
- Attach a "tag" to an arbitrary type. This allows you to create distinct types, that aren't assignable to one another, for runtime values that would otherwise have the same type. (See examples.)
821
-
822
- The generic type parameters can be anything.
823
-
824
- Note that `Opaque` is somewhat of a misnomer here, in that, unlike [some alternative implementations](https://github.com/microsoft/TypeScript/issues/4895#issuecomment-425132582), the original, untagged type is not actually hidden. (E.g., functions that accept the untagged type can still be called with the "opaque" version -- but not vice-versa.)
825
-
826
- Also note that this implementation is limited to a single tag. If you want to allow multiple tags, use `Tagged` instead.
827
-
828
- [Read more about tagged types.](https://medium.com/@KevinBGreene/surviving-the-typescript-ecosystem-branding-and-type-tagging-6cf6e516523d)
829
-
830
- There have been several discussions about adding similar features to TypeScript. Unfortunately, nothing has (yet) moved forward:
831
- - [Microsoft/TypeScript#202](https://github.com/microsoft/TypeScript/issues/202)
832
- - [Microsoft/TypeScript#15408](https://github.com/Microsoft/TypeScript/issues/15408)
833
- - [Microsoft/TypeScript#15807](https://github.com/Microsoft/TypeScript/issues/15807)
834
-
835
- @example
836
- ```
837
- import type {Opaque} from 'type-fest';
838
-
839
- type AccountNumber = Opaque<number, 'AccountNumber'>;
840
- type AccountBalance = Opaque<number, 'AccountBalance'>;
841
-
842
- // The `Token` parameter allows the compiler to differentiate between types, whereas "unknown" will not. For example, consider the following structures:
843
- type ThingOne = Opaque<string>;
844
- type ThingTwo = Opaque<string>;
845
-
846
- // To the compiler, these types are allowed to be cast to each other as they have the same underlying type. They are both `string & { __opaque__: unknown }`.
847
- // To avoid this behaviour, you would instead pass the "Token" parameter, like so.
848
- type NewThingOne = Opaque<string, 'ThingOne'>;
849
- type NewThingTwo = Opaque<string, 'ThingTwo'>;
850
-
851
- // Now they're completely separate types, so the following will fail to compile.
852
- function createNewThingOne(): NewThingOne {
853
- // As you can see, casting from a string is still allowed. However, you may not cast NewThingOne to NewThingTwo, and vice versa.
854
- return 'new thing one' as NewThingOne;
855
- }
856
-
857
- // This will fail to compile, as they are fundamentally different types.
858
- // @ts-expect-error
859
- const thingTwo = createNewThingOne() as NewThingTwo;
860
-
861
- // Here's another example of opaque typing.
862
- function createAccountNumber(): AccountNumber {
863
- return 2 as AccountNumber;
864
- }
865
-
866
- declare function getMoneyForAccount(accountNumber: AccountNumber): AccountBalance;
867
-
868
- // This will compile successfully.
869
- getMoneyForAccount(createAccountNumber());
870
-
871
- // But this won't, because it has to be explicitly passed as an `AccountNumber` type.
872
- // @ts-expect-error
873
- getMoneyForAccount(2);
874
-
875
- // You can use opaque values like they aren't opaque too.
876
- const accountNumber = createAccountNumber();
877
-
878
- // This will compile successfully.
879
- const newAccountNumber = accountNumber + 2;
880
-
881
- // As a side note, you can (and should) use recursive types for your opaque types to make them stronger and hopefully easier to type.
882
- type Person = {
883
- id: Opaque<number, Person>;
884
- name: string;
885
- };
886
- ```
887
-
888
- @category Type
889
- @deprecated Use {@link Tagged} instead
890
- */
891
- //#endregion
892
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/is-literal.d.ts
893
- /**
894
- Returns a boolean for whether the given type is a `string` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
895
-
896
- Useful for:
897
- - providing strongly-typed string manipulation functions
898
- - constraining strings to be a string literal
899
- - type utilities, such as when constructing parsers and ASTs
900
-
901
- The implementation of this type is inspired by the trick mentioned in this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747).
902
-
903
- @example
904
- ```
905
- import type {IsStringLiteral} from 'type-fest';
906
-
907
- type CapitalizedString<T extends string> = IsStringLiteral<T> extends true ? Capitalize<T> : string;
908
-
909
- // https://github.com/yankeeinlondon/native-dash/blob/master/src/capitalize.ts
910
- function capitalize<T extends Readonly<string>>(input: T): CapitalizedString<T> {
911
- return (input.slice(0, 1).toUpperCase() + input.slice(1)) as CapitalizedString<T>;
912
- }
913
-
914
- const output = capitalize('hello, world!');
915
- //=> 'Hello, world!'
916
- ```
917
-
918
- @example
919
- ```
920
- // String types with infinite set of possible values return `false`.
921
-
922
- import type {IsStringLiteral} from 'type-fest';
923
-
924
- type AllUppercaseStrings = IsStringLiteral<Uppercase<string>>;
925
- //=> false
926
-
927
- type StringsStartingWithOn = IsStringLiteral<`on${string}`>;
928
- //=> false
929
-
930
- // This behaviour is particularly useful in string manipulation utilities, as infinite string types often require separate handling.
931
-
932
- type Length<S extends string, Counter extends never[] = []> =
933
- IsStringLiteral<S> extends false
934
- ? number // return `number` for infinite string types
935
- : S extends `${string}${infer Tail}`
936
- ? Length<Tail, [...Counter, never]>
937
- : Counter['length'];
938
-
939
- type L1 = Length<Lowercase<string>>;
940
- //=> number
941
-
942
- type L2 = Length<`${number}`>;
943
- //=> number
944
- ```
945
-
946
- @category Type Guard
947
- @category Utilities
948
- */
949
- type IsStringLiteral<S> = IfNotAnyOrNever<S, _IsStringLiteral<CollapseLiterals<S extends TagContainer<any> ? UnwrapTagged<S> : S>>, false, false>;
950
- type _IsStringLiteral<S> =
951
- // If `T` is an infinite string type (e.g., `on${string}`), `Record<T, never>` produces an index signature,
952
- // and since `{}` extends index signatures, the result becomes `false`.
953
- S extends string ? {} extends Record<S, never> ? false : true : false;
954
- //#endregion
955
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/tuple-of.d.ts
956
- /**
957
- Create a tuple type of the specified length with elements of the specified type.
958
-
959
- @example
960
- ```
961
- import type {TupleOf} from 'type-fest';
962
-
963
- type RGB = TupleOf<3, number>;
964
- //=> [number, number, number]
965
-
966
- type Line = TupleOf<2, {x: number; y: number}>;
967
- //=> [{x: number; y: number}, {x: number; y: number}]
968
-
969
- type TicTacToeBoard = TupleOf<3, TupleOf<3, 'X' | 'O' | null>>;
970
- //=> [['X' | 'O' | null, 'X' | 'O' | null, 'X' | 'O' | null], ['X' | 'O' | null, 'X' | 'O' | null, 'X' | 'O' | null], ['X' | 'O' | null, 'X' | 'O' | null, 'X' | 'O' | null]]
971
- ```
972
-
973
- @example
974
- ```
975
- import type {TupleOf} from 'type-fest';
976
-
977
- type Range<Start extends number, End extends number> = Exclude<keyof TupleOf<End>, keyof TupleOf<Start>>;
978
-
979
- type ZeroToFour = Range<0, 5>;
980
- //=> '0' | '1' | '2' | '3' | '4'
981
-
982
- type ThreeToEight = Range<3, 9>;
983
- //=> '3' | '4' | '5' | '6' | '7' | '8'
984
- ```
985
-
986
- Note: If the specified length is the non-literal `number` type, the result will not be a tuple but a regular array.
987
-
988
- @example
989
- ```
990
- import type {TupleOf} from 'type-fest';
991
-
992
- type StringArray = TupleOf<number, string>;
993
- //=> string[]
994
- ```
995
-
996
- Note: If the type for elements is not specified, it will default to `unknown`.
997
-
998
- @example
999
- ```
1000
- import type {TupleOf} from 'type-fest';
1001
-
1002
- type UnknownTriplet = TupleOf<3>;
1003
- //=> [unknown, unknown, unknown]
1004
- ```
1005
-
1006
- Note: If the specified length is negative, the result will be an empty tuple.
1007
-
1008
- @example
1009
- ```
1010
- import type {TupleOf} from 'type-fest';
1011
-
1012
- type EmptyTuple = TupleOf<-3, string>;
1013
- //=> []
1014
- ```
1015
-
1016
- Note: If you need a readonly tuple, simply wrap this type with `Readonly`, for example, to create `readonly [number, number, number]` use `Readonly<TupleOf<3, number>>`.
1017
-
1018
- @category Array
1019
- */
1020
- type TupleOf<Length extends number, Fill = unknown> = IfNotAnyOrNever<Length, _TupleOf<If<IsNegative<Length>, 0, Length>, Fill, []>, Fill[], []>;
1021
- type _TupleOf<L$1 extends number, Fill, Accumulator extends UnknownArray> = number extends L$1 ? Fill[] : L$1 extends Accumulator['length'] ? Accumulator : _TupleOf<L$1, Fill, [...Accumulator, Fill]>;
1022
- //#endregion
1023
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/simplify.d.ts
1024
- /**
1025
- 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.
1026
-
1027
- @example
1028
- ```
1029
- import type {Simplify} from 'type-fest';
1030
-
1031
- type PositionProps = {
1032
- top: number;
1033
- left: number;
1034
- };
1035
-
1036
- type SizeProps = {
1037
- width: number;
1038
- height: number;
1039
- };
1040
-
1041
- // In your editor, hovering over `Props` will show a flattened object with all the properties.
1042
- type Props = Simplify<PositionProps & SizeProps>;
1043
- ```
1044
-
1045
- 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.
1046
-
1047
- 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`.
1048
-
1049
- @example
1050
- ```
1051
- import type {Simplify} from 'type-fest';
1052
-
1053
- interface SomeInterface {
1054
- foo: number;
1055
- bar?: string;
1056
- baz: number | undefined;
1057
- }
1058
-
1059
- type SomeType = {
1060
- foo: number;
1061
- bar?: string;
1062
- baz: number | undefined;
1063
- };
1064
-
1065
- const literal = {foo: 123, bar: 'hello', baz: 456};
1066
- const someType: SomeType = literal;
1067
- const someInterface: SomeInterface = literal;
1068
-
1069
- declare function fn(object: Record<string, unknown>): void;
1070
-
1071
- fn(literal); // Good: literal object type is sealed
1072
- fn(someType); // Good: type is sealed
1073
- // @ts-expect-error
1074
- fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
1075
- fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
1076
- ```
1077
-
1078
- @link https://github.com/microsoft/TypeScript/issues/15300
1079
- @see {@link SimplifyDeep}
1080
- @category Object
1081
- */
1082
- type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
1083
- //#endregion
1084
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/is-equal.d.ts
1085
- /**
1086
- Returns a boolean for whether the two given types are equal.
1087
-
1088
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
1089
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
1090
-
1091
- Use-cases:
1092
- - If you want to make a conditional branch based on the result of a comparison of two types.
1093
-
1094
- @example
1095
- ```
1096
- import type {IsEqual} from 'type-fest';
1097
-
1098
- // This type returns a boolean for whether the given array includes the given item.
1099
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
1100
- type Includes<Value extends readonly any[], Item> =
1101
- Value extends readonly [Value[0], ...infer rest]
1102
- ? IsEqual<Value[0], Item> extends true
1103
- ? true
1104
- : Includes<rest, Item>
1105
- : false;
1106
- ```
1107
-
1108
- @category Type Guard
1109
- @category Utilities
1110
- */
1111
- type IsEqual<A$1, B$1> = [A$1] extends [B$1] ? [B$1] extends [A$1] ? _IsEqual<A$1, B$1> : false : false;
1112
- // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
1113
- 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;
1114
- //#endregion
1115
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/omit-index-signature.d.ts
1116
- /**
1117
- Omit any index signatures from the given object type, leaving only explicitly defined properties.
1118
-
1119
- This is the counterpart of `PickIndexSignature`.
1120
-
1121
- Use-cases:
1122
- - Remove overly permissive signatures from third-party types.
1123
-
1124
- This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747).
1125
-
1126
- 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>`.
1127
-
1128
- (The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.)
1129
-
1130
- ```
1131
- const indexed: Record<string, unknown> = {}; // Allowed
1132
-
1133
- // @ts-expect-error
1134
- const keyed: Record<'foo', unknown> = {}; // Error
1135
- // => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
1136
- ```
1137
-
1138
- 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:
1139
-
1140
- ```
1141
- type Indexed = {} extends Record<string, unknown>
1142
- ? '✅ `{}` is assignable to `Record<string, unknown>`'
1143
- : '❌ `{}` is NOT assignable to `Record<string, unknown>`';
1144
- // => '✅ `{}` is assignable to `Record<string, unknown>`'
1145
-
1146
- type Keyed = {} extends Record<'foo' | 'bar', unknown>
1147
- ? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`'
1148
- : '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`';
1149
- // => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"
1150
- ```
1151
-
1152
- 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`...
1153
-
1154
- ```
1155
- type OmitIndexSignature<ObjectType> = {
1156
- [KeyType in keyof ObjectType // Map each key of `ObjectType`...
1157
- ]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
1158
- };
1159
- ```
1160
-
1161
- ...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
1162
-
1163
- ```
1164
- type OmitIndexSignature<ObjectType> = {
1165
- [KeyType in keyof ObjectType
1166
- // Is `{}` assignable to `Record<KeyType, unknown>`?
1167
- as {} extends Record<KeyType, unknown>
1168
- ? never // ✅ `{}` is assignable to `Record<KeyType, unknown>`
1169
- : KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
1170
- ]: ObjectType[KeyType];
1171
- };
1172
- ```
1173
-
1174
- 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.
1175
-
1176
- @example
1177
- ```
1178
- import type {OmitIndexSignature} from 'type-fest';
1179
-
1180
- type Example = {
1181
- // These index signatures will be removed.
1182
- [x: string]: any;
1183
- [x: number]: any;
1184
- [x: symbol]: any;
1185
- [x: `head-${string}`]: string;
1186
- [x: `${string}-tail`]: string;
1187
- [x: `head-${string}-tail`]: string;
1188
- [x: `${bigint}`]: string;
1189
- [x: `embedded-${number}`]: string;
1190
-
1191
- // These explicitly defined keys will remain.
1192
- foo: 'bar';
1193
- qux?: 'baz';
1194
- };
1195
-
1196
- type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
1197
- // => { foo: 'bar'; qux?: 'baz' | undefined; }
1198
- ```
1199
-
1200
- @see {@link PickIndexSignature}
1201
- @category Object
1202
- */
1203
- type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
1204
- //#endregion
1205
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/pick-index-signature.d.ts
1206
- /**
1207
- Pick only index signatures from the given object type, leaving out all explicitly defined properties.
1208
-
1209
- This is the counterpart of `OmitIndexSignature`.
1210
-
1211
- @example
1212
- ```
1213
- import type {PickIndexSignature} from 'type-fest';
1214
-
1215
- declare const symbolKey: unique symbol;
1216
-
1217
- type Example = {
1218
- // These index signatures will remain.
1219
- [x: string]: unknown;
1220
- [x: number]: unknown;
1221
- [x: symbol]: unknown;
1222
- [x: `head-${string}`]: string;
1223
- [x: `${string}-tail`]: string;
1224
- [x: `head-${string}-tail`]: string;
1225
- [x: `${bigint}`]: string;
1226
- [x: `embedded-${number}`]: string;
1227
-
1228
- // These explicitly defined keys will be removed.
1229
- ['kebab-case-key']: string;
1230
- [symbolKey]: string;
1231
- foo: 'bar';
1232
- qux?: 'baz';
1233
- };
1234
-
1235
- type ExampleIndexSignature = PickIndexSignature<Example>;
1236
- // {
1237
- // [x: string]: unknown;
1238
- // [x: number]: unknown;
1239
- // [x: symbol]: unknown;
1240
- // [x: `head-${string}`]: string;
1241
- // [x: `${string}-tail`]: string;
1242
- // [x: `head-${string}-tail`]: string;
1243
- // [x: `${bigint}`]: string;
1244
- // [x: `embedded-${number}`]: string;
1245
- // }
1246
- ```
1247
-
1248
- @see {@link OmitIndexSignature}
1249
- @category Object
1250
- */
1251
- type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
1252
- //#endregion
1253
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/merge.d.ts
1254
- // Merges two objects without worrying about index signatures.
1255
- type SimpleMerge<Destination, Source> = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source;
1256
-
1257
- /**
1258
- Merge two types into a new type. Keys of the second type overrides keys of the first type.
1259
-
1260
- @example
1261
- ```
1262
- import type {Merge} from 'type-fest';
1263
-
1264
- type Foo = {
1265
- [x: string]: unknown;
1266
- [x: number]: unknown;
1267
- foo: string;
1268
- bar: symbol;
1269
- };
1270
-
1271
- type Bar = {
1272
- [x: number]: number;
1273
- [x: symbol]: unknown;
1274
- bar: Date;
1275
- baz: boolean;
1276
- };
1277
-
1278
- export type FooBar = Merge<Foo, Bar>;
1279
- // => {
1280
- // [x: string]: unknown;
1281
- // [x: number]: number;
1282
- // [x: symbol]: unknown;
1283
- // foo: string;
1284
- // bar: Date;
1285
- // baz: boolean;
1286
- // }
1287
- ```
1288
-
1289
- @category Object
1290
- */
1291
- type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
1292
- //#endregion
1293
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/internal/object.d.ts
1294
- /**
1295
- Works similar to the built-in `Pick` utility type, except for the following differences:
1296
- - Distributes over union types and allows picking keys from any member of the union type.
1297
- - Primitives types are returned as-is.
1298
- - Picks all keys if `Keys` is `any`.
1299
- - Doesn't pick `number` from a `string` index signature.
1300
-
1301
- @example
1302
- ```
1303
- type ImageUpload = {
1304
- url: string;
1305
- size: number;
1306
- thumbnailUrl: string;
1307
- };
1308
-
1309
- type VideoUpload = {
1310
- url: string;
1311
- duration: number;
1312
- encodingFormat: string;
1313
- };
1314
-
1315
- // Distributes over union types and allows picking keys from any member of the union type
1316
- type MediaDisplay = HomomorphicPick<ImageUpload | VideoUpload, "url" | "size" | "duration">;
1317
- //=> {url: string; size: number} | {url: string; duration: number}
1318
-
1319
- // Primitive types are returned as-is
1320
- type Primitive = HomomorphicPick<string | number, 'toUpperCase' | 'toString'>;
1321
- //=> string | number
1322
-
1323
- // Picks all keys if `Keys` is `any`
1324
- type Any = HomomorphicPick<{a: 1; b: 2} | {c: 3}, any>;
1325
- //=> {a: 1; b: 2} | {c: 3}
1326
-
1327
- // Doesn't pick `number` from a `string` index signature
1328
- type IndexSignature = HomomorphicPick<{[k: string]: unknown}, number>;
1329
- //=> {}
1330
- */
1331
- type HomomorphicPick<T, Keys extends KeysOfUnion<T>> = { [P in keyof T as Extract<P, Keys>]: T[P] };
1332
- /**
1333
- Merges user specified options with default options.
1334
-
1335
- @example
1336
- ```
1337
- type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
1338
- type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
1339
- type SpecifiedOptions = {leavesOnly: true};
1340
-
1341
- type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
1342
- //=> {maxRecursionDepth: 10; leavesOnly: true}
1343
- ```
1344
-
1345
- @example
1346
- ```
1347
- // Complains if default values are not provided for optional options
1348
-
1349
- type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
1350
- type DefaultPathsOptions = {maxRecursionDepth: 10};
1351
- type SpecifiedOptions = {};
1352
-
1353
- type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
1354
- // ~~~~~~~~~~~~~~~~~~~
1355
- // Property 'leavesOnly' is missing in type 'DefaultPathsOptions' but required in type '{ maxRecursionDepth: number; leavesOnly: boolean; }'.
1356
- ```
1357
-
1358
- @example
1359
- ```
1360
- // Complains if an option's default type does not conform to the expected type
1361
-
1362
- type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
1363
- type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'};
1364
- type SpecifiedOptions = {};
1365
-
1366
- type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
1367
- // ~~~~~~~~~~~~~~~~~~~
1368
- // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
1369
- ```
1370
-
1371
- @example
1372
- ```
1373
- // Complains if an option's specified type does not conform to the expected type
1374
-
1375
- type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
1376
- type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
1377
- type SpecifiedOptions = {leavesOnly: 'yes'};
1378
-
1379
- type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
1380
- // ~~~~~~~~~~~~~~~~
1381
- // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
1382
- ```
1383
- */
1384
- 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>>>>;
1385
- // `& Required<Options>` ensures that `ApplyDefaultOptions<SomeOption, ...>` is always assignable to `Required<SomeOption>`
1386
-
1387
- /**
1388
- Collapses literal types in a union into their corresponding primitive types, when possible. For example, `CollapseLiterals<'foo' | 'bar' | (string & {})>` returns `string`.
1389
-
1390
- Note: This doesn't collapse literals within tagged types. For example, `CollapseLiterals<Tagged<'foo' | (string & {}), 'Tag'>>` returns `("foo" & Tag<"Tag", never>) | (string & Tag<"Tag", never>)` and not `string & Tag<"Tag", never>`.
1391
-
1392
- Use-case: For collapsing unions created using {@link LiteralUnion}.
1393
-
1394
- @example
1395
- ```
1396
- import type {LiteralUnion} from 'type-fest';
1397
-
1398
- type A = CollapseLiterals<'foo' | 'bar' | (string & {})>;
1399
- //=> string
1400
-
1401
- type B = CollapseLiterals<LiteralUnion<1 | 2 | 3, number>>;
1402
- //=> number
1403
-
1404
- type C = CollapseLiterals<LiteralUnion<'onClick' | 'onChange', `on${string}`>>;
1405
- //=> `on${string}`
1406
-
1407
- type D = CollapseLiterals<'click' | 'change' | (`on${string}` & {})>;
1408
- //=> 'click' | 'change' | `on${string}`
1409
-
1410
- type E = CollapseLiterals<LiteralUnion<'foo' | 'bar', string> | null | undefined>;
1411
- //=> string | null | undefined
1412
- ```
1413
- */
1414
- type CollapseLiterals<T> = {} extends T ? T : T extends infer U & {} ? U : T;
1415
- //#endregion
1416
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/or.d.ts
1417
- /**
1418
- Returns a boolean for whether either of two given types is true.
1419
-
1420
- Use-case: Constructing complex conditional types where at least one condition must be satisfied.
1421
-
1422
- @example
1423
- ```
1424
- import type {Or} from 'type-fest';
1425
-
1426
- type TT = Or<true, true>;
1427
- //=> true
1428
-
1429
- type TF = Or<true, false>;
1430
- //=> true
1431
-
1432
- type FT = Or<false, true>;
1433
- //=> true
1434
-
1435
- type FF = Or<false, false>;
1436
- //=> false
1437
- ```
1438
-
1439
- Note: When `boolean` is passed as an argument, it is distributed into separate cases, and the final result is a union of those cases.
1440
- For example, `Or<false, boolean>` expands to `Or<false, true> | Or<false, false>`, which simplifies to `true | false` (i.e., `boolean`).
1441
-
1442
- @example
1443
- ```
1444
- import type {Or} from 'type-fest';
1445
-
1446
- type A = Or<false, boolean>;
1447
- //=> boolean
1448
-
1449
- type B = Or<boolean, false>;
1450
- //=> boolean
1451
-
1452
- type C = Or<true, boolean>;
1453
- //=> true
1454
-
1455
- type D = Or<boolean, true>;
1456
- //=> true
1457
-
1458
- type E = Or<boolean, boolean>;
1459
- //=> boolean
1460
- ```
1461
-
1462
- Note: If `never` is passed as an argument, it is treated as `false` and the result is computed accordingly.
1463
-
1464
- @example
1465
- ```
1466
- import type {Or} from 'type-fest';
1467
-
1468
- type A = Or<true, never>;
1469
- //=> true
1470
-
1471
- type B = Or<never, true>;
1472
- //=> true
1473
-
1474
- type C = Or<false, never>;
1475
- //=> false
1476
-
1477
- type D = Or<never, false>;
1478
- //=> false
1479
-
1480
- type E = Or<boolean, never>;
1481
- //=> boolean
1482
-
1483
- type F = Or<never, boolean>;
1484
- //=> boolean
1485
-
1486
- type G = Or<never, never>;
1487
- //=> false
1488
- ```
1489
-
1490
- @see {@link And}
1491
- @see {@link Xor}
1492
- */
1493
- type Or<A$1 extends boolean, B$1 extends boolean> = _Or<If<IsNever<A$1>, false, A$1>, If<IsNever<B$1>, false, B$1>>;
1494
- // `never` is treated as `false`
1495
-
1496
- type _Or<A$1 extends boolean, B$1 extends boolean> = A$1 extends true ? true : B$1 extends true ? true : false;
1497
- //#endregion
1498
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/all-extend.d.ts
1499
- /**
1500
- @see {@link AllExtend}
1501
- */
1502
- type AllExtendOptions = {
1503
- /**
1504
- Consider `never` elements to match the target type only if the target type itself is `never` (or `any`).
1505
- - When set to `true` (default), `never` is _not_ treated as a bottom type, instead, it is treated as a type that matches only itself (or `any`).
1506
- - When set to `false`, `never` is treated as a bottom type, and behaves as it normally would.
1507
- @default true
1508
- @example
1509
- ```
1510
- import type {AllExtend} from 'type-fest';
1511
- type A = AllExtend<[1, 2, never], number, {strictNever: true}>;
1512
- //=> false
1513
- type B = AllExtend<[1, 2, never], number, {strictNever: false}>;
1514
- //=> true
1515
- type C = AllExtend<[never, never], never, {strictNever: true}>;
1516
- //=> true
1517
- type D = AllExtend<[never, never], never, {strictNever: false}>;
1518
- //=> true
1519
- type E = AllExtend<['a', 'b', never], any, {strictNever: true}>;
1520
- //=> true
1521
- type F = AllExtend<['a', 'b', never], any, {strictNever: false}>;
1522
- //=> true
1523
- type G = AllExtend<[never, 1], never, {strictNever: true}>;
1524
- //=> false
1525
- type H = AllExtend<[never, 1], never, {strictNever: false}>;
1526
- //=> false
1527
- ```
1528
- */
1529
- strictNever?: boolean;
1530
- };
1531
- type DefaultAllExtendOptions = {
1532
- strictNever: true;
1533
- };
1534
-
1535
- /**
1536
- Returns a boolean for whether every element in an array type extends another type.
1537
-
1538
- @example
1539
- ```
1540
- import type {AllExtend} from 'type-fest';
1541
-
1542
- type A = AllExtend<[1, 2, 3], number>;
1543
- //=> true
1544
-
1545
- type B = AllExtend<[1, 2, '3'], number>;
1546
- //=> false
1547
-
1548
- type C = AllExtend<[number, number | string], number>;
1549
- //=> boolean
1550
-
1551
- type D = AllExtend<[true, boolean, true], true>;
1552
- //=> boolean
1553
- ```
1554
-
1555
- Note: Behaviour of optional elements depend on the `exactOptionalPropertyTypes` compiler option. When the option is disabled, the target type must include `undefined` for a successful match.
1556
-
1557
- ```
1558
- import type {AllExtend} from 'type-fest';
1559
-
1560
- // `exactOptionalPropertyTypes` enabled
1561
- type A = AllExtend<[1?, 2?, 3?], number>;
1562
- //=> true
1563
-
1564
- // `exactOptionalPropertyTypes` disabled
1565
- type B = AllExtend<[1?, 2?, 3?], number>;
1566
- //=> false
1567
-
1568
- // `exactOptionalPropertyTypes` disabled
1569
- type C = AllExtend<[1?, 2?, 3?], number | undefined>;
1570
- //=> true
1571
- ```
1572
-
1573
- @see {@link AllExtendOptions}
1574
-
1575
- @category Utilities
1576
- @category Array
1577
- */
1578
- type AllExtend<TArray extends UnknownArray, Type$1, Options extends AllExtendOptions = {}> = _AllExtend<CollapseRestElement<TArray>, Type$1, ApplyDefaultOptions<AllExtendOptions, DefaultAllExtendOptions, Options>>;
1579
- type _AllExtend<TArray extends UnknownArray, Type$1, Options extends Required<AllExtendOptions>> = IfNotAnyOrNever<TArray, If<IsAny<Type$1>, true, TArray extends readonly [infer First, ...infer Rest] ? IsNever<First> extends true ? Or<IsNever<Type$1>, Not<Options['strictNever']>> extends true
1580
- // If target `Type` is also `never` OR `strictNever` is disabled, recurse further.
1581
- ? _AllExtend<Rest, Type$1, Options> : false : First extends Type$1 ? _AllExtend<Rest, Type$1, Options> : false : true>, false, false>;
1582
- //#endregion
1583
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/and.d.ts
1584
- /**
1585
- Returns a boolean for whether two given types are both true.
1586
-
1587
- Use-case: Constructing complex conditional types where multiple conditions must be satisfied.
1588
-
1589
- @example
1590
- ```
1591
- import type {And} from 'type-fest';
1592
-
1593
- type TT = And<true, true>;
1594
- //=> true
1595
-
1596
- type TF = And<true, false>;
1597
- //=> false
1598
-
1599
- type FT = And<false, true>;
1600
- //=> false
1601
-
1602
- type FF = And<false, false>;
1603
- //=> false
1604
- ```
1605
-
1606
- Note: When `boolean` is passed as an argument, it is distributed into separate cases, and the final result is a union of those cases.
1607
- For example, `And<true, boolean>` expands to `And<true, true> | And<true, false>`, which simplifies to `true | false` (i.e., `boolean`).
1608
-
1609
- @example
1610
- ```
1611
- import type {And} from 'type-fest';
1612
-
1613
- type A = And<true, boolean>;
1614
- //=> boolean
1615
-
1616
- type B = And<boolean, true>;
1617
- //=> boolean
1618
-
1619
- type C = And<false, boolean>;
1620
- //=> false
1621
-
1622
- type D = And<boolean, false>;
1623
- //=> false
1624
-
1625
- type E = And<boolean, boolean>;
1626
- //=> boolean
1627
- ```
1628
-
1629
- Note: If either of the types is `never`, the result becomes `false`.
1630
-
1631
- @example
1632
- ```
1633
- import type {And} from 'type-fest';
1634
-
1635
- type A = And<true, never>;
1636
- //=> false
1637
-
1638
- type B = And<never, true>;
1639
- //=> false
1640
-
1641
- type C = And<false, never>;
1642
- //=> false
1643
-
1644
- type D = And<never, false>;
1645
- //=> false
1646
-
1647
- type E = And<boolean, never>;
1648
- //=> false
1649
-
1650
- type F = And<never, boolean>;
1651
- //=> false
1652
-
1653
- type G = And<never, never>;
1654
- //=> false
1655
- ```
1656
-
1657
- @see {@link Or}
1658
- @see {@link Xor}
1659
- */
1660
- type And<A$1 extends boolean, B$1 extends boolean> = AllExtend<[A$1, B$1], true>;
1661
- //#endregion
1662
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/except.d.ts
1663
- /**
1664
- Filter out keys from an object.
1665
-
1666
- Returns `never` if `Exclude` is strictly equal to `Key`.
1667
- Returns `never` if `Key` extends `Exclude`.
1668
- Returns `Key` otherwise.
1669
-
1670
- @example
1671
- ```
1672
- type Filtered = Filter<'foo', 'foo'>;
1673
- //=> never
1674
- ```
1675
-
1676
- @example
1677
- ```
1678
- type Filtered = Filter<'bar', string>;
1679
- //=> never
1680
- ```
1681
-
1682
- @example
1683
- ```
1684
- type Filtered = Filter<'bar', 'foo'>;
1685
- //=> 'bar'
1686
- ```
1687
-
1688
- @see {Except}
1689
- */
1690
- type Filter<KeyType$1, ExcludeType> = IsEqual<KeyType$1, ExcludeType> extends true ? never : (KeyType$1 extends ExcludeType ? never : KeyType$1);
1691
- type ExceptOptions = {
1692
- /**
1693
- Disallow assigning non-specified properties.
1694
- Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
1695
- @default false
1696
- */
1697
- requireExactProps?: boolean;
1698
- };
1699
- type DefaultExceptOptions = {
1700
- requireExactProps: false;
1701
- };
1702
-
1703
- /**
1704
- Create a type from an object type without certain keys.
1705
-
1706
- We recommend setting the `requireExactProps` option to `true`.
1707
-
1708
- 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.
1709
-
1710
- 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)).
1711
-
1712
- @example
1713
- ```
1714
- import type {Except} from 'type-fest';
1715
-
1716
- type Foo = {
1717
- a: number;
1718
- b: string;
1719
- };
1720
-
1721
- type FooWithoutA = Except<Foo, 'a'>;
1722
- //=> {b: string}
1723
-
1724
- // @ts-expect-error
1725
- const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
1726
- //=> errors: 'a' does not exist in type '{ b: string; }'
1727
-
1728
- type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
1729
- //=> {a: number} & Partial<Record<"b", never>>
1730
-
1731
- // @ts-expect-error
1732
- const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
1733
- //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
1734
-
1735
- // The `Omit` utility type doesn't work when omitting specific keys from objects containing index signatures.
1736
-
1737
- // Consider the following example:
1738
-
1739
- type UserData = {
1740
- [metadata: string]: string;
1741
- email: string;
1742
- name: string;
1743
- role: 'admin' | 'user';
1744
- };
1745
-
1746
- // `Omit` clearly doesn't behave as expected in this case:
1747
- type PostPayload = Omit<UserData, 'email'>;
1748
- //=> { [x: string]: string; [x: number]: string; }
1749
-
1750
- // In situations like this, `Except` works better.
1751
- // It simply removes the `email` key while preserving all the other keys.
1752
- type PostPayloadFixed = Except<UserData, 'email'>;
1753
- //=> { [x: string]: string; name: string; role: 'admin' | 'user'; }
1754
- ```
1755
-
1756
- @category Object
1757
- */
1758
- type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
1759
- 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>> : {});
1760
- //#endregion
1761
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/union-to-tuple.d.ts
1762
- /**
1763
- Returns the last element of a union type.
1764
-
1765
- @example
1766
- ```
1767
- type Last = LastOfUnion<1 | 2 | 3>;
1768
- //=> 3
1769
- ```
1770
- */
1771
- type LastOfUnion<T> = UnionToIntersection<T extends any ? () => T : never> extends (() => (infer R)) ? R : never;
1772
-
1773
- /**
1774
- Convert a union type into an unordered tuple type of its elements.
1775
-
1776
- "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.
1777
-
1778
- 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.
1779
-
1780
- @example
1781
- ```
1782
- import type {UnionToTuple} from 'type-fest';
1783
-
1784
- type Numbers = 1 | 2 | 3;
1785
- type NumbersTuple = UnionToTuple<Numbers>;
1786
- //=> [1, 2, 3]
1787
- ```
1788
-
1789
- @example
1790
- ```
1791
- import type {UnionToTuple} from 'type-fest';
1792
-
1793
- const pets = {
1794
- dog: '🐶',
1795
- cat: '🐱',
1796
- snake: '🐍',
1797
- };
1798
-
1799
- type Pet = keyof typeof pets;
1800
- //=> 'dog' | 'cat' | 'snake'
1801
-
1802
- const petList = Object.keys(pets) as UnionToTuple<Pet>;
1803
- //=> ['dog', 'cat', 'snake']
1804
- ```
1805
-
1806
- @category Array
1807
- */
1808
- type UnionToTuple<T, L$1 = LastOfUnion<T>> = IsNever<T> extends false ? [...UnionToTuple<Exclude<T, L$1>>, L$1] : [];
1809
- //#endregion
1810
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/set-optional.d.ts
1811
- /**
1812
- Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the `SetRequired` type.
1813
-
1814
- 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.
1815
-
1816
- @example
1817
- ```
1818
- import type {SetOptional} from 'type-fest';
1819
-
1820
- type Foo = {
1821
- a: number;
1822
- b?: string;
1823
- c: boolean;
1824
- };
1825
-
1826
- type SomeOptional = SetOptional<Foo, 'b' | 'c'>;
1827
- // type SomeOptional = {
1828
- // a: number;
1829
- // b?: string; // Was already optional and still is.
1830
- // c?: boolean; // Is now optional.
1831
- // }
1832
- ```
1833
-
1834
- @category Object
1835
- */
1836
- type SetOptional<BaseType, Keys extends keyof BaseType> = (BaseType extends ((...arguments_: never) => any) ? (...arguments_: Parameters<BaseType>) => ReturnType<BaseType> : unknown) & _SetOptional<BaseType, Keys>;
1837
- type _SetOptional<BaseType, Keys extends keyof BaseType> = BaseType extends unknown // To distribute `BaseType` when it's a union type.
1838
- ? Simplify<
1839
- // Pick just the keys that are readonly from the base type.
1840
- Except<BaseType, Keys> &
1841
- // Pick the keys that should be mutable from the base type and make them mutable.
1842
- Partial<HomomorphicPick<BaseType, Keys>>> : never;
1843
- //#endregion
1844
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/value-of.d.ts
1845
- /**
1846
- Create a union of the given object's values, and optionally specify which keys to get the values from.
1847
-
1848
- Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31438) if you want to have this type as a built-in in TypeScript.
1849
-
1850
- @example
1851
- ```
1852
- import type {ValueOf} from 'type-fest';
1853
-
1854
- type A = ValueOf<{id: number; name: string; active: boolean}>;
1855
- //=> number | string | boolean
1856
-
1857
- type B = ValueOf<{id: number; name: string; active: boolean}, 'name'>;
1858
- //=> string
1859
-
1860
- type C = ValueOf<{id: number; name: string; active: boolean}, 'id' | 'name'>;
1861
- //=> number | string
1862
- ```
1863
-
1864
- @category Object
1865
- */
1866
- type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
1867
- //#endregion
1868
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/split.d.ts
1869
- /**
1870
- Split options.
1871
-
1872
- @see {@link Split}
1873
- */
1874
- type SplitOptions = {
1875
- /**
1876
- When enabled, instantiations with non-literal string types (e.g., `string`, `Uppercase<string>`, `on${string}`) simply return back `string[]` without performing any splitting, as the exact structure cannot be statically determined.
1877
- @default true
1878
- @example
1879
- ```ts
1880
- import type {Split} from 'type-fest';
1881
- type Example1 = Split<`foo.${string}.bar`, '.', {strictLiteralChecks: false}>;
1882
- //=> ['foo', string, 'bar']
1883
- type Example2 = Split<`foo.${string}`, '.', {strictLiteralChecks: true}>;
1884
- //=> string[]
1885
- type Example3 = Split<'foobarbaz', `b${string}`, {strictLiteralChecks: false}>;
1886
- //=> ['foo', 'r', 'z']
1887
- type Example4 = Split<'foobarbaz', `b${string}`, {strictLiteralChecks: true}>;
1888
- //=> string[]
1889
- ```
1890
- */
1891
- strictLiteralChecks?: boolean;
1892
- };
1893
- type DefaultSplitOptions = {
1894
- strictLiteralChecks: true;
1895
- };
1896
-
1897
- /**
1898
- Represents an array of strings split using a given character or character set.
1899
-
1900
- Use-case: Defining the return type of a method like `String.prototype.split`.
1901
-
1902
- @example
1903
- ```
1904
- import type {Split} from 'type-fest';
1905
-
1906
- declare function split<S extends string, D extends string>(string: S, separator: D): Split<S, D>;
1907
-
1908
- type Item = 'foo' | 'bar' | 'baz' | 'waldo';
1909
- const items = 'foo,bar,baz,waldo';
1910
- const array: Item[] = split(items, ',');
1911
- ```
1912
-
1913
- @see {@link SplitOptions}
1914
-
1915
- @category String
1916
- @category Template literal
1917
- */
1918
- type Split<S extends string, Delimiter extends string, Options extends SplitOptions = {}> = SplitHelper<S, Delimiter, ApplyDefaultOptions<SplitOptions, DefaultSplitOptions, Options>>;
1919
- type SplitHelper<S extends string, Delimiter extends string, Options extends Required<SplitOptions>, Accumulator extends string[] = []> = S extends string // For distributing `S`
1920
- ? Delimiter extends string // For distributing `Delimiter`
1921
- // If `strictLiteralChecks` is `false` OR `S` and `Delimiter` both are string literals, then perform the split
1922
- ? Or<Not<Options['strictLiteralChecks']>, And<IsStringLiteral<S>, IsStringLiteral<Delimiter>>> extends true ? S extends `${infer Head}${Delimiter}${infer Tail}` ? SplitHelper<Tail, Delimiter, Options, [...Accumulator, Head]> : Delimiter extends '' ? S extends '' ? Accumulator : [...Accumulator, S] : [...Accumulator, S]
1923
- // Otherwise, return `string[]`
1924
- : string[] : never // Should never happen
1925
- : never; // Should never happen
1926
- //#endregion
1927
- //#region node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/replace.d.ts
1928
- type ReplaceOptions = {
1929
- all?: boolean;
1930
- };
1931
- type DefaultReplaceOptions = {
1932
- all: false;
1933
- };
1934
-
1935
- /**
1936
- Represents a string with some or all matches replaced by a replacement.
1937
-
1938
- Use-case:
1939
- - `kebab-case-path` to `dotted.path.notation`
1940
- - Changing date/time format: `01-08-2042` → `01/08/2042`
1941
- - Manipulation of type properties, for example, removal of prefixes
1942
-
1943
- @example
1944
- ```
1945
- import type {Replace} from 'type-fest';
1946
-
1947
- declare function replace<
1948
- Input extends string,
1949
- Search extends string,
1950
- Replacement extends string,
1951
- >(
1952
- input: Input,
1953
- search: Search,
1954
- replacement: Replacement
1955
- ): Replace<Input, Search, Replacement>;
1956
-
1957
- declare function replaceAll<
1958
- Input extends string,
1959
- Search extends string,
1960
- Replacement extends string,
1961
- >(
1962
- input: Input,
1963
- search: Search,
1964
- replacement: Replacement
1965
- ): Replace<Input, Search, Replacement, {all: true}>;
1966
-
1967
- // The return type is the exact string literal, not just `string`.
1968
-
1969
- replace('hello ?', '?', '🦄');
1970
- //=> 'hello 🦄'
1971
-
1972
- replace('hello ??', '?', '❓');
1973
- //=> 'hello ❓?'
1974
-
1975
- replaceAll('10:42:00', ':', '-');
1976
- //=> '10-42-00'
1977
-
1978
- replaceAll('__userName__', '__', '');
1979
- //=> 'userName'
1980
-
1981
- replaceAll('My Cool Title', ' ', '');
1982
- //=> 'MyCoolTitle'
1983
- ```
1984
-
1985
- @category String
1986
- @category Template literal
1987
- */
1988
- type Replace<Input extends string, Search extends string, Replacement extends string, Options extends ReplaceOptions = {}> = _Replace<Input, Search, Replacement, ApplyDefaultOptions<ReplaceOptions, DefaultReplaceOptions, Options>>;
1989
- type _Replace<Input extends string, Search extends string, Replacement extends string, Options extends Required<ReplaceOptions>, Accumulator extends string = ''> = Search extends string // For distributing `Search`
1990
- ? Replacement extends string // For distributing `Replacement`
1991
- ? 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;
1992
- //#endregion
1993
- //#region node_modules/.pnpm/@pawover+types@0.0.0-alpha._110402f22903360a3e22e90ae898db58/node_modules/@pawover/types/dist/index.d.ts
1994
- //#endregion
1995
- //#region src/index.d.ts
1996
- /** 任意对象类型 */
1997
- type AnyObject<K$1 extends PropertyKey = PropertyKey, T = any> = Record<K$1, T>;
1998
- /** 普通对象类型 */
1999
- type PlainObject<K$1 extends PropertyKey = PropertyKey, T = unknown> = Record<K$1, T>;
2000
- /** 描述树类型 */
2001
- type TreeLike<T extends AnyObject, CK extends string = "children"> = T & Record<CK, TreeLike<T, CK>[]>;
2002
- /** 描述函数类型 */
2003
- type AnyFunction<P$1 extends any[] = any[], R$1 = any> = (...arg: P$1) => R$1;
2004
- /** 描述异步函数类型 */
2005
- type AnyAsyncFunction<P$1 extends any[] = any[], R$1 = any> = (...args: P$1) => Promise<R$1>;
2006
- type AnyGeneratorFunction<P$1 extends any[] = any[], T = any, R$1 = any, N = any> = (...args: P$1) => Generator<T, R$1, N>;
2007
- type AnyAsyncGeneratorFunction<P$1 extends any[] = any[], T = any, R$1 = any, N = any> = (...args: P$1) => AsyncGenerator<T, R$1, N>;
2008
- //#endregion
2009
- //#endregion
2010
- //#region src/utils/function/to.d.ts
2011
- /**
2012
- * @param promise
2013
- * @param errorExt 可以传递给err对象的其他信息
2014
- */
2015
- declare function to<T, U$1 = Error>(promise: Readonly<Promise<T>>, errorExt?: PlainObject): Promise<[U$1, undefined] | [null, T]>;
2016
- //#endregion
2017
- //#region src/utils/math/toMathBignumber.d.ts
2018
- /**
2019
- * 将任意类型的值转换为 `math.bignumber`
2020
- *
2021
- * @param mathJsInstance mathJs 实例
2022
- * @param value 任意类型的值
2023
- * @param saveValue 安全值
2024
- */
2025
- declare function toMathBignumber(mathJsInstance: MathJsInstance, value: unknown, saveValue?: BigNumber | undefined): BigNumber;
2026
- //#endregion
2027
- //#region src/utils/math/toMathDecimal.d.ts
2028
- /**
2029
- * 将任意类型的值转换为十进制数字字符串
2030
- *
2031
- * @param mathJsInstance mathJs 实例
2032
- * @param value 任意类型的值
2033
- * @param precision 精度
2034
- * @param isFormat 是否格式化为字符串
2035
- */
2036
- declare function toMathDecimal(mathJsInstance: MathJsInstance, value: unknown, precision?: number | undefined, isFormat?: true): string;
2037
- declare function toMathDecimal(mathJsInstance: MathJsInstance, value: unknown, precision?: number | undefined, isFormat?: false): BigNumber;
2038
- //#endregion
2039
- //#region src/utils/math/toMathEvaluate.d.ts
2040
- /**
2041
- * 数学表达式求值
2042
- *
2043
- * @param mathJsInstance mathJs 实例
2044
- * @param expr 表达式
2045
- * @param scope 键值映射
2046
- */
2047
- declare function toMathEvaluate(mathJsInstance: MathJsInstance, expr: MathExpression | Matrix, scope?: Record<string, BigNumber>): string;
2048
- //#endregion
2049
- //#region src/utils/object/cloneDeep.d.ts
2050
- interface CloningStrategy {
2051
- cloneMap: <K$1, V$1>(parent: Map<K$1, V$1>, track: (newParent: Map<K$1, V$1>) => Map<K$1, V$1>, clone: <T>(value: T) => T) => Map<K$1, V$1> | null;
2052
- cloneSet: <T>(parent: Set<T>, track: (newParent: Set<T>) => Set<T>, clone: <T>(value: T) => T) => Set<T> | null;
2053
- cloneArray: <T>(parent: readonly T[], track: (newParent: T[]) => T[], clone: <T>(value: T) => T) => T[] | null;
2054
- cloneObject: <T extends AnyObject>(parent: T, track: (newParent: T) => T, clone: <T>(value: T) => T) => T | null;
2055
- cloneOther: <T>(parent: T, track: (newParent: T) => T, clone: <T>(value: T) => T) => T | null;
2056
- }
2057
- /**
2058
- * cloneDeep
2059
- * @reference https://github.com/radashi-org/radashi/blob/main/src/object/cloneDeep.ts
2060
- */
2061
- declare function cloneDeep<T extends AnyObject>(root: T, customStrategy?: Partial<CloningStrategy>): T;
2062
- //#endregion
2063
- //#region src/utils/object/enumEntries.d.ts
2064
- /**
2065
- * 返回枚举的属性的键/值数组
2066
- *
2067
- * @param enumeration 枚举
2068
- */
2069
- declare function enumEntries<E extends PlainObject>(enumeration: E): [keyof E, E[keyof E]][];
2070
- declare function enumEntries<E extends AnyObject>(enumeration: E): [keyof E, E[keyof E]][];
2071
- //#endregion
2072
- //#region src/utils/object/enumKeys.d.ts
2073
- /**
2074
- * 获取枚举所有属性的键
2075
- *
2076
- * @param enumeration 枚举
2077
- */
2078
- declare function enumKeys<E extends PlainObject>(enumeration: E): (keyof E)[];
2079
- declare function enumKeys<E extends AnyObject>(enumeration: E): (keyof E)[];
2080
- //#endregion
2081
- //#region src/utils/object/enumValues.d.ts
2082
- /**
2083
- * 获取枚举所有属性的值
2084
- *
2085
- * @param enumeration 枚举
2086
- */
2087
- declare function enumValues<E extends PlainObject>(enumeration: E): UnionToTuple<ValueOf<E>>;
2088
- declare function enumValues<E extends AnyObject>(enumeration: E): UnionToTuple<ValueOf<E>>;
2089
- //#endregion
2090
- //#region src/utils/object/mapEntries.d.ts
2091
- declare function mapEntries<K$1 extends PropertyKey, V$1, NK extends PropertyKey, NV>(obj: PlainObject<K$1, V$1>, toEntry: (key: K$1, value: V$1) => [NK, NV]): PlainObject<NK, NV>;
2092
- //#endregion
2093
- //#region node_modules/.pnpm/radashi@12.7.1/node_modules/radashi/dist/radashi.d.cts
2094
- interface BigInt {
2095
- /**
2096
- * Returns a string representation of an object.
2097
- * @param radix Specifies a radix for converting numeric values to strings.
2098
- */
2099
- toString(radix?: number): string;
2100
- /** Returns a string representation appropriate to the host environment's current locale. */
2101
- toLocaleString(locales?: any, options?: BigIntToLocaleStringOptions): string;
2102
- /** Returns the primitive value of the specified object. */
2103
- valueOf(): bigint;
2104
- readonly [Symbol.toStringTag]: "BigInt";
2105
- }
2106
- /**
2107
- * A typed array of 64-bit signed integer values. The contents are initialized to 0. If the
2108
- * requested number of bytes could not be allocated, an exception is raised.
2109
- */
2110
- interface BigInt64Array$1 {
2111
- /** The size in bytes of each element in the array. */
2112
- readonly BYTES_PER_ELEMENT: number;
2113
- /** The ArrayBuffer instance referenced by the array. */
2114
- readonly buffer: ArrayBufferLike;
2115
- /** The length in bytes of the array. */
2116
- readonly byteLength: number;
2117
- /** The offset in bytes of the array. */
2118
- readonly byteOffset: number;
2119
- /**
2120
- * Returns the this object after copying a section of the array identified by start and end
2121
- * to the same array starting at position target
2122
- * @param target If target is negative, it is treated as length+target where length is the
2123
- * length of the array.
2124
- * @param start If start is negative, it is treated as length+start. If end is negative, it
2125
- * is treated as length+end.
2126
- * @param end If not specified, length of the this object is used as its default value.
2127
- */
2128
- copyWithin(target: number, start: number, end?: number): this;
2129
- /** Yields index, value pairs for every entry in the array. */
2130
- entries(): IterableIterator<[number, bigint]>;
2131
- /**
2132
- * Determines whether all the members of an array satisfy the specified test.
2133
- * @param predicate A function that accepts up to three arguments. The every method calls
2134
- * the predicate function for each element in the array until the predicate returns false,
2135
- * or until the end of the array.
2136
- * @param thisArg An object to which the this keyword can refer in the predicate function.
2137
- * If thisArg is omitted, undefined is used as the this value.
2138
- */
2139
- every(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): boolean;
2140
- /**
2141
- * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
2142
- * @param value value to fill array section with
2143
- * @param start index to start filling the array at. If start is negative, it is treated as
2144
- * length+start where length is the length of the array.
2145
- * @param end index to stop filling the array at. If end is negative, it is treated as
2146
- * length+end.
2147
- */
2148
- fill(value: bigint, start?: number, end?: number): this;
2149
- /**
2150
- * Returns the elements of an array that meet the condition specified in a callback function.
2151
- * @param predicate A function that accepts up to three arguments. The filter method calls
2152
- * the predicate function one time for each element in the array.
2153
- * @param thisArg An object to which the this keyword can refer in the predicate function.
2154
- * If thisArg is omitted, undefined is used as the this value.
2155
- */
2156
- filter(predicate: (value: bigint, index: number, array: BigInt64Array$1) => any, thisArg?: any): BigInt64Array$1;
2157
- /**
2158
- * Returns the value of the first element in the array where predicate is true, and undefined
2159
- * otherwise.
2160
- * @param predicate find calls predicate once for each element of the array, in ascending
2161
- * order, until it finds one where predicate returns true. If such an element is found, find
2162
- * immediately returns that element value. Otherwise, find returns undefined.
2163
- * @param thisArg If provided, it will be used as the this value for each invocation of
2164
- * predicate. If it is not provided, undefined is used instead.
2165
- */
2166
- find(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): bigint | undefined;
2167
- /**
2168
- * Returns the index of the first element in the array where predicate is true, and -1
2169
- * otherwise.
2170
- * @param predicate find calls predicate once for each element of the array, in ascending
2171
- * order, until it finds one where predicate returns true. If such an element is found,
2172
- * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
2173
- * @param thisArg If provided, it will be used as the this value for each invocation of
2174
- * predicate. If it is not provided, undefined is used instead.
2175
- */
2176
- findIndex(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): number;
2177
- /**
2178
- * Performs the specified action for each element in an array.
2179
- * @param callbackfn A function that accepts up to three arguments. forEach calls the
2180
- * callbackfn function one time for each element in the array.
2181
- * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2182
- * If thisArg is omitted, undefined is used as the this value.
2183
- */
2184
- forEach(callbackfn: (value: bigint, index: number, array: BigInt64Array$1) => void, thisArg?: any): void;
2185
- /**
2186
- * Determines whether an array includes a certain element, returning true or false as appropriate.
2187
- * @param searchElement The element to search for.
2188
- * @param fromIndex The position in this array at which to begin searching for searchElement.
2189
- */
2190
- includes(searchElement: bigint, fromIndex?: number): boolean;
2191
- /**
2192
- * Returns the index of the first occurrence of a value in an array.
2193
- * @param searchElement The value to locate in the array.
2194
- * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2195
- * search starts at index 0.
2196
- */
2197
- indexOf(searchElement: bigint, fromIndex?: number): number;
2198
- /**
2199
- * Adds all the elements of an array separated by the specified separator string.
2200
- * @param separator A string used to separate one element of an array from the next in the
2201
- * resulting String. If omitted, the array elements are separated with a comma.
2202
- */
2203
- join(separator?: string): string;
2204
- /** Yields each index in the array. */
2205
- keys(): IterableIterator<number>;
2206
- /**
2207
- * Returns the index of the last occurrence of a value in an array.
2208
- * @param searchElement The value to locate in the array.
2209
- * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2210
- * search starts at index 0.
2211
- */
2212
- lastIndexOf(searchElement: bigint, fromIndex?: number): number;
2213
- /** The length of the array. */
2214
- readonly length: number;
2215
- /**
2216
- * Calls a defined callback function on each element of an array, and returns an array that
2217
- * contains the results.
2218
- * @param callbackfn A function that accepts up to three arguments. The map method calls the
2219
- * callbackfn function one time for each element in the array.
2220
- * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2221
- * If thisArg is omitted, undefined is used as the this value.
2222
- */
2223
- map(callbackfn: (value: bigint, index: number, array: BigInt64Array$1) => bigint, thisArg?: any): BigInt64Array$1;
2224
- /**
2225
- * Calls the specified callback function for all the elements in an array. The return value of
2226
- * the callback function is the accumulated result, and is provided as an argument in the next
2227
- * call to the callback function.
2228
- * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
2229
- * callbackfn function one time for each element in the array.
2230
- * @param initialValue If initialValue is specified, it is used as the initial value to start
2231
- * the accumulation. The first call to the callbackfn function provides this value as an argument
2232
- * instead of an array value.
2233
- */
2234
- reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => bigint): bigint;
2235
- /**
2236
- * Calls the specified callback function for all the elements in an array. The return value of
2237
- * the callback function is the accumulated result, and is provided as an argument in the next
2238
- * call to the callback function.
2239
- * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
2240
- * callbackfn function one time for each element in the array.
2241
- * @param initialValue If initialValue is specified, it is used as the initial value to start
2242
- * the accumulation. The first call to the callbackfn function provides this value as an argument
2243
- * instead of an array value.
2244
- */
2245
- reduce<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => U$1, initialValue: U$1): U$1;
2246
- /**
2247
- * Calls the specified callback function for all the elements in an array, in descending order.
2248
- * The return value of the callback function is the accumulated result, and is provided as an
2249
- * argument in the next call to the callback function.
2250
- * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
2251
- * the callbackfn function one time for each element in the array.
2252
- * @param initialValue If initialValue is specified, it is used as the initial value to start
2253
- * the accumulation. The first call to the callbackfn function provides this value as an
2254
- * argument instead of an array value.
2255
- */
2256
- reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => bigint): bigint;
2257
- /**
2258
- * Calls the specified callback function for all the elements in an array, in descending order.
2259
- * The return value of the callback function is the accumulated result, and is provided as an
2260
- * argument in the next call to the callback function.
2261
- * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
2262
- * the callbackfn function one time for each element in the array.
2263
- * @param initialValue If initialValue is specified, it is used as the initial value to start
2264
- * the accumulation. The first call to the callbackfn function provides this value as an argument
2265
- * instead of an array value.
2266
- */
2267
- reduceRight<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => U$1, initialValue: U$1): U$1;
2268
- /** Reverses the elements in the array. */
2269
- reverse(): this;
2270
- /**
2271
- * Sets a value or an array of values.
2272
- * @param array A typed or untyped array of values to set.
2273
- * @param offset The index in the current array at which the values are to be written.
2274
- */
2275
- set(array: ArrayLike<bigint>, offset?: number): void;
2276
- /**
2277
- * Returns a section of an array.
2278
- * @param start The beginning of the specified portion of the array.
2279
- * @param end The end of the specified portion of the array.
2280
- */
2281
- slice(start?: number, end?: number): BigInt64Array$1;
2282
- /**
2283
- * Determines whether the specified callback function returns true for any element of an array.
2284
- * @param predicate A function that accepts up to three arguments. The some method calls the
2285
- * predicate function for each element in the array until the predicate returns true, or until
2286
- * the end of the array.
2287
- * @param thisArg An object to which the this keyword can refer in the predicate function.
2288
- * If thisArg is omitted, undefined is used as the this value.
2289
- */
2290
- some(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): boolean;
2291
- /**
2292
- * Sorts the array.
2293
- * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.
2294
- */
2295
- sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;
2296
- /**
2297
- * Gets a new BigInt64Array view of the ArrayBuffer store for this array, referencing the elements
2298
- * at begin, inclusive, up to end, exclusive.
2299
- * @param begin The index of the beginning of the array.
2300
- * @param end The index of the end of the array.
2301
- */
2302
- subarray(begin?: number, end?: number): BigInt64Array$1;
2303
- /** Converts the array to a string by using the current locale. */
2304
- toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;
2305
- /** Returns a string representation of the array. */
2306
- toString(): string;
2307
- /** Returns the primitive value of the specified object. */
2308
- valueOf(): BigInt64Array$1;
2309
- /** Yields each value in the array. */
2310
- values(): IterableIterator<bigint>;
2311
- [Symbol.iterator](): IterableIterator<bigint>;
2312
- readonly [Symbol.toStringTag]: "BigInt64Array";
2313
- [index: number]: bigint;
2314
- }
2315
- /**
2316
- * A typed array of 64-bit unsigned integer values. The contents are initialized to 0. If the
2317
- * requested number of bytes could not be allocated, an exception is raised.
2318
- */
2319
- interface BigUint64Array$1 {
2320
- /** The size in bytes of each element in the array. */
2321
- readonly BYTES_PER_ELEMENT: number;
2322
- /** The ArrayBuffer instance referenced by the array. */
2323
- readonly buffer: ArrayBufferLike;
2324
- /** The length in bytes of the array. */
2325
- readonly byteLength: number;
2326
- /** The offset in bytes of the array. */
2327
- readonly byteOffset: number;
2328
- /**
2329
- * Returns the this object after copying a section of the array identified by start and end
2330
- * to the same array starting at position target
2331
- * @param target If target is negative, it is treated as length+target where length is the
2332
- * length of the array.
2333
- * @param start If start is negative, it is treated as length+start. If end is negative, it
2334
- * is treated as length+end.
2335
- * @param end If not specified, length of the this object is used as its default value.
2336
- */
2337
- copyWithin(target: number, start: number, end?: number): this;
2338
- /** Yields index, value pairs for every entry in the array. */
2339
- entries(): IterableIterator<[number, bigint]>;
2340
- /**
2341
- * Determines whether all the members of an array satisfy the specified test.
2342
- * @param predicate A function that accepts up to three arguments. The every method calls
2343
- * the predicate function for each element in the array until the predicate returns false,
2344
- * or until the end of the array.
2345
- * @param thisArg An object to which the this keyword can refer in the predicate function.
2346
- * If thisArg is omitted, undefined is used as the this value.
2347
- */
2348
- every(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): boolean;
2349
- /**
2350
- * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
2351
- * @param value value to fill array section with
2352
- * @param start index to start filling the array at. If start is negative, it is treated as
2353
- * length+start where length is the length of the array.
2354
- * @param end index to stop filling the array at. If end is negative, it is treated as
2355
- * length+end.
2356
- */
2357
- fill(value: bigint, start?: number, end?: number): this;
2358
- /**
2359
- * Returns the elements of an array that meet the condition specified in a callback function.
2360
- * @param predicate A function that accepts up to three arguments. The filter method calls
2361
- * the predicate function one time for each element in the array.
2362
- * @param thisArg An object to which the this keyword can refer in the predicate function.
2363
- * If thisArg is omitted, undefined is used as the this value.
2364
- */
2365
- filter(predicate: (value: bigint, index: number, array: BigUint64Array$1) => any, thisArg?: any): BigUint64Array$1;
2366
- /**
2367
- * Returns the value of the first element in the array where predicate is true, and undefined
2368
- * otherwise.
2369
- * @param predicate find calls predicate once for each element of the array, in ascending
2370
- * order, until it finds one where predicate returns true. If such an element is found, find
2371
- * immediately returns that element value. Otherwise, find returns undefined.
2372
- * @param thisArg If provided, it will be used as the this value for each invocation of
2373
- * predicate. If it is not provided, undefined is used instead.
2374
- */
2375
- find(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): bigint | undefined;
2376
- /**
2377
- * Returns the index of the first element in the array where predicate is true, and -1
2378
- * otherwise.
2379
- * @param predicate find calls predicate once for each element of the array, in ascending
2380
- * order, until it finds one where predicate returns true. If such an element is found,
2381
- * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
2382
- * @param thisArg If provided, it will be used as the this value for each invocation of
2383
- * predicate. If it is not provided, undefined is used instead.
2384
- */
2385
- findIndex(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): number;
2386
- /**
2387
- * Performs the specified action for each element in an array.
2388
- * @param callbackfn A function that accepts up to three arguments. forEach calls the
2389
- * callbackfn function one time for each element in the array.
2390
- * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2391
- * If thisArg is omitted, undefined is used as the this value.
2392
- */
2393
- forEach(callbackfn: (value: bigint, index: number, array: BigUint64Array$1) => void, thisArg?: any): void;
2394
- /**
2395
- * Determines whether an array includes a certain element, returning true or false as appropriate.
2396
- * @param searchElement The element to search for.
2397
- * @param fromIndex The position in this array at which to begin searching for searchElement.
2398
- */
2399
- includes(searchElement: bigint, fromIndex?: number): boolean;
2400
- /**
2401
- * Returns the index of the first occurrence of a value in an array.
2402
- * @param searchElement The value to locate in the array.
2403
- * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2404
- * search starts at index 0.
2405
- */
2406
- indexOf(searchElement: bigint, fromIndex?: number): number;
2407
- /**
2408
- * Adds all the elements of an array separated by the specified separator string.
2409
- * @param separator A string used to separate one element of an array from the next in the
2410
- * resulting String. If omitted, the array elements are separated with a comma.
2411
- */
2412
- join(separator?: string): string;
2413
- /** Yields each index in the array. */
2414
- keys(): IterableIterator<number>;
2415
- /**
2416
- * Returns the index of the last occurrence of a value in an array.
2417
- * @param searchElement The value to locate in the array.
2418
- * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
2419
- * search starts at index 0.
2420
- */
2421
- lastIndexOf(searchElement: bigint, fromIndex?: number): number;
2422
- /** The length of the array. */
2423
- readonly length: number;
2424
- /**
2425
- * Calls a defined callback function on each element of an array, and returns an array that
2426
- * contains the results.
2427
- * @param callbackfn A function that accepts up to three arguments. The map method calls the
2428
- * callbackfn function one time for each element in the array.
2429
- * @param thisArg An object to which the this keyword can refer in the callbackfn function.
2430
- * If thisArg is omitted, undefined is used as the this value.
2431
- */
2432
- map(callbackfn: (value: bigint, index: number, array: BigUint64Array$1) => bigint, thisArg?: any): BigUint64Array$1;
2433
- /**
2434
- * Calls the specified callback function for all the elements in an array. The return value of
2435
- * the callback function is the accumulated result, and is provided as an argument in the next
2436
- * call to the callback function.
2437
- * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
2438
- * callbackfn function one time for each element in the array.
2439
- * @param initialValue If initialValue is specified, it is used as the initial value to start
2440
- * the accumulation. The first call to the callbackfn function provides this value as an argument
2441
- * instead of an array value.
2442
- */
2443
- reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => bigint): bigint;
2444
- /**
2445
- * Calls the specified callback function for all the elements in an array. The return value of
2446
- * the callback function is the accumulated result, and is provided as an argument in the next
2447
- * call to the callback function.
2448
- * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
2449
- * callbackfn function one time for each element in the array.
2450
- * @param initialValue If initialValue is specified, it is used as the initial value to start
2451
- * the accumulation. The first call to the callbackfn function provides this value as an argument
2452
- * instead of an array value.
2453
- */
2454
- reduce<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => U$1, initialValue: U$1): U$1;
2455
- /**
2456
- * Calls the specified callback function for all the elements in an array, in descending order.
2457
- * The return value of the callback function is the accumulated result, and is provided as an
2458
- * argument in the next call to the callback function.
2459
- * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
2460
- * the callbackfn function one time for each element in the array.
2461
- * @param initialValue If initialValue is specified, it is used as the initial value to start
2462
- * the accumulation. The first call to the callbackfn function provides this value as an
2463
- * argument instead of an array value.
2464
- */
2465
- reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => bigint): bigint;
2466
- /**
2467
- * Calls the specified callback function for all the elements in an array, in descending order.
2468
- * The return value of the callback function is the accumulated result, and is provided as an
2469
- * argument in the next call to the callback function.
2470
- * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
2471
- * the callbackfn function one time for each element in the array.
2472
- * @param initialValue If initialValue is specified, it is used as the initial value to start
2473
- * the accumulation. The first call to the callbackfn function provides this value as an argument
2474
- * instead of an array value.
2475
- */
2476
- reduceRight<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => U$1, initialValue: U$1): U$1;
2477
- /** Reverses the elements in the array. */
2478
- reverse(): this;
2479
- /**
2480
- * Sets a value or an array of values.
2481
- * @param array A typed or untyped array of values to set.
2482
- * @param offset The index in the current array at which the values are to be written.
2483
- */
2484
- set(array: ArrayLike<bigint>, offset?: number): void;
2485
- /**
2486
- * Returns a section of an array.
2487
- * @param start The beginning of the specified portion of the array.
2488
- * @param end The end of the specified portion of the array.
2489
- */
2490
- slice(start?: number, end?: number): BigUint64Array$1;
2491
- /**
2492
- * Determines whether the specified callback function returns true for any element of an array.
2493
- * @param predicate A function that accepts up to three arguments. The some method calls the
2494
- * predicate function for each element in the array until the predicate returns true, or until
2495
- * the end of the array.
2496
- * @param thisArg An object to which the this keyword can refer in the predicate function.
2497
- * If thisArg is omitted, undefined is used as the this value.
2498
- */
2499
- some(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): boolean;
2500
- /**
2501
- * Sorts the array.
2502
- * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.
2503
- */
2504
- sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;
2505
- /**
2506
- * Gets a new BigUint64Array view of the ArrayBuffer store for this array, referencing the elements
2507
- * at begin, inclusive, up to end, exclusive.
2508
- * @param begin The index of the beginning of the array.
2509
- * @param end The index of the end of the array.
2510
- */
2511
- subarray(begin?: number, end?: number): BigUint64Array$1;
2512
- /** Converts the array to a string by using the current locale. */
2513
- toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;
2514
- /** Returns a string representation of the array. */
2515
- toString(): string;
2516
- /** Returns the primitive value of the specified object. */
2517
- valueOf(): BigUint64Array$1;
2518
- /** Yields each value in the array. */
2519
- values(): IterableIterator<bigint>;
2520
- [Symbol.iterator](): IterableIterator<bigint>;
2521
- readonly [Symbol.toStringTag]: "BigUint64Array";
2522
- [index: number]: bigint;
2523
- }
2524
- interface BigIntToLocaleStringOptions {
2525
- /**
2526
- * 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}.
2527
- */
2528
- localeMatcher?: string;
2529
- /**
2530
- * The formatting style to use , the default is "decimal".
2531
- */
2532
- style?: string;
2533
- numberingSystem?: string;
2534
- /**
2535
- * 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.
2536
- */
2537
- unit?: string;
2538
- /**
2539
- * The unit formatting style to use in unit formatting, the defaults is "short".
2540
- */
2541
- unitDisplay?: string;
2542
- /**
2543
- * 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".
2544
- */
2545
- currency?: string;
2546
- /**
2547
- * How to display the currency in currency formatting. It is only used when [[Style]] has the value "currency". The default is "symbol".
2548
- *
2549
- * "symbol" to use a localized currency symbol such as €,
2550
- *
2551
- * "code" to use the ISO currency code,
2552
- *
2553
- * "name" to use a localized currency name such as "dollar"
2554
- */
2555
- currencyDisplay?: string;
2556
- /**
2557
- * Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. The default is true.
2558
- */
2559
- useGrouping?: boolean;
2560
- /**
2561
- * The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1.
2562
- */
2563
- minimumIntegerDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
2564
- /**
2565
- * 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).
2566
- */
2567
- minimumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
2568
- /**
2569
- * 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.
2570
- */
2571
- maximumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
2572
- /**
2573
- * The minimum number of significant digits to use. Possible values are from 1 to 21; the default is 1.
2574
- */
2575
- minimumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
2576
- /**
2577
- * The maximum number of significant digits to use. Possible values are from 1 to 21; the default is 21.
2578
- */
2579
- maximumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
2580
- /**
2581
- * The formatting that should be displayed for the number, the defaults is "standard"
2582
- *
2583
- * "standard" plain number formatting
2584
- *
2585
- * "scientific" return the order-of-magnitude for formatted number.
2586
- *
2587
- * "engineering" return the exponent of ten when divisible by three
2588
- *
2589
- * "compact" string representing exponent, defaults is using the "short" form
2590
- */
2591
- notation?: string;
2592
- /**
2593
- * used only when notation is "compact"
2594
- */
2595
- compactDisplay?: string;
2596
- }
2597
- /**
2598
- * The `Any` class does not exist at runtime. It's used in type
2599
- * definitions to detect an `any` type.
2600
- *
2601
- * ```ts
2602
- * type IsAny<T> = [T] extends [Any] ? 'is any' : 'is not any'
2603
- * ```
2604
- */
2605
- declare class Any {
2606
- private any;
2607
- }
2608
- /**
2609
- * Represents a class constructor.
2610
- */
2611
-
2612
- /**
2613
- * Get all properties **not using** the `?:` type operator.
2614
- */
2615
- 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;
2616
- /**
2617
- * Get all properties using the `?:` type operator.
2618
- */
2619
- 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;
2620
- /**
2621
- * Resolves to `true` if `Left` and `Right` are exactly the same type.
2622
- *
2623
- * Otherwise false.
2624
- */
2625
- 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;
2626
- type Primitive = number | string | boolean | symbol | bigint | null | undefined | void;
2627
- /**
2628
- * Coerce a primitive type to its boxed equivalent.
2629
- *
2630
- * @example
2631
- * ```ts
2632
- * type A = BoxedPrimitive<string>
2633
- * // ^? String
2634
- * type B = BoxedPrimitive<number>
2635
- * // ^? Number
2636
- * ```
2637
- */
2638
- 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;
2639
- type TypedArray$1 = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array$1 | BigUint64Array$1 | DataView | ArrayBuffer | SharedArrayBuffer;
2640
- /**
2641
- * Add your own classes to this registry by extending its interface
2642
- * with what's called “declaration merging” in TypeScript.
2643
- *
2644
- * All property types in this registry type may be treated specially
2645
- * by any of Radashi's complex types. For example, `assign` will avoid
2646
- * merging with types in this registry.
2647
- */
2648
- interface CustomClassRegistry {}
2649
- /**
2650
- * This type represents any custom class that was "registered" through
2651
- * the `CustomClassRegistry` type.
2652
- */
2653
- type CustomClass = CustomClassRegistry[keyof CustomClassRegistry];
2654
- /**
2655
- * These types are implemented natively.
2656
- *
2657
- * Note that boxed primitives like `Boolean` (different from
2658
- * `boolean`) are not included, because `boolean extends Boolean ? 1 :
2659
- * 0` resolves to 1.
2660
- */
2661
- type BuiltInType = ES2021.BuiltInType | WebAPI.BuiltInType | NodeJS.BuiltInType;
2662
- declare namespace ES2020 {
2663
- type BuiltInType = Primitive | Promise<any> | Date | RegExp | Error | readonly any[] | ReadonlyMap<any, any> | ReadonlySet<any> | WeakMap<WeakKey, any> | WeakSet<WeakKey> | TypedArray$1 | Function;
2664
- }
2665
- declare namespace ES2021 {
2666
- type BuiltInType = ES2020.BuiltInType | GlobalObjectType<'FinalizationRegistry'> | GlobalObjectType<'WeakRef'>;
2667
- }
2668
- declare namespace NodeJS {
2669
- type BuiltInType = GlobalObjectType<'Buffer'>;
2670
- }
2671
- declare namespace WebAPI {
2672
- 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;
2673
- }
2674
- declare namespace WebDocumentAPI {
2675
- type BuiltInType = GlobalObjectType<'Node'> | GlobalObjectType<'NodeList'> | GlobalObjectType<'NodeIterator'> | GlobalObjectType<'HTMLCollection'> | GlobalObjectType<'CSSStyleDeclaration'> | GlobalObjectType<'DOMStringList'> | GlobalObjectType<'DOMTokenList'>;
2676
- }
2677
- 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;
2678
-
2679
- /**
2680
- * Converts a `PromiseLike` to a `Promise<Result>`.
2681
- *
2682
- * Note: If the given promise throws a non-Error value, it will be
2683
- * rethrown.
2684
- *
2685
- * @see https://radashi.js.org/reference/async/toResult
2686
- * @example
2687
- * ```ts
2688
- * import { toResult, Result } from 'radashi'
2689
- *
2690
- * const good = async (): Promise<number> => 1
2691
- * const bad = async (): Promise<number> => { throw new Error('bad') }
2692
- *
2693
- * const goodResult = await toResult(good())
2694
- * // => [undefined, 1]
2695
- *
2696
- * const badResult = await toResult(bad())
2697
- * // => [Error('bad'), undefined]
2698
- * ```
2699
- * @version 12.4.0
2700
- */
2701
-
2702
- /**
2703
- * The return type for `assign`.
2704
- *
2705
- * It recursively merges object types that are not native objects. The
2706
- * root objects are always merged.
2707
- *
2708
- * @see https://radashi.js.org/reference/object/assign
2709
- */
2710
- 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;
2711
- /**
2712
- * Mimic the `Simplify` type and also remove `readonly` modifiers.
2713
- */
2714
- type SimplifyMutable<T> = {} & { -readonly [P in keyof T]: T[P] };
2715
- /**
2716
- * This represents a value that should only be replaced if it exists
2717
- * as an initial value; never deeply assigned into.
2718
- */
2719
- type AtomicValue = BuiltInType | CustomClass | BoxedPrimitive;
2720
- /**
2721
- * Handle mixed types when merging nested plain objects.
2722
- *
2723
- * For example, if the type `TOverride` includes both `string` and `{ n:
2724
- * number }` in a union, `AssignDeep` will treat `string` as
2725
- * unmergeable and `{ n: number }` as mergeable.
2726
- */
2727
- type AssignDeep<TInitial, TOverride, IsOptional = false> = never
2728
- /**
2729
- * When a native type is found in TInitial, it will only exist in
2730
- * the result type if the override is optional.
2731
- */ | (TInitial extends AtomicValue ? IsOptional extends true ? TInitial : never : never)
2732
- /**
2733
- * When a native type is found in TOverride, it will always exists
2734
- * in the result type.
2735
- */ | (TOverride extends AtomicValue ? TOverride : never)
2736
- /**
2737
- * Deep assignment is handled in this branch.
2738
- *
2739
- * 1. Exclude any native types from TInitial and TOverride
2740
- * 2. If a non-native object type is not found in TInitial, simply
2741
- * replace TInitial (or use "A | B" if the override is optional)
2742
- * 3. For each non-native object type in TOverride, deep assign to
2743
- * every non-native object in TInitial
2744
- * 4. For each non-object type in TOverride, simply replace TInitial
2745
- * (or use "A | B" if the override is optional)
2746
- */ | (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> :
2747
- // 4.
2748
- TOverride | (IsOptional extends true ? TInitial : never) : Extract<TOverride, object> | (IsOptional extends true ? TInitial : never) : never : never);
2749
-
2750
- /**
2751
- * Creates a shallow copy of the given object/value.
2752
- *
2753
- * @see https://radashi.js.org/reference/object/clone
2754
- * @example
2755
- * ```ts
2756
- * const original = { a: 1, b: { c: 3 } }
2757
- * const cloned = clone(original)
2758
- * // => { a: 1, b: { c: 3 } }
2759
- * original !== cloned
2760
- * // => true
2761
- * original.b === cloned.b
2762
- * // => true
2763
- * ```
2764
- * @version 12.1.0
2765
- */
2766
- //#endregion
2767
- //#region src/utils/object/objectAssign.d.ts
2768
- /**
2769
- * 递归地将第二个对象合并到第一个对象的副本中
2770
- * - 只有普通对象才会递归合并
2771
- *
2772
- * @param initial 初始对象
2773
- * @param override 待合并对象
2774
- */
2775
- declare function objectAssign<I$1 extends PlainObject, O extends PlainObject>(initial: I$1, override: O): Assign<I$1, O>;
2776
- declare function objectAssign<I$1 extends AnyObject, O extends AnyObject>(initial: I$1, override: O): Assign<I$1, O>;
2777
- //#endregion
2778
- //#region src/utils/object/objectCrush.d.ts
2779
- 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>>;
2780
- declare function objectCrush<T extends PlainObject>(plainObject: T): Crush<T>;
2781
- declare function objectCrush<T extends AnyObject>(anyObject: T): Crush<T>;
2782
- //#endregion
2783
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Any/Key.d.ts
2784
- /**
2785
- * Describes index keys for any type
2786
- */
2787
- declare type Key$1 = string | number | symbol;
2788
- //#endregion
2789
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/List.d.ts
2790
- /**
2791
- * A [[List]]
2792
- * @param A its type
2793
- * @returns [[List]]
2794
- * @example
2795
- * ```ts
2796
- * type list0 = [1, 2, 3]
2797
- * type list1 = number[]
2798
- * ```
2799
- */
2800
- declare type List<A$1 = any> = ReadonlyArray<A$1>;
2801
- //#endregion
2802
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Any/Cast.d.ts
2803
- /**
2804
- * Ask TS to re-check that `A1` extends `A2`.
2805
- * And if it fails, `A2` will be enforced anyway.
2806
- * Can also be used to add constraints on parameters.
2807
- * @param A1 to check against
2808
- * @param A2 to cast to
2809
- * @returns `A1 | A2`
2810
- * @example
2811
- * ```ts
2812
- * import {A} from 'ts-toolbelt'
2813
- *
2814
- * type test0 = A.Cast<'42', string> // '42'
2815
- * type test1 = A.Cast<'42', number> // number
2816
- * ```
2817
- */
2818
- declare type Cast<A1 extends any, A2 extends any> = A1 extends A2 ? A1 : A2;
2819
- //#endregion
2820
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Object/_Internal.d.ts
2821
- /**
2822
- * Describes the permissions/modifiers fields can have
2823
- * `R`: readonly
2824
- * `W`: writable
2825
- * `!`: required
2826
- * `?`: optional
2827
- */
2828
- declare type Modx = ['?' | '!', 'W' | 'R'];
2829
- //#endregion
2830
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Any/Compute.d.ts
2831
- /**
2832
- * @hidden
2833
- */
2834
- declare type ComputeRaw<A$1 extends any> = A$1 extends Function ? A$1 : { [K in keyof A$1]: A$1[K] } & unknown;
2835
- //#endregion
2836
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Any/Extends.d.ts
2837
- /**
2838
- * Check whether `A1` is part of `A2` or not. The difference with
2839
- * `extends` is that it forces a [[Boolean]] return.
2840
- * @param A1
2841
- * @param A2
2842
- * @returns [[Boolean]]
2843
- * @example
2844
- * ```ts
2845
- * import {A} from 'ts-toolbelt'
2846
- *
2847
- * type test0 = A.Extends<'a' | 'b', 'b'> // Boolean
2848
- * type test1 = A.Extends<'a', 'a' | 'b'> // True
2849
- *
2850
- * type test2 = A.Extends<{a: string}, {a: any}> // True
2851
- * type test3 = A.Extends<{a: any}, {a: any, b: any}> // False
2852
- *
2853
- * type test4 = A.Extends<never, never> // False
2854
- * /// Nothing cannot extend nothing, use `A.Equals`
2855
- * ```
2856
- */
2857
- declare type Extends<A1 extends any, A2 extends any> = [A1] extends [never] ? 0 : A1 extends A2 ? 1 : 0;
2858
- //#endregion
2859
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Iteration/Iteration.d.ts
2860
- /**
2861
- * An entry of `IterationMap`
2862
- */
2863
- declare type Iteration = [value: number, sign: '-' | '0' | '+', prev: keyof IterationMap, next: keyof IterationMap, oppo: keyof IterationMap];
2864
- declare type IterationMap = {
2865
- '__': [number, '-' | '0' | '+', '__', '__', '__'];
2866
- '-100': [-100, '-', '__', '-99', '100'];
2867
- '-99': [-99, '-', '-100', '-98', '99'];
2868
- '-98': [-98, '-', '-99', '-97', '98'];
2869
- '-97': [-97, '-', '-98', '-96', '97'];
2870
- '-96': [-96, '-', '-97', '-95', '96'];
2871
- '-95': [-95, '-', '-96', '-94', '95'];
2872
- '-94': [-94, '-', '-95', '-93', '94'];
2873
- '-93': [-93, '-', '-94', '-92', '93'];
2874
- '-92': [-92, '-', '-93', '-91', '92'];
2875
- '-91': [-91, '-', '-92', '-90', '91'];
2876
- '-90': [-90, '-', '-91', '-89', '90'];
2877
- '-89': [-89, '-', '-90', '-88', '89'];
2878
- '-88': [-88, '-', '-89', '-87', '88'];
2879
- '-87': [-87, '-', '-88', '-86', '87'];
2880
- '-86': [-86, '-', '-87', '-85', '86'];
2881
- '-85': [-85, '-', '-86', '-84', '85'];
2882
- '-84': [-84, '-', '-85', '-83', '84'];
2883
- '-83': [-83, '-', '-84', '-82', '83'];
2884
- '-82': [-82, '-', '-83', '-81', '82'];
2885
- '-81': [-81, '-', '-82', '-80', '81'];
2886
- '-80': [-80, '-', '-81', '-79', '80'];
2887
- '-79': [-79, '-', '-80', '-78', '79'];
2888
- '-78': [-78, '-', '-79', '-77', '78'];
2889
- '-77': [-77, '-', '-78', '-76', '77'];
2890
- '-76': [-76, '-', '-77', '-75', '76'];
2891
- '-75': [-75, '-', '-76', '-74', '75'];
2892
- '-74': [-74, '-', '-75', '-73', '74'];
2893
- '-73': [-73, '-', '-74', '-72', '73'];
2894
- '-72': [-72, '-', '-73', '-71', '72'];
2895
- '-71': [-71, '-', '-72', '-70', '71'];
2896
- '-70': [-70, '-', '-71', '-69', '70'];
2897
- '-69': [-69, '-', '-70', '-68', '69'];
2898
- '-68': [-68, '-', '-69', '-67', '68'];
2899
- '-67': [-67, '-', '-68', '-66', '67'];
2900
- '-66': [-66, '-', '-67', '-65', '66'];
2901
- '-65': [-65, '-', '-66', '-64', '65'];
2902
- '-64': [-64, '-', '-65', '-63', '64'];
2903
- '-63': [-63, '-', '-64', '-62', '63'];
2904
- '-62': [-62, '-', '-63', '-61', '62'];
2905
- '-61': [-61, '-', '-62', '-60', '61'];
2906
- '-60': [-60, '-', '-61', '-59', '60'];
2907
- '-59': [-59, '-', '-60', '-58', '59'];
2908
- '-58': [-58, '-', '-59', '-57', '58'];
2909
- '-57': [-57, '-', '-58', '-56', '57'];
2910
- '-56': [-56, '-', '-57', '-55', '56'];
2911
- '-55': [-55, '-', '-56', '-54', '55'];
2912
- '-54': [-54, '-', '-55', '-53', '54'];
2913
- '-53': [-53, '-', '-54', '-52', '53'];
2914
- '-52': [-52, '-', '-53', '-51', '52'];
2915
- '-51': [-51, '-', '-52', '-50', '51'];
2916
- '-50': [-50, '-', '-51', '-49', '50'];
2917
- '-49': [-49, '-', '-50', '-48', '49'];
2918
- '-48': [-48, '-', '-49', '-47', '48'];
2919
- '-47': [-47, '-', '-48', '-46', '47'];
2920
- '-46': [-46, '-', '-47', '-45', '46'];
2921
- '-45': [-45, '-', '-46', '-44', '45'];
2922
- '-44': [-44, '-', '-45', '-43', '44'];
2923
- '-43': [-43, '-', '-44', '-42', '43'];
2924
- '-42': [-42, '-', '-43', '-41', '42'];
2925
- '-41': [-41, '-', '-42', '-40', '41'];
2926
- '-40': [-40, '-', '-41', '-39', '40'];
2927
- '-39': [-39, '-', '-40', '-38', '39'];
2928
- '-38': [-38, '-', '-39', '-37', '38'];
2929
- '-37': [-37, '-', '-38', '-36', '37'];
2930
- '-36': [-36, '-', '-37', '-35', '36'];
2931
- '-35': [-35, '-', '-36', '-34', '35'];
2932
- '-34': [-34, '-', '-35', '-33', '34'];
2933
- '-33': [-33, '-', '-34', '-32', '33'];
2934
- '-32': [-32, '-', '-33', '-31', '32'];
2935
- '-31': [-31, '-', '-32', '-30', '31'];
2936
- '-30': [-30, '-', '-31', '-29', '30'];
2937
- '-29': [-29, '-', '-30', '-28', '29'];
2938
- '-28': [-28, '-', '-29', '-27', '28'];
2939
- '-27': [-27, '-', '-28', '-26', '27'];
2940
- '-26': [-26, '-', '-27', '-25', '26'];
2941
- '-25': [-25, '-', '-26', '-24', '25'];
2942
- '-24': [-24, '-', '-25', '-23', '24'];
2943
- '-23': [-23, '-', '-24', '-22', '23'];
2944
- '-22': [-22, '-', '-23', '-21', '22'];
2945
- '-21': [-21, '-', '-22', '-20', '21'];
2946
- '-20': [-20, '-', '-21', '-19', '20'];
2947
- '-19': [-19, '-', '-20', '-18', '19'];
2948
- '-18': [-18, '-', '-19', '-17', '18'];
2949
- '-17': [-17, '-', '-18', '-16', '17'];
2950
- '-16': [-16, '-', '-17', '-15', '16'];
2951
- '-15': [-15, '-', '-16', '-14', '15'];
2952
- '-14': [-14, '-', '-15', '-13', '14'];
2953
- '-13': [-13, '-', '-14', '-12', '13'];
2954
- '-12': [-12, '-', '-13', '-11', '12'];
2955
- '-11': [-11, '-', '-12', '-10', '11'];
2956
- '-10': [-10, '-', '-11', '-9', '10'];
2957
- '-9': [-9, '-', '-10', '-8', '9'];
2958
- '-8': [-8, '-', '-9', '-7', '8'];
2959
- '-7': [-7, '-', '-8', '-6', '7'];
2960
- '-6': [-6, '-', '-7', '-5', '6'];
2961
- '-5': [-5, '-', '-6', '-4', '5'];
2962
- '-4': [-4, '-', '-5', '-3', '4'];
2963
- '-3': [-3, '-', '-4', '-2', '3'];
2964
- '-2': [-2, '-', '-3', '-1', '2'];
2965
- '-1': [-1, '-', '-2', '0', '1'];
2966
- '0': [0, '0', '-1', '1', '0'];
2967
- '1': [1, '+', '0', '2', '-1'];
2968
- '2': [2, '+', '1', '3', '-2'];
2969
- '3': [3, '+', '2', '4', '-3'];
2970
- '4': [4, '+', '3', '5', '-4'];
2971
- '5': [5, '+', '4', '6', '-5'];
2972
- '6': [6, '+', '5', '7', '-6'];
2973
- '7': [7, '+', '6', '8', '-7'];
2974
- '8': [8, '+', '7', '9', '-8'];
2975
- '9': [9, '+', '8', '10', '-9'];
2976
- '10': [10, '+', '9', '11', '-10'];
2977
- '11': [11, '+', '10', '12', '-11'];
2978
- '12': [12, '+', '11', '13', '-12'];
2979
- '13': [13, '+', '12', '14', '-13'];
2980
- '14': [14, '+', '13', '15', '-14'];
2981
- '15': [15, '+', '14', '16', '-15'];
2982
- '16': [16, '+', '15', '17', '-16'];
2983
- '17': [17, '+', '16', '18', '-17'];
2984
- '18': [18, '+', '17', '19', '-18'];
2985
- '19': [19, '+', '18', '20', '-19'];
2986
- '20': [20, '+', '19', '21', '-20'];
2987
- '21': [21, '+', '20', '22', '-21'];
2988
- '22': [22, '+', '21', '23', '-22'];
2989
- '23': [23, '+', '22', '24', '-23'];
2990
- '24': [24, '+', '23', '25', '-24'];
2991
- '25': [25, '+', '24', '26', '-25'];
2992
- '26': [26, '+', '25', '27', '-26'];
2993
- '27': [27, '+', '26', '28', '-27'];
2994
- '28': [28, '+', '27', '29', '-28'];
2995
- '29': [29, '+', '28', '30', '-29'];
2996
- '30': [30, '+', '29', '31', '-30'];
2997
- '31': [31, '+', '30', '32', '-31'];
2998
- '32': [32, '+', '31', '33', '-32'];
2999
- '33': [33, '+', '32', '34', '-33'];
3000
- '34': [34, '+', '33', '35', '-34'];
3001
- '35': [35, '+', '34', '36', '-35'];
3002
- '36': [36, '+', '35', '37', '-36'];
3003
- '37': [37, '+', '36', '38', '-37'];
3004
- '38': [38, '+', '37', '39', '-38'];
3005
- '39': [39, '+', '38', '40', '-39'];
3006
- '40': [40, '+', '39', '41', '-40'];
3007
- '41': [41, '+', '40', '42', '-41'];
3008
- '42': [42, '+', '41', '43', '-42'];
3009
- '43': [43, '+', '42', '44', '-43'];
3010
- '44': [44, '+', '43', '45', '-44'];
3011
- '45': [45, '+', '44', '46', '-45'];
3012
- '46': [46, '+', '45', '47', '-46'];
3013
- '47': [47, '+', '46', '48', '-47'];
3014
- '48': [48, '+', '47', '49', '-48'];
3015
- '49': [49, '+', '48', '50', '-49'];
3016
- '50': [50, '+', '49', '51', '-50'];
3017
- '51': [51, '+', '50', '52', '-51'];
3018
- '52': [52, '+', '51', '53', '-52'];
3019
- '53': [53, '+', '52', '54', '-53'];
3020
- '54': [54, '+', '53', '55', '-54'];
3021
- '55': [55, '+', '54', '56', '-55'];
3022
- '56': [56, '+', '55', '57', '-56'];
3023
- '57': [57, '+', '56', '58', '-57'];
3024
- '58': [58, '+', '57', '59', '-58'];
3025
- '59': [59, '+', '58', '60', '-59'];
3026
- '60': [60, '+', '59', '61', '-60'];
3027
- '61': [61, '+', '60', '62', '-61'];
3028
- '62': [62, '+', '61', '63', '-62'];
3029
- '63': [63, '+', '62', '64', '-63'];
3030
- '64': [64, '+', '63', '65', '-64'];
3031
- '65': [65, '+', '64', '66', '-65'];
3032
- '66': [66, '+', '65', '67', '-66'];
3033
- '67': [67, '+', '66', '68', '-67'];
3034
- '68': [68, '+', '67', '69', '-68'];
3035
- '69': [69, '+', '68', '70', '-69'];
3036
- '70': [70, '+', '69', '71', '-70'];
3037
- '71': [71, '+', '70', '72', '-71'];
3038
- '72': [72, '+', '71', '73', '-72'];
3039
- '73': [73, '+', '72', '74', '-73'];
3040
- '74': [74, '+', '73', '75', '-74'];
3041
- '75': [75, '+', '74', '76', '-75'];
3042
- '76': [76, '+', '75', '77', '-76'];
3043
- '77': [77, '+', '76', '78', '-77'];
3044
- '78': [78, '+', '77', '79', '-78'];
3045
- '79': [79, '+', '78', '80', '-79'];
3046
- '80': [80, '+', '79', '81', '-80'];
3047
- '81': [81, '+', '80', '82', '-81'];
3048
- '82': [82, '+', '81', '83', '-82'];
3049
- '83': [83, '+', '82', '84', '-83'];
3050
- '84': [84, '+', '83', '85', '-84'];
3051
- '85': [85, '+', '84', '86', '-85'];
3052
- '86': [86, '+', '85', '87', '-86'];
3053
- '87': [87, '+', '86', '88', '-87'];
3054
- '88': [88, '+', '87', '89', '-88'];
3055
- '89': [89, '+', '88', '90', '-89'];
3056
- '90': [90, '+', '89', '91', '-90'];
3057
- '91': [91, '+', '90', '92', '-91'];
3058
- '92': [92, '+', '91', '93', '-92'];
3059
- '93': [93, '+', '92', '94', '-93'];
3060
- '94': [94, '+', '93', '95', '-94'];
3061
- '95': [95, '+', '94', '96', '-95'];
3062
- '96': [96, '+', '95', '97', '-96'];
3063
- '97': [97, '+', '96', '98', '-97'];
3064
- '98': [98, '+', '97', '99', '-98'];
3065
- '99': [99, '+', '98', '100', '-99'];
3066
- '100': [100, '+', '99', '__', '-100'];
3067
- };
3068
- //#endregion
3069
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Iteration/Prev.d.ts
3070
- /**
3071
- * Move `I`'s position backwards
3072
- * @param I to move
3073
- * @returns [[Iteration]]
3074
- * @example
3075
- * ```ts
3076
- * import {I} from 'ts-toolbelt'
3077
- *
3078
- * type i = I.IterationOf<'20'>
3079
- *
3080
- * type test0 = I.Pos<i> // 20
3081
- * type test1 = I.Pos<I.Prev<i>> // 19
3082
- * ```
3083
- */
3084
- declare type Prev<I$1 extends Iteration> = IterationMap[I$1[2]];
3085
- //#endregion
3086
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Iteration/IterationOf.d.ts
3087
- /**
3088
- * Transform a number into an [[Iteration]]
3089
- * (to use [[Prev]], [[Next]], & [[Pos]])
3090
- * @param N to transform
3091
- * @returns [[Iteration]]
3092
- * @example
3093
- * ```ts
3094
- * import {I} from 'ts-toolbelt'
3095
- *
3096
- * type i = I.IterationOf<0> // ["-1", "1", "0", 0, "0"]
3097
- *
3098
- * type next = I.Next<i> // ["0", "2", "1", 1, "+"]
3099
- * type prev = I.Prev<i> // ["-2", "0", "-1", -1, "-"]
3100
- *
3101
- * type nnext = I.Pos<next> // +1
3102
- * type nprev = I.Pos<prev> // -1
3103
- * ```
3104
- */
3105
- declare type IterationOf<N extends number> = `${N}` extends keyof IterationMap ? IterationMap[`${N}`] : IterationMap['__'];
3106
- //#endregion
3107
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Iteration/Pos.d.ts
3108
- /**
3109
- * Get the position of `I` (**number**)
3110
- * @param I to query
3111
- * @returns `number`
3112
- * @example
3113
- * ```ts
3114
- * import {I} from 'ts-toolbelt'
3115
- *
3116
- * type i = I.IterationOf<'20'>
3117
- *
3118
- * type test0 = I.Pos<i> // 20
3119
- * type test1 = I.Pos<I.Next<i>> // 21
3120
- * ```
3121
- */
3122
- declare type Pos<I$1 extends Iteration> = I$1[0];
3123
- //#endregion
3124
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Tail.d.ts
3125
- /**
3126
- * Remove the first item out of a [[List]]
3127
- * @param L
3128
- * @returns [[List]]
3129
- * @example
3130
- * ```ts
3131
- * ```
3132
- */
3133
- declare type Tail$1<L$1 extends List> = L$1 extends readonly [] ? L$1 : L$1 extends readonly [any?, ...infer LTail] ? LTail : L$1;
3134
- //#endregion
3135
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Union/IntersectOf.d.ts
3136
- /**
3137
- * Transform a [[Union]] to an * *intersection**
3138
- * @param U to transform
3139
- * @returns `&`
3140
- * @example
3141
- * ```ts
3142
- * ```
3143
- */
3144
- declare type IntersectOf<U$1 extends any> = (U$1 extends unknown ? (k: U$1) => void : never) extends ((k: infer I) => void) ? I : never;
3145
- //#endregion
3146
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Object/Overwrite.d.ts
3147
- /**
3148
- * Update the fields of `O` with the ones of `O1`
3149
- * (only the existing fields will be updated)
3150
- * @param O to update
3151
- * @param O1 to update with
3152
- * @returns [[Object]]
3153
- * @example
3154
- * ```ts
3155
- * ```
3156
- */
3157
- declare type Overwrite<O extends object, O1 extends object> = { [K in keyof O]: K extends keyof O1 ? O1[K] : O[K] } & {};
3158
- //#endregion
3159
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/_Internal.d.ts
3160
- /**
3161
- * Remove `?` & `readonly` from a [[List]]
3162
- */
3163
- declare type Naked<L$1 extends List> = Overwrite<Required<L$1>, L$1>;
3164
- //#endregion
3165
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Prepend.d.ts
3166
- /**
3167
- * Add an element `A` at the beginning of `L`
3168
- * @param L to append to
3169
- * @param A to be added to
3170
- * @returns [[List]]
3171
- * @example
3172
- * ```ts
3173
- * ```
3174
- */
3175
- declare type Prepend<L$1 extends List, A$1 extends any> = [A$1, ...L$1];
3176
- //#endregion
3177
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Iteration/_Internal.d.ts
3178
- /**
3179
- * Describes how to perform iterations
3180
- */
3181
- declare type Way = '->' | '<-';
3182
- //#endregion
3183
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Append.d.ts
3184
- /**
3185
- * Add an element `A` at the end of `L`.
3186
- * @param L to append to
3187
- * @param A to be added to
3188
- * @returns [[List]]
3189
- * @example
3190
- * ```ts
3191
- * import {L} from 'ts-toolbelt'
3192
- *
3193
- * type test0 = L.Append<[1, 2, 3], 4> // [1, 2, 3, 4]
3194
- * type test1 = L.Append<[], 'a'> // ['a']
3195
- * type test2 = L.Append<readonly ['a', 'b'], 'c'> // ['a', 'b', 'c']
3196
- * type test3 = L.Append<[1, 2], [3, 4]> // [1, 2, [3, 4]]
3197
- * ```
3198
- */
3199
- declare type Append<L$1 extends List, A$1 extends any> = [...L$1, A$1];
3200
- //#endregion
3201
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Object/Record.d.ts
3202
- /**
3203
- * Create an object filled with `A` for the fields `K`
3204
- * @param K to choose fields
3205
- * @param A (?=`unknown`) to fill fields with
3206
- * @param modx (?=`['!', 'W']`) to set modifiers
3207
- * @returns [[Object]]
3208
- * @example
3209
- * ```ts
3210
- * ```
3211
- */
3212
- declare type Record$1<K$1 extends Key$1, A$1 extends any = unknown, modx extends Modx = ['!', 'W']> = {
3213
- '!': {
3214
- 'R': { readonly [P in K$1]: A$1 };
3215
- 'W': { [P in K$1]: A$1 };
3216
- };
3217
- '?': {
3218
- 'R': { readonly [P in K$1]?: A$1 };
3219
- 'W': { [P in K$1]?: A$1 };
3220
- };
3221
- }[modx[0]][modx[1]];
3222
- //#endregion
3223
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Object/Invert.d.ts
3224
- /**
3225
- * @hidden
3226
- */
3227
- declare type _Invert<O extends Record$1<Key$1, Key$1>> = ComputeRaw<IntersectOf<{ [K in keyof O]: Record$1<O[K], K> }[keyof O]>>;
3228
- /**
3229
- * Swaps the keys and values of an [[Object]] (if applicable)
3230
- * @param O
3231
- * @returns [[Object]]
3232
- * @example
3233
- * ```ts
3234
- * import {O} from 'ts-toolbelt'
3235
- *
3236
- * enum E {
3237
- * A = 'Av',
3238
- * B = 'Bv',
3239
- * C = 'Cv',
3240
- * D = 'Dv',
3241
- * X = 1
3242
- * }
3243
- *
3244
- * type O = {
3245
- * A: 'Av'
3246
- * B: 'Bv'
3247
- * C: 'Cv'
3248
- * D: 'Dv'
3249
- * X: 1
3250
- * }
3251
- *
3252
- * type test0 = O.Invert<typeof E>
3253
- * type test1 = O.Invert<O>
3254
- * ```
3255
- */
3256
- declare type Invert<O extends Record$1<keyof O, Key$1>> = O extends unknown ? _Invert<O> : never;
3257
- //#endregion
3258
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Drop.d.ts
3259
- /**
3260
- * @hidden
3261
- */
3262
- declare type DropForth<L$1 extends List, N extends Iteration> = {
3263
- 0: DropForth<Tail$1<L$1>, Prev<N>>;
3264
- 1: L$1;
3265
- }[Extends<0, Pos<N>>];
3266
- /**
3267
- * @hidden
3268
- */
3269
- declare type DropBack<L$1 extends List, N extends Iteration, I$1 extends Iteration = Prev<N>, LN extends List = []> = {
3270
- 0: DropBack<L$1, N, Prev<I$1>, Prepend<LN, L$1[Pos<I$1>]>>;
3271
- 1: LN;
3272
- }[Extends<-1, Pos<I$1>>];
3273
- /**
3274
- * @hidden
3275
- */
3276
- declare type __Drop<L$1 extends List, N extends Iteration, way extends Way> = {
3277
- '->': DropForth<L$1, N>;
3278
- '<-': DropBack<L$1, N>;
3279
- }[way];
3280
- /**
3281
- * @hidden
3282
- */
3283
- declare type _Drop<L$1 extends List, N extends number, way extends Way = '->'> = __Drop<Naked<L$1>, IterationOf<N>, way> extends infer X ? Cast<X, List> : never;
3284
- /**
3285
- * Remove `N` entries out of `L`
3286
- * @param L to remove from
3287
- * @param N to remove out
3288
- * @param way (?=`'->'`) from front: '->', from end: '<-'
3289
- * @returns [[List]]
3290
- * @example
3291
- * ```ts
3292
- * ```
3293
- */
3294
- declare type Drop<L$1 extends List, N extends number, way extends Way = '->'> = L$1 extends unknown ? N extends unknown ? _Drop<L$1, N, way> : never : never;
3295
- //#endregion
3296
- //#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Take.d.ts
3297
- /**
3298
- * starts in reverse from `N` till `N` = 0
3299
- * @hidden
3300
- */
3301
- declare type TakeForth<L$1 extends List, N extends Iteration, I$1 extends Iteration = Prev<N>, LN extends List = []> = {
3302
- 0: TakeForth<L$1, N, Prev<I$1>, Prepend<LN, L$1[Pos<I$1>]>>;
3303
- 1: LN;
3304
- }[Extends<-1, Pos<I$1>>];
3305
- /**
3306
- * starts in reverse from the end till `N` = 0
3307
- * @hidden
3308
- */
3309
- declare type TakeBack<L$1 extends List, N extends Iteration> = {
3310
- 0: TakeBack<Tail$1<L$1>, Prev<N>>;
3311
- 1: L$1;
3312
- }[Extends<0, Pos<N>>];
3313
- /**
3314
- * @hidden
3315
- */
3316
- declare type __Take<L$1 extends List, N extends Iteration, way extends Way> = {
3317
- '->': TakeForth<L$1, N>;
3318
- '<-': TakeBack<L$1, N>;
3319
- }[way];
3320
- /**
3321
- * @hidden
3322
- */
3323
- declare type _Take<L$1 extends List, N extends number, way extends Way = '->'> = __Take<L$1, IterationOf<N>, way> extends infer X ? Cast<X, List> : never;
3324
- /**
3325
- * Extract `N` entries out of `L`
3326
- * @param L to extract from
3327
- * @param N to extract out
3328
- * @param way (?=`'->'`) to extract from end
3329
- * @returns [[List]]
3330
- * @example
3331
- * ```ts
3332
- * ```
3333
- */
3334
- declare type Take<L$1 extends List, N extends number, way extends Way = '->'> = L$1 extends unknown ? N extends unknown ? _Take<L$1, N, way> : never : never;
3335
- //#endregion
3336
- //#region src/types/index.type.d.ts
3337
- type AnyArray<A$1 = any> = readonly A$1[];
3338
- type Range<Start extends number, End extends number> = Exclude<keyof TupleOf<End>, keyof TupleOf<Start>>;
3339
- type TupleToEntries<A$1 extends readonly unknown[]> = If<IsAny<A$1>, unknown, { [Key in keyof A$1]: [Key, A$1[Key]] }>;
3340
- type Groups<L$1 extends AnyArray, LN extends AnyArray = [], D extends number[] = []> = D["length"] extends 40 ? LN : {
3341
- 0: Groups<Drop<L$1, 1>, Append<LN, [`${LN["length"]}`, Take<L$1, 1>]>, [...D, 0]>;
3342
- 1: LN;
3343
- }[Extends<L$1, AnyArray<never>>];
3344
- type TupleToGroups<L$1 extends AnyArray> = Groups<L$1> extends infer X ? Cast<X, AnyArray> : never;
3345
- //#endregion
3346
- //#region src/utils/object/objectEntries.d.ts
3347
- /**
3348
- * 返回对象的可枚举属性的键/值数组
3349
- */
3350
- declare function objectEntries<const S extends string>(string: S): TupleToEntries<Split<S, "">>;
3351
- declare function objectEntries<const A$1 extends readonly unknown[]>(array: A$1): TupleToGroups<A$1>;
3352
- declare function objectEntries<const O extends PlainObject>(plainObject: O): [string & keyof O, O[keyof O]][];
3353
- declare function objectEntries<const O extends AnyObject>(anyObject: O): [string & keyof O, O[keyof O]][];
3354
- //#endregion
3355
- //#region src/utils/object/objectInvert.d.ts
3356
- /**
3357
- * 尽可能地交换对象的键和值
3358
- *
3359
- * @param obj 对象
3360
- */
3361
- declare function objectInvert<const O extends Record<keyof O, PropertyKey>>(plainObject: O): Invert<O>;
3362
- declare function objectInvert<const O extends AnyObject>(anyObject: O): Invert<O>;
3363
- //#endregion
3364
- //#region src/utils/object/objectKeys.d.ts
3365
- /**
3366
- * 返回对象可枚举属性和方法的名称
3367
- * - `Object.keys` 始终返回 `string[]` 类型,此函数可以返回具体类型
3368
- */
3369
- declare function objectKeys<const S extends string>(string: S): UnionToTuple<Range<0, Split<S, "">["length"]>>;
3370
- declare function objectKeys<const A$1 extends ArrayLike<unknown>>(array: A$1): UnionToTuple<Range<0, A$1["length"]>>;
3371
- declare function objectKeys<O extends PlainObject>(plainObject: O): `${Extract<keyof O, string | number>}`[];
3372
- declare function objectKeys<O extends AnyObject>(anyObject: O): `${Extract<keyof O, string | number>}`[];
3373
- //#endregion
3374
- //#region src/utils/object/objectOmit.d.ts
3375
- declare function objectOmit<O extends PlainObject, K$1 extends keyof O>(plainObject: O, keys: readonly K$1[]): Pick<O, K$1>;
3376
- declare function objectOmit<O extends AnyObject, K$1 extends keyof O>(anyObject: O, keys: readonly K$1[]): Pick<O, K$1>;
3377
- //#endregion
3378
- //#region src/utils/object/objectPick.d.ts
3379
- declare function objectPick<O extends PlainObject, K$1 extends keyof O>(plainObject: O, keys: readonly K$1[]): Pick<O, K$1>;
3380
- declare function objectPick<O extends AnyObject, K$1 extends keyof O>(anyObject: O, keys: readonly K$1[]): Pick<O, K$1>;
3381
- //#endregion
3382
- //#region src/utils/object/objectValues.d.ts
3383
- /**
3384
- * 返回对象可枚举属性的值的数组
3385
- */
3386
- declare function objectValues<S extends string>(string: S): Split<S, "">;
3387
- declare function objectValues<A$1 extends ArrayLike<unknown>>(array: A$1): A$1;
3388
- declare function objectValues<O extends PlainObject>(plainObject: O): UnionToTuple<ValueOf<O>>;
3389
- declare function objectValues<O extends AnyObject>(anyObject: O): UnionToTuple<ValueOf<O>>;
3390
- //#endregion
3391
- //#region src/utils/string/stringInitialCase.d.ts
3392
- /**
3393
- * 字符串首字母大小写
3394
- * - 包含非西欧字母字符时,不处理
3395
- * - 纯字母且全大写时,不处理
3396
- * - 纯字母且非全大写时,首字母小写,其余保留
3397
- * - 纯字母且非全大写时,首字母大写,其余保留
3398
- *
3399
- * @param input 待处理字符串
3400
- * @param caseType 大小写类型
3401
- */
3402
- declare function stringInitialCase(input: string, caseType?: "lower" | "upper" | undefined): string;
3403
- //#endregion
3404
- //#region src/utils/string/stringReplace.d.ts
3405
- /**
3406
- * 字符串替换
3407
- * - 替换第一个匹配项
3408
- *
3409
- * @param input 待处理字符串
3410
- * @param search 匹配项
3411
- * @param replacement 替换项
3412
- */
3413
- 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>;
3414
- //#endregion
3415
- //#region src/utils/string/stringTemplate.d.ts
3416
- /**
3417
- * 字符串模板替换
3418
- *
3419
- * @param input 待处理字符串
3420
- * @param template 模板对象
3421
- * @param regex 模板匹配正则
3422
- */
3423
- declare function stringTemplate(input: string, template: PlainObject, regex?: RegExp): string;
3424
- //#endregion
3425
- //#region src/utils/string/stringToJson.d.ts
3426
- /**
3427
- * 处理 JSON 字符串
3428
- *
3429
- * @param input 待处理字符串
3430
- * @param safeValue 安全值
3431
- */
3432
- declare function stringToJson<R$1 extends AnyObject = AnyObject, D extends R$1 = R$1>(input: string | null | undefined, safeValue: D): R$1;
3433
- //#endregion
3434
- //#region src/utils/string/stringToNumber.d.ts
3435
- /**
3436
- * 从字符串中提取数字字符串
3437
- *
3438
- * @param input 待处理字符串
3439
- */
3440
- declare function stringToNumber(input: string): string;
3441
- //#endregion
3442
- //#region src/utils/string/stringToPosix.d.ts
3443
- /**
3444
- * 将路径转换为 POSIX 风格
3445
- *
3446
- * @param input 待处理字符串
3447
- * @param removeLeadingSlash 是否移除开头斜杠,默认为 `false`
3448
- */
3449
- declare function stringToPosix(input: string | null | undefined, removeLeadingSlash?: boolean): string;
3450
- //#endregion
3451
- //#region src/utils/string/stringToValues.d.ts
3452
- /**
3453
- * 字符串分割为数组
3454
- *
3455
- * @param input 待处理字符串
3456
- * @param valueType 数组中每一项的类型
3457
- * @param splitSymbol 分隔符,默认为 `,`
3458
- */
3459
- declare function stringToValues(input: string | null | undefined, valueType?: "number" | undefined, splitSymbol?: string | undefined): number[];
3460
- declare function stringToValues(input: string | null | undefined, valueType: "string", splitSymbol?: string | undefined): string[];
3461
- //#endregion
3462
- //#region src/utils/string/stringTrim.d.ts
3463
- /**
3464
- * 从字符串中裁切掉所有的前缀和后缀字符
3465
- *
3466
- * @param input 待处理字符串
3467
- * @param charsToTrim 裁切字符,默认为 `" "`
3468
- */
3469
- declare function stringTrim(input: string | null | undefined, charsToTrim?: string): string;
3470
- //#endregion
3471
- //#region src/utils/string/stringTruncate.d.ts
3472
- /**
3473
- * 截取字符串
3474
- * - 支持中英文混排,不会在汉字中间截断
3475
- *
3476
- * @param input 待处理字符串
3477
- * @param maxLength 最大长度
3478
- * @param ellipsis 省略符,默认为 `...`
3479
- */
3480
- declare function stringTruncate(input: string, maxLength: number, ellipsis?: string): string;
3481
- //#endregion
3482
- //#region src/utils/time/timeZone.d.ts
3483
- declare function getTimeZone(): {
3484
- UTC: string;
3485
- timeZone: string;
3486
- };
3487
- //#endregion
3488
- //#region src/utils/tree/types.d.ts
3489
- type RowKey = "id";
3490
- type ParentIdKey = "parentId";
3491
- type ChildrenKey = "children";
3492
- type Strategy = "pre" | "post" | "breadth";
3493
- interface BaseCallbackMeta<T> {
3494
- depth: number;
3495
- parents?: T[];
3496
- }
3497
- interface BaseOptions<T, CK extends string> {
3498
- childrenKey?: CK;
3499
- strategy?: Strategy;
3500
- getChildrenKey?: ((row: T, meta: BaseCallbackMeta<T>) => CK) | undefined;
3501
- }
3502
- //#endregion
3503
- //#region src/utils/tree/treeFilter.d.ts
3504
- type TreeFilterOptions<T extends AnyObject, CK extends string = ChildrenKey> = BaseOptions<T, CK>;
3505
- type TreeFilterCallback<T extends AnyObject> = (row: T, meta: BaseCallbackMeta<T>) => boolean;
3506
- declare function treeFilter<T extends AnyObject, CK extends string = ChildrenKey>(tree: T[], callback: TreeFilterCallback<T>, options?: TreeFilterOptions<T, CK>): T[];
3507
- declare function treeFilter<T extends AnyObject, CK extends string = ChildrenKey>(tree: T, callback: TreeFilterCallback<T>, options?: TreeFilterOptions<T, CK>): T;
3508
- //#endregion
3509
- //#region src/utils/tree/treeFind.d.ts
3510
- type TreeFindOptions<T extends AnyObject, CK extends string = ChildrenKey> = BaseOptions<T, CK>;
3511
- type TreeFindCallback<T extends AnyObject> = (row: T, meta: BaseCallbackMeta<T>) => boolean;
3512
- /**
3513
- * 查找树节点,找到第一个返回非空值的节点
3514
- */
3515
- declare function treeFind<T extends AnyObject, CK extends string = ChildrenKey>(tree: T | T[], callback: TreeFindCallback<T>, options?: TreeFindOptions<T, CK>): T | undefined;
3516
- //#endregion
3517
- //#region src/utils/tree/treeForEach.d.ts
3518
- type TreeForeachOptions<T extends AnyObject, CK extends string = ChildrenKey> = BaseOptions<T, CK>;
3519
- type TreeForeachCallback<T extends AnyObject> = (row: T, meta: BaseCallbackMeta<T>) => void;
3520
- declare function treeForEach<T extends AnyObject, CK extends string = ChildrenKey>(tree: T | T[], callback: TreeForeachCallback<T>, options?: TreeForeachOptions<T, CK>): void;
3521
- //#endregion
3522
- //#region src/utils/tree/treeMap.d.ts
3523
- type TreeMapOptions<T extends AnyObject, CK extends string> = BaseOptions<T, CK>;
3524
- type TreeMapCallback<R$1 extends AnyObject, T extends AnyObject> = (row: T, meta: BaseCallbackMeta<T>) => R$1;
3525
- 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>[];
3526
- 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>;
3527
- //#endregion
3528
- //#region src/utils/tree/rowsToTree.d.ts
3529
- interface RowsToTreeOptions<RK extends string = RowKey, PK extends string = ParentIdKey, CK extends string = ChildrenKey> {
3530
- rowKey?: RK;
3531
- parentIdKey?: PK;
3532
- childrenKey?: CK;
3533
- }
3534
- /**
3535
- * 行结构 转 树结构
3536
- */
3537
- 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[];
3538
- //#endregion
3539
- //#region src/utils/tree/treeToRows.d.ts
3540
- type TreeToRowsOptions<T extends AnyObject, CK extends string = ChildrenKey> = TreeForeachOptions<T, CK>;
3541
- /**
3542
- * 树结构 转 行结构
3543
- */
3544
- 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[];
3545
- //#endregion
3546
- //#region src/utils/typeof/isAbortSignal.d.ts
3547
- declare function isAbortSignal(value: unknown): value is AbortSignal;
3548
- //#endregion
3549
- //#region src/utils/typeof/isArray.d.ts
3550
- type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
3551
- declare function isArray(value: unknown): value is unknown[];
3552
- declare function isTypedArray(value: unknown): value is TypedArray;
3553
- //#endregion
3554
- //#region src/utils/typeof/isBigInt.d.ts
3555
- declare function isBigInt(value: unknown): value is bigint;
3556
- //#endregion
3557
- //#region src/utils/typeof/isBlob.d.ts
3558
- declare function isBlob(value: unknown): value is Blob;
3559
- declare function isFile(value: unknown): value is File;
3560
- //#endregion
3561
- //#region src/utils/typeof/isBoolean.d.ts
3562
- declare function isBoolean(value: unknown): value is boolean;
3563
- //#endregion
3564
- //#region src/utils/typeof/isClass.d.ts
3565
- declare function isClass(value: unknown): value is Class<AnyObject>;
3566
- //#endregion
3567
- //#region src/utils/typeof/isDate.d.ts
3568
- declare function isDate(value: unknown): value is Date;
3569
- //#endregion
3570
- //#region src/utils/typeof/isEnumeration.d.ts
3571
- /**
3572
- * 判断一个值是否为有效的枚举对象
3573
- * - 枚举不能为空
3574
- * - 枚举所有的值必须是 string 或 number
3575
- *
3576
- * @param obj
3577
- * @returns
3578
- */
3579
- declare function isEnumeration(obj: unknown): [boolean, boolean];
3580
- //#endregion
3581
- //#region src/utils/typeof/isEqual.d.ts
3582
- /**
3583
- * 检查给定的值是否相等
3584
- * @reference https://github.com/radashi-org/radashi/blob/main/src/typed/isEqual.ts
3585
- *
3586
- * @param {T} x
3587
- * @param {T} y
3588
- */
3589
- declare function isEqual<T>(x: T, y: T): boolean;
3590
- //#endregion
3591
- //#region src/utils/typeof/isError.d.ts
3592
- declare function isError(value: unknown): value is Error;
3593
- //#endregion
3594
- //#region src/utils/typeof/isFalsy.d.ts
3595
- declare function isFalsy(value: unknown): boolean;
3596
- declare function isFalsyLike(value: unknown): boolean;
3597
- //#endregion
3598
- //#region src/utils/typeof/isFunction.d.ts
3599
- declare function isFunction(value: unknown): value is AnyFunction;
3600
- declare function isAsyncFunction(value: unknown): value is AnyAsyncFunction;
3601
- declare function isGeneratorFunction(value: unknown): value is AnyGeneratorFunction;
3602
- declare function isAsyncGeneratorFunction(value: unknown): value is AnyAsyncGeneratorFunction;
3603
- //#endregion
3604
- //#region src/utils/typeof/isIterable.d.ts
3605
- declare function isIterable(value: unknown): value is {
3606
- [Symbol.iterator]: () => Iterator<unknown>;
3607
- };
3608
- //#endregion
3609
- //#region src/utils/typeof/isMap.d.ts
3610
- declare function isMap(value: unknown): value is Map<unknown, unknown>;
3611
- declare function isWeakMap(value: unknown): value is WeakMap<AnyObject, unknown>;
3612
- //#endregion
3613
- //#region src/utils/typeof/isNull.d.ts
3614
- declare function isNull(value: unknown): value is null;
3615
- //#endregion
3616
- //#region src/utils/typeof/isNumber.d.ts
3617
- /**
3618
- * 检查 value 是否为 number 类型
3619
- *
3620
- * @param value 待检查值
3621
- * @param checkNaN 是否排除 `NaN`,默认为 `true`
3622
- */
3623
- declare function isNumber(value: unknown, checkNaN?: boolean): value is number;
3624
- /**
3625
- * 检查 value 是否为 NaN
3626
- *
3627
- * @param value 待检查值
3628
- */
3629
- declare function isNaN(value: unknown): value is number;
3630
- /**
3631
- * 检查 value 是否为整数
3632
- *
3633
- * @param value 待检查值
3634
- * @param safeCheck 是否附加安全数检查
3635
- */
3636
- declare function isInteger(value: unknown, safeCheck?: boolean): value is number;
3637
- /**
3638
- * 检查 value 是否为正整数
3639
- * - 此函数中 `0` 不被视为正整数
3640
- *
3641
- * @param value 待检查值
3642
- * @param safeCheck 是否附加安全数检查
3643
- */
3644
- declare function isPositiveInteger(value: unknown, safeCheck?: boolean): value is number;
3645
- /**
3646
- * 检查 value 是否为负整数
3647
- * - 此函数中 `0` 不被视为负整数
3648
- *
3649
- * @param value 待检查值
3650
- * @param safeCheck 是否附加安全数检查
3651
- */
3652
- declare function isNegativeInteger(value: unknown, safeCheck?: boolean): value is number;
3653
- /**
3654
- * 检查 value 是否为 Infinity
3655
- * - 排除 `NaN`
3656
- *
3657
- * @param value 待检查值
3658
- */
3659
- declare function isInfinity(value: unknown): value is number;
3660
- /**
3661
- * 检查 value 是否类似 Infinity
3662
- * - 排除 `NaN`
3663
- *
3664
- * @param value 待检查值
3665
- */
3666
- declare function isInfinityLike(value: unknown): boolean;
3667
- //#endregion
3668
- //#region src/utils/typeof/isObject.d.ts
3669
- /**
3670
- * 判断是否为对象类型
3671
- * - 可选是否检查原型为 `Object.prototype`,防止原型链污染
3672
- *
3673
- * @param value 待检查值
3674
- * @param prototypeCheck 是否进行原型检查,默认 `true`
3675
- */
3676
- declare function isObject(value: unknown, prototypeCheck?: boolean): value is Record<PropertyKey, unknown>;
3677
- //#endregion
3678
- //#region src/utils/typeof/isPromise.d.ts
3679
- declare function isPromise(value: unknown): value is Promise<unknown>;
3680
- declare function isPromiseLike(value: unknown): value is PromiseLike<unknown>;
3681
- //#endregion
3682
- //#region src/utils/typeof/isReadableStream.d.ts
3683
- /**
3684
- * Checks if a value is a WHATWG ReadableStream instance.
3685
- *
3686
- * - Uses `Object.prototype.toString` where supported (modern browsers, Node.js ≥18).
3687
- * - Falls back to duck-typing in older environments.
3688
- * - Resistant to basic forgery, but not 100% secure in all polyfill scenarios.
3689
- *
3690
- * ⚠️ Note: In older Node.js (<18) or with non-compliant polyfills, this may return false positives or negatives.
3691
- */
3692
- declare function isReadableStream(value: unknown): value is ReadableStream;
3693
- //#endregion
3694
- //#region src/utils/typeof/isRegExp.d.ts
3695
- declare function isRegExp(value: unknown): value is RegExp;
3696
- //#endregion
3697
- //#region src/utils/typeof/isSet.d.ts
3698
- declare function isSet(value: unknown): value is Set<unknown>;
3699
- declare function isWeakSet(value: unknown): value is WeakSet<AnyObject>;
3700
- //#endregion
3701
- //#region src/utils/typeof/isString.d.ts
3702
- /**
3703
- * 检查 value 是否为 string 类型
3704
- *
3705
- * @param value 待检查值
3706
- * @param checkEmpty 是否排除空字符串
3707
- */
3708
- declare function isString(value: unknown, checkEmpty?: boolean): value is string;
3709
- //#endregion
3710
- //#region src/utils/typeof/isSymbol.d.ts
3711
- declare function isSymbol(value: unknown): value is symbol;
3712
- //#endregion
3713
- //#region src/utils/typeof/isUndefined.d.ts
3714
- declare function isUndefined(value: unknown): value is undefined;
3715
- //#endregion
3716
- //#region src/utils/typeof/isURLSearchParams.d.ts
3717
- declare function isURLSearchParams(value: unknown): value is URLSearchParams;
3718
- //#endregion
3719
- //#region src/utils/typeof/isWebSocket.d.ts
3720
- declare function isWebSocket(value: unknown): value is WebSocket;
3721
- //#endregion
3722
- //#region src/utils/typeof/isWindow.d.ts
3723
- declare function isWindow(value: unknown): value is Window;
3724
- //#endregion
3725
- export { arrayCast, arrayCompete, arrayCounting, arrayDifference, arrayFirst, arrayFork, arrayIntersection, arrayLast, arrayMerge, arrayPick, arrayReplace, arraySplit, cloneDeep, enumEntries, enumKeys, enumValues, getTimeZone, isAbortSignal, isArray, isAsyncFunction, isAsyncGeneratorFunction, isBigInt, isBlob, isBoolean, isClass, isDate, isEnumeration, isEqual, isError, isFalsy, isFalsyLike, isFile, isFunction, isGeneratorFunction, isISOMobile, isInfinity, isInfinityLike, isInteger, isIterable, isMap, isMobile, isNaN, isNegativeInteger, isNull, isNumber, isObject, isPositiveInteger, isPromise, isPromiseLike, isReadableStream, isRegExp, isSet, isString, isSymbol, isTablet, isTypedArray, isURLSearchParams, isUndefined, isWeakMap, isWeakSet, isWebSocket, isWindow, mapEntries, objectAssign, objectCrush, objectEntries, objectInvert, objectKeys, objectOmit, objectPick, objectValues, rowsToTree, stringInitialCase, stringReplace, stringTemplate, stringToJson, stringToNumber, stringToPosix, stringToValues, stringTrim, stringTruncate, to, toMathBignumber, toMathDecimal, toMathEvaluate, treeFilter, treeFind, treeForEach, treeMap, treeToRows };
3726
- //# sourceMappingURL=index.d.ts.map