@pawover/kit 0.0.0-beta.32 → 0.0.0-beta.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{enums-XkYDzrre.js → enums-BL6w5-mS.js} +50 -2
- package/dist/enums-BL6w5-mS.js.map +1 -0
- package/dist/enums.d.ts +2 -2
- package/dist/enums.js +2 -2
- package/dist/hooks-alova.d.ts +4 -4
- package/dist/hooks-react.d.ts +32 -30
- package/dist/hooks-react.d.ts.map +1 -1
- package/dist/hooks-react.js +53 -57
- package/dist/hooks-react.js.map +1 -1
- package/dist/{index-CCujFuKP.d.ts → index-Bn_PNnsM.d.ts} +52 -2
- package/dist/index-Bn_PNnsM.d.ts.map +1 -0
- package/dist/{index-BPEx210u.d.ts → index-DBPmnr4a.d.ts} +2 -2
- package/dist/index-DBPmnr4a.d.ts.map +1 -0
- package/dist/index.d.ts +1473 -1597
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/patches-fetchEventSource.d.ts +1 -1
- package/dist/patches-fetchEventSource.js +1 -1
- package/dist/{utils-RGh-N7TJ.js → utils-DbMbll5L.js} +193 -226
- package/dist/utils-DbMbll5L.js.map +1 -0
- package/dist/value-of-DUmTbnuw.d.ts +26 -0
- package/dist/value-of-DUmTbnuw.d.ts.map +1 -0
- package/metadata.json +13 -6
- package/package.json +13 -10
- package/dist/enums-XkYDzrre.js.map +0 -1
- package/dist/index-BPEx210u.d.ts.map +0 -1
- package/dist/index-CCujFuKP.d.ts.map +0 -1
- package/dist/utils-RGh-N7TJ.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { a as Simplify, c as Not, d as IsNever, f as OptionalKeysOf, i as HomomorphicPick, l as UnknownArray, m as UnionToIntersection, n as ApplyDefaultOptions, o as IfNotAnyOrNever, p as IsAny, r as CollapseLiterals, s as IsExactOptionalPropertyTypesEnabled, t as Except, u as If } from "./except-MacUK44u.js";
|
|
2
|
-
import {
|
|
2
|
+
import { t as ValueOf } from "./value-of-DUmTbnuw.js";
|
|
3
|
+
import { a as AnyObject, i as AnyGeneratorFunction, n as AnyAsyncGeneratorFunction, o as PlainObject, r as AnyFunction, s as TreeLike, t as AnyAsyncFunction } from "./index-DBPmnr4a.js";
|
|
4
|
+
import { clone, cloneDeep, cloneDeepWith } from "lodash-es";
|
|
3
5
|
import { BigNumber, MathExpression, MathJsInstance, Matrix } from "mathjs";
|
|
4
6
|
|
|
5
7
|
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/basic.d.ts
|
|
@@ -743,30 +745,6 @@ Except<BaseType, Keys> &
|
|
|
743
745
|
// Pick the keys that should be mutable from the base type and make them mutable.
|
|
744
746
|
Partial<HomomorphicPick<BaseType, Keys>>> : never;
|
|
745
747
|
//#endregion
|
|
746
|
-
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/value-of.d.ts
|
|
747
|
-
/**
|
|
748
|
-
Create a union of the given object's values, and optionally specify which keys to get the values from.
|
|
749
|
-
|
|
750
|
-
Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31438) if you want to have this type as a built-in in TypeScript.
|
|
751
|
-
|
|
752
|
-
@example
|
|
753
|
-
```
|
|
754
|
-
import type {ValueOf} from 'type-fest';
|
|
755
|
-
|
|
756
|
-
type A = ValueOf<{id: number; name: string; active: boolean}>;
|
|
757
|
-
//=> string | number | boolean
|
|
758
|
-
|
|
759
|
-
type B = ValueOf<{id: number; name: string; active: boolean}, 'name'>;
|
|
760
|
-
//=> string
|
|
761
|
-
|
|
762
|
-
type C = ValueOf<{id: number; name: string; active: boolean}, 'id' | 'name'>;
|
|
763
|
-
//=> string | number
|
|
764
|
-
```
|
|
765
|
-
|
|
766
|
-
@category Object
|
|
767
|
-
*/
|
|
768
|
-
type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
|
|
769
|
-
//#endregion
|
|
770
748
|
//#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/split.d.ts
|
|
771
749
|
/**
|
|
772
750
|
Split options.
|
|
@@ -927,1750 +905,1632 @@ declare function arrayCast<T>(candidate: T | T[] | null | undefined, checkEmpty?
|
|
|
927
905
|
*/
|
|
928
906
|
declare function arrayCompete<T>(initialList: readonly T[], match: (a: T, b: T, index: number) => T): T | null;
|
|
929
907
|
//#endregion
|
|
930
|
-
//#region
|
|
931
|
-
/**
|
|
932
|
-
* 统计数组的项目出现次数
|
|
933
|
-
* - 通过给定的标识符匹配函数,返回一个对象,其中键是回调函数返回的 key 值,每个值是一个整数,表示该 key 出现的次数
|
|
934
|
-
*
|
|
935
|
-
* @param initialList 初始数组
|
|
936
|
-
* @param match 匹配函数
|
|
937
|
-
* @returns 统计对象
|
|
938
|
-
* @example
|
|
939
|
-
* ```ts
|
|
940
|
-
* const list = ["a", "b", "a", "c"];
|
|
941
|
-
* arrayCounting(list, (x) => x); // { a: 2, b: 1, c: 1 }
|
|
942
|
-
*
|
|
943
|
-
* const users = [{ id: 1, group: "A" }, { id: 2, group: "B" }, { id: 3, group: "A" }];
|
|
944
|
-
* arrayCounting(users, (u) => u.group); // { A: 2, B: 1 }
|
|
945
|
-
* ```
|
|
946
|
-
*/
|
|
947
|
-
declare function arrayCounting<T, K$1 extends PropertyKey>(initialList: readonly T[], match: (row: T, index: number) => K$1): Record<string, number>;
|
|
948
|
-
//#endregion
|
|
949
|
-
//#region src/utils/array/arrayDifference.d.ts
|
|
950
|
-
/**
|
|
951
|
-
* 求数组差集
|
|
952
|
-
* - 返回在 `initialList` 中存在,但在 `diffList` 中不存在的元素
|
|
953
|
-
*
|
|
954
|
-
* @param initialList 初始数组
|
|
955
|
-
* @param diffList 对比数组
|
|
956
|
-
* @param match 匹配函数
|
|
957
|
-
* @returns 差集数组
|
|
958
|
-
* @example
|
|
959
|
-
* ```ts
|
|
960
|
-
* arrayDifference([1, 2, 3], [2, 3, 4]); // [1]
|
|
961
|
-
* arrayDifference([{ id: 1 }, { id: 2 }], [{ id: 2 }], (x) => x.id); // [{ id: 1 }]
|
|
962
|
-
* ```
|
|
963
|
-
*/
|
|
964
|
-
declare function arrayDifference<T>(initialList: readonly T[], diffList: readonly T[], match?: (row: T, index: number) => unknown): T[];
|
|
965
|
-
//#endregion
|
|
966
|
-
//#region src/utils/array/arrayFirst.d.ts
|
|
967
|
-
/**
|
|
968
|
-
* 获取数组第一项
|
|
969
|
-
*
|
|
970
|
-
* @param initialList 初始数组
|
|
971
|
-
* @param saveValue 安全值
|
|
972
|
-
* @returns 数组第一项,如果为空则返回安全值
|
|
973
|
-
* @example
|
|
974
|
-
* ```ts
|
|
975
|
-
* arrayFirst([1, 2]); // 1
|
|
976
|
-
* arrayFirst([], 0); // 0
|
|
977
|
-
* ```
|
|
978
|
-
*/
|
|
979
|
-
declare function arrayFirst<T>(initialList: readonly T[]): T | undefined;
|
|
980
|
-
declare function arrayFirst<T>(initialList: readonly T[], saveValue: T): T;
|
|
981
|
-
//#endregion
|
|
982
|
-
//#region src/utils/array/arrayFork.d.ts
|
|
983
|
-
/**
|
|
984
|
-
* 数组分组过滤
|
|
985
|
-
* - 给定一个数组和一个条件,返回一个由两个数组组成的元组,其中第一个数组包含所有满足条件的项,第二个数组包含所有不满足条件的项
|
|
986
|
-
*
|
|
987
|
-
* @param initialList 初始数组
|
|
988
|
-
* @param match 条件匹配函数
|
|
989
|
-
* @returns [满足条件的项[], 不满足条件的项[]]
|
|
990
|
-
* @example
|
|
991
|
-
* ```ts
|
|
992
|
-
* arrayFork([1, 2, 3, 4], (n) => n % 2 === 0); // [[2, 4], [1, 3]]
|
|
993
|
-
* ```
|
|
994
|
-
*/
|
|
995
|
-
declare function arrayFork<T>(initialList: readonly T[], match: (row: T, index: number) => boolean): [T[], T[]];
|
|
996
|
-
//#endregion
|
|
997
|
-
//#region src/utils/array/arrayIntersection.d.ts
|
|
998
|
-
/**
|
|
999
|
-
* 求数组交集
|
|
1000
|
-
* - 返回在 `initialList` 和 `diffList` 中都存在的元素
|
|
1001
|
-
*
|
|
1002
|
-
* @param initialList 初始数组
|
|
1003
|
-
* @param diffList 对比数组
|
|
1004
|
-
* @param match 匹配函数
|
|
1005
|
-
* @returns 交集数组
|
|
1006
|
-
* @example
|
|
1007
|
-
* ```ts
|
|
1008
|
-
* arrayIntersection([1, 2], [2, 3]); // [2]
|
|
1009
|
-
* arrayIntersection([{ id: 1 }, { id: 2 }], [{ id: 2 }], (x) => x.id); // [{ id: 2 }]
|
|
1010
|
-
* ```
|
|
1011
|
-
*/
|
|
1012
|
-
declare function arrayIntersection<T>(initialList: readonly T[], diffList: readonly T[], match?: (row: T, index: number) => unknown): T[];
|
|
1013
|
-
//#endregion
|
|
1014
|
-
//#region src/utils/array/arrayLast.d.ts
|
|
908
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/List.d.ts
|
|
1015
909
|
/**
|
|
1016
|
-
*
|
|
1017
|
-
*
|
|
1018
|
-
* @
|
|
1019
|
-
* @param saveValue 安全值
|
|
1020
|
-
* @returns 数组最后一项,如果为空则返回安全值
|
|
910
|
+
* A [[List]]
|
|
911
|
+
* @param A its type
|
|
912
|
+
* @returns [[List]]
|
|
1021
913
|
* @example
|
|
1022
914
|
* ```ts
|
|
1023
|
-
*
|
|
1024
|
-
*
|
|
915
|
+
* type list0 = [1, 2, 3]
|
|
916
|
+
* type list1 = number[]
|
|
1025
917
|
* ```
|
|
1026
918
|
*/
|
|
1027
|
-
declare
|
|
1028
|
-
declare function arrayLast<T>(initialList: readonly T[], saveValue: T): T;
|
|
919
|
+
declare type List<A$1 = any> = ReadonlyArray<A$1>;
|
|
1029
920
|
//#endregion
|
|
1030
|
-
//#region
|
|
921
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Any/Cast.d.ts
|
|
1031
922
|
/**
|
|
1032
|
-
*
|
|
1033
|
-
*
|
|
1034
|
-
*
|
|
1035
|
-
*
|
|
1036
|
-
* @param
|
|
1037
|
-
* @
|
|
1038
|
-
* @param match 匹配函数
|
|
1039
|
-
* @returns 合并后的数组
|
|
923
|
+
* Ask TS to re-check that `A1` extends `A2`.
|
|
924
|
+
* And if it fails, `A2` will be enforced anyway.
|
|
925
|
+
* Can also be used to add constraints on parameters.
|
|
926
|
+
* @param A1 to check against
|
|
927
|
+
* @param A2 to cast to
|
|
928
|
+
* @returns `A1 | A2`
|
|
1040
929
|
* @example
|
|
1041
930
|
* ```ts
|
|
1042
|
-
*
|
|
1043
|
-
* arrayMerge([1, 2], [2, 3]); // [1, 2, 3]
|
|
931
|
+
* import {A} from 'ts-toolbelt'
|
|
1044
932
|
*
|
|
1045
|
-
* //
|
|
1046
|
-
*
|
|
1047
|
-
* const update = [{ id: 2, val: "new" }, { id: 3, val: "c" }];
|
|
1048
|
-
* arrayMerge(source, update, (x) => x.id);
|
|
1049
|
-
* // [{ id: 1, val: "a" }, { id: 2, val: "new" }] -> id:3 被忽略
|
|
933
|
+
* type test0 = A.Cast<'42', string> // '42'
|
|
934
|
+
* type test1 = A.Cast<'42', number> // number
|
|
1050
935
|
* ```
|
|
1051
936
|
*/
|
|
1052
|
-
declare
|
|
937
|
+
declare type Cast<A1 extends any, A2 extends any> = A1 extends A2 ? A1 : A2;
|
|
1053
938
|
//#endregion
|
|
1054
|
-
//#region
|
|
939
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Any/Extends.d.ts
|
|
1055
940
|
/**
|
|
1056
|
-
*
|
|
1057
|
-
*
|
|
1058
|
-
*
|
|
1059
|
-
* @param
|
|
1060
|
-
* @
|
|
1061
|
-
* @param mapper map 函数
|
|
1062
|
-
* @returns 处理后的新数组
|
|
941
|
+
* Check whether `A1` is part of `A2` or not. The difference with
|
|
942
|
+
* `extends` is that it forces a [[Boolean]] return.
|
|
943
|
+
* @param A1
|
|
944
|
+
* @param A2
|
|
945
|
+
* @returns [[Boolean]]
|
|
1063
946
|
* @example
|
|
1064
947
|
* ```ts
|
|
1065
|
-
*
|
|
1066
|
-
* arrayPick(list, (n) => n % 2 === 0); // [2, 4]
|
|
1067
|
-
* arrayPick(list, (n) => n % 2 === 0, (n) => n * 2); // [4, 8]
|
|
1068
|
-
* ```
|
|
1069
|
-
*/
|
|
1070
|
-
declare function arrayPick<const T>(initialList: readonly T[], filter: (row: T, index: number) => boolean): T[];
|
|
1071
|
-
declare function arrayPick<const T, K$1 = T>(initialList: readonly T[], filter: (row: T, index: number) => boolean, mapper: ((row: T, index: number) => K$1)): K$1[];
|
|
1072
|
-
//#endregion
|
|
1073
|
-
//#region src/utils/array/arrayReplace.d.ts
|
|
1074
|
-
/**
|
|
1075
|
-
* 数组项替换
|
|
1076
|
-
* - 在给定的数组中,替换符合匹配函数结果的项目
|
|
1077
|
-
* - 只替换第一个匹配项
|
|
948
|
+
* import {A} from 'ts-toolbelt'
|
|
1078
949
|
*
|
|
1079
|
-
*
|
|
1080
|
-
*
|
|
1081
|
-
* @param match 匹配函数
|
|
1082
|
-
* @returns 替换后的新数组
|
|
1083
|
-
* @example
|
|
1084
|
-
* ```ts
|
|
1085
|
-
* arrayReplace([1, 2, 3], 4, (n) => n === 2); // [1, 4, 3]
|
|
1086
|
-
* ```
|
|
1087
|
-
*/
|
|
1088
|
-
declare function arrayReplace<const T>(initialList: readonly T[], newItem: T, match: (row: T, index: number) => boolean): T[];
|
|
1089
|
-
//#endregion
|
|
1090
|
-
//#region src/utils/array/arrayReplaceMove.d.ts
|
|
1091
|
-
type PositionType = "start" | "end" | number;
|
|
1092
|
-
/**
|
|
1093
|
-
* 数组项替换并移动
|
|
1094
|
-
* - 在给定的数组中,替换并移动符合匹配函数结果的项目
|
|
1095
|
-
* - 只替换和移动第一个匹配项
|
|
1096
|
-
* - 未匹配时,根据 `position` 在指定位置插入 `newItem`
|
|
950
|
+
* type test0 = A.Extends<'a' | 'b', 'b'> // Boolean
|
|
951
|
+
* type test1 = A.Extends<'a', 'a' | 'b'> // True
|
|
1097
952
|
*
|
|
1098
|
-
*
|
|
1099
|
-
*
|
|
1100
|
-
* @param match 匹配函数
|
|
1101
|
-
* @param position 移动位置,可选 `start` | `end` | 索引位置, 默认为 `end`
|
|
1102
|
-
* @returns
|
|
1103
|
-
* @example
|
|
1104
|
-
* ```ts
|
|
1105
|
-
* arrayReplaceMove([1, 2, 3, 4], 5, (n) => n === 2, 0); // [5, 1, 3, 4]
|
|
1106
|
-
* arrayReplaceMove([1, 2, 3, 4], 5, (n) => n === 2, 2); // [1, 3, 5, 4]
|
|
1107
|
-
* arrayReplaceMove([1, 2, 3, 4], 5, (n) => n === 2, "start"); // [5, 1, 3, 4]
|
|
1108
|
-
* arrayReplaceMove([1, 2, 3, 4], 5, (n) => n === 2); // [1, 3, 4, 5]
|
|
1109
|
-
* ```
|
|
1110
|
-
*/
|
|
1111
|
-
declare function arrayReplaceMove<const T>(initialList: readonly T[], newItem: T, match: (row: T, index: number) => boolean, position?: PositionType): T[];
|
|
1112
|
-
//#endregion
|
|
1113
|
-
//#region src/utils/array/arraySplit.d.ts
|
|
1114
|
-
/**
|
|
1115
|
-
* 数组切分
|
|
1116
|
-
* - 将数组以指定的长度切分后,组合在高维数组中
|
|
953
|
+
* type test2 = A.Extends<{a: string}, {a: any}> // True
|
|
954
|
+
* type test3 = A.Extends<{a: any}, {a: any, b: any}> // False
|
|
1117
955
|
*
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1120
|
-
* @returns 切分后的二维数组
|
|
1121
|
-
* @example
|
|
1122
|
-
* ```ts
|
|
1123
|
-
* arraySplit([1, 2, 3, 4, 5], 2); // [[1, 2], [3, 4], [5]]
|
|
956
|
+
* type test4 = A.Extends<never, never> // False
|
|
957
|
+
* /// Nothing cannot extend nothing, use `A.Equals`
|
|
1124
958
|
* ```
|
|
1125
959
|
*/
|
|
1126
|
-
declare
|
|
960
|
+
declare type Extends<A1 extends any, A2 extends any> = [A1] extends [never] ? 0 : A1 extends A2 ? 1 : 0;
|
|
1127
961
|
//#endregion
|
|
1128
|
-
//#region
|
|
1129
|
-
/**
|
|
1130
|
-
* 数组解压
|
|
1131
|
-
* - `arrayZip` 的反向操作
|
|
1132
|
-
*
|
|
1133
|
-
* @param arrays 压缩后的数组
|
|
1134
|
-
* @returns 解压后的二维数组
|
|
1135
|
-
* @example
|
|
1136
|
-
* ```ts
|
|
1137
|
-
* arrayUnzip([[1, "a"], [2, "b"]]); // [[1, 2], ["a", "b"]]
|
|
1138
|
-
* ```
|
|
1139
|
-
*/
|
|
1140
|
-
declare function arrayUnzip<T>(arrays: readonly (readonly T[])[]): T[][];
|
|
962
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Iteration/Iteration.d.ts
|
|
1141
963
|
/**
|
|
1142
|
-
*
|
|
1143
|
-
* - 将多个数组的元素按索引组合成元组
|
|
1144
|
-
*
|
|
1145
|
-
* @param arrays 多个数组
|
|
1146
|
-
* @returns 压缩后的元组数组
|
|
1147
|
-
* @example
|
|
1148
|
-
* ```ts
|
|
1149
|
-
* arrayZip([1, 2], ["a", "b"]); // [[1, "a"], [2, "b"]]
|
|
1150
|
-
* ```
|
|
964
|
+
* An entry of `IterationMap`
|
|
1151
965
|
*/
|
|
1152
|
-
declare
|
|
1153
|
-
declare
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
966
|
+
declare type Iteration = [value: number, sign: '-' | '0' | '+', prev: keyof IterationMap, next: keyof IterationMap, oppo: keyof IterationMap];
|
|
967
|
+
declare type IterationMap = {
|
|
968
|
+
'__': [number, '-' | '0' | '+', '__', '__', '__'];
|
|
969
|
+
'-100': [-100, '-', '__', '-99', '100'];
|
|
970
|
+
'-99': [-99, '-', '-100', '-98', '99'];
|
|
971
|
+
'-98': [-98, '-', '-99', '-97', '98'];
|
|
972
|
+
'-97': [-97, '-', '-98', '-96', '97'];
|
|
973
|
+
'-96': [-96, '-', '-97', '-95', '96'];
|
|
974
|
+
'-95': [-95, '-', '-96', '-94', '95'];
|
|
975
|
+
'-94': [-94, '-', '-95', '-93', '94'];
|
|
976
|
+
'-93': [-93, '-', '-94', '-92', '93'];
|
|
977
|
+
'-92': [-92, '-', '-93', '-91', '92'];
|
|
978
|
+
'-91': [-91, '-', '-92', '-90', '91'];
|
|
979
|
+
'-90': [-90, '-', '-91', '-89', '90'];
|
|
980
|
+
'-89': [-89, '-', '-90', '-88', '89'];
|
|
981
|
+
'-88': [-88, '-', '-89', '-87', '88'];
|
|
982
|
+
'-87': [-87, '-', '-88', '-86', '87'];
|
|
983
|
+
'-86': [-86, '-', '-87', '-85', '86'];
|
|
984
|
+
'-85': [-85, '-', '-86', '-84', '85'];
|
|
985
|
+
'-84': [-84, '-', '-85', '-83', '84'];
|
|
986
|
+
'-83': [-83, '-', '-84', '-82', '83'];
|
|
987
|
+
'-82': [-82, '-', '-83', '-81', '82'];
|
|
988
|
+
'-81': [-81, '-', '-82', '-80', '81'];
|
|
989
|
+
'-80': [-80, '-', '-81', '-79', '80'];
|
|
990
|
+
'-79': [-79, '-', '-80', '-78', '79'];
|
|
991
|
+
'-78': [-78, '-', '-79', '-77', '78'];
|
|
992
|
+
'-77': [-77, '-', '-78', '-76', '77'];
|
|
993
|
+
'-76': [-76, '-', '-77', '-75', '76'];
|
|
994
|
+
'-75': [-75, '-', '-76', '-74', '75'];
|
|
995
|
+
'-74': [-74, '-', '-75', '-73', '74'];
|
|
996
|
+
'-73': [-73, '-', '-74', '-72', '73'];
|
|
997
|
+
'-72': [-72, '-', '-73', '-71', '72'];
|
|
998
|
+
'-71': [-71, '-', '-72', '-70', '71'];
|
|
999
|
+
'-70': [-70, '-', '-71', '-69', '70'];
|
|
1000
|
+
'-69': [-69, '-', '-70', '-68', '69'];
|
|
1001
|
+
'-68': [-68, '-', '-69', '-67', '68'];
|
|
1002
|
+
'-67': [-67, '-', '-68', '-66', '67'];
|
|
1003
|
+
'-66': [-66, '-', '-67', '-65', '66'];
|
|
1004
|
+
'-65': [-65, '-', '-66', '-64', '65'];
|
|
1005
|
+
'-64': [-64, '-', '-65', '-63', '64'];
|
|
1006
|
+
'-63': [-63, '-', '-64', '-62', '63'];
|
|
1007
|
+
'-62': [-62, '-', '-63', '-61', '62'];
|
|
1008
|
+
'-61': [-61, '-', '-62', '-60', '61'];
|
|
1009
|
+
'-60': [-60, '-', '-61', '-59', '60'];
|
|
1010
|
+
'-59': [-59, '-', '-60', '-58', '59'];
|
|
1011
|
+
'-58': [-58, '-', '-59', '-57', '58'];
|
|
1012
|
+
'-57': [-57, '-', '-58', '-56', '57'];
|
|
1013
|
+
'-56': [-56, '-', '-57', '-55', '56'];
|
|
1014
|
+
'-55': [-55, '-', '-56', '-54', '55'];
|
|
1015
|
+
'-54': [-54, '-', '-55', '-53', '54'];
|
|
1016
|
+
'-53': [-53, '-', '-54', '-52', '53'];
|
|
1017
|
+
'-52': [-52, '-', '-53', '-51', '52'];
|
|
1018
|
+
'-51': [-51, '-', '-52', '-50', '51'];
|
|
1019
|
+
'-50': [-50, '-', '-51', '-49', '50'];
|
|
1020
|
+
'-49': [-49, '-', '-50', '-48', '49'];
|
|
1021
|
+
'-48': [-48, '-', '-49', '-47', '48'];
|
|
1022
|
+
'-47': [-47, '-', '-48', '-46', '47'];
|
|
1023
|
+
'-46': [-46, '-', '-47', '-45', '46'];
|
|
1024
|
+
'-45': [-45, '-', '-46', '-44', '45'];
|
|
1025
|
+
'-44': [-44, '-', '-45', '-43', '44'];
|
|
1026
|
+
'-43': [-43, '-', '-44', '-42', '43'];
|
|
1027
|
+
'-42': [-42, '-', '-43', '-41', '42'];
|
|
1028
|
+
'-41': [-41, '-', '-42', '-40', '41'];
|
|
1029
|
+
'-40': [-40, '-', '-41', '-39', '40'];
|
|
1030
|
+
'-39': [-39, '-', '-40', '-38', '39'];
|
|
1031
|
+
'-38': [-38, '-', '-39', '-37', '38'];
|
|
1032
|
+
'-37': [-37, '-', '-38', '-36', '37'];
|
|
1033
|
+
'-36': [-36, '-', '-37', '-35', '36'];
|
|
1034
|
+
'-35': [-35, '-', '-36', '-34', '35'];
|
|
1035
|
+
'-34': [-34, '-', '-35', '-33', '34'];
|
|
1036
|
+
'-33': [-33, '-', '-34', '-32', '33'];
|
|
1037
|
+
'-32': [-32, '-', '-33', '-31', '32'];
|
|
1038
|
+
'-31': [-31, '-', '-32', '-30', '31'];
|
|
1039
|
+
'-30': [-30, '-', '-31', '-29', '30'];
|
|
1040
|
+
'-29': [-29, '-', '-30', '-28', '29'];
|
|
1041
|
+
'-28': [-28, '-', '-29', '-27', '28'];
|
|
1042
|
+
'-27': [-27, '-', '-28', '-26', '27'];
|
|
1043
|
+
'-26': [-26, '-', '-27', '-25', '26'];
|
|
1044
|
+
'-25': [-25, '-', '-26', '-24', '25'];
|
|
1045
|
+
'-24': [-24, '-', '-25', '-23', '24'];
|
|
1046
|
+
'-23': [-23, '-', '-24', '-22', '23'];
|
|
1047
|
+
'-22': [-22, '-', '-23', '-21', '22'];
|
|
1048
|
+
'-21': [-21, '-', '-22', '-20', '21'];
|
|
1049
|
+
'-20': [-20, '-', '-21', '-19', '20'];
|
|
1050
|
+
'-19': [-19, '-', '-20', '-18', '19'];
|
|
1051
|
+
'-18': [-18, '-', '-19', '-17', '18'];
|
|
1052
|
+
'-17': [-17, '-', '-18', '-16', '17'];
|
|
1053
|
+
'-16': [-16, '-', '-17', '-15', '16'];
|
|
1054
|
+
'-15': [-15, '-', '-16', '-14', '15'];
|
|
1055
|
+
'-14': [-14, '-', '-15', '-13', '14'];
|
|
1056
|
+
'-13': [-13, '-', '-14', '-12', '13'];
|
|
1057
|
+
'-12': [-12, '-', '-13', '-11', '12'];
|
|
1058
|
+
'-11': [-11, '-', '-12', '-10', '11'];
|
|
1059
|
+
'-10': [-10, '-', '-11', '-9', '10'];
|
|
1060
|
+
'-9': [-9, '-', '-10', '-8', '9'];
|
|
1061
|
+
'-8': [-8, '-', '-9', '-7', '8'];
|
|
1062
|
+
'-7': [-7, '-', '-8', '-6', '7'];
|
|
1063
|
+
'-6': [-6, '-', '-7', '-5', '6'];
|
|
1064
|
+
'-5': [-5, '-', '-6', '-4', '5'];
|
|
1065
|
+
'-4': [-4, '-', '-5', '-3', '4'];
|
|
1066
|
+
'-3': [-3, '-', '-4', '-2', '3'];
|
|
1067
|
+
'-2': [-2, '-', '-3', '-1', '2'];
|
|
1068
|
+
'-1': [-1, '-', '-2', '0', '1'];
|
|
1069
|
+
'0': [0, '0', '-1', '1', '0'];
|
|
1070
|
+
'1': [1, '+', '0', '2', '-1'];
|
|
1071
|
+
'2': [2, '+', '1', '3', '-2'];
|
|
1072
|
+
'3': [3, '+', '2', '4', '-3'];
|
|
1073
|
+
'4': [4, '+', '3', '5', '-4'];
|
|
1074
|
+
'5': [5, '+', '4', '6', '-5'];
|
|
1075
|
+
'6': [6, '+', '5', '7', '-6'];
|
|
1076
|
+
'7': [7, '+', '6', '8', '-7'];
|
|
1077
|
+
'8': [8, '+', '7', '9', '-8'];
|
|
1078
|
+
'9': [9, '+', '8', '10', '-9'];
|
|
1079
|
+
'10': [10, '+', '9', '11', '-10'];
|
|
1080
|
+
'11': [11, '+', '10', '12', '-11'];
|
|
1081
|
+
'12': [12, '+', '11', '13', '-12'];
|
|
1082
|
+
'13': [13, '+', '12', '14', '-13'];
|
|
1083
|
+
'14': [14, '+', '13', '15', '-14'];
|
|
1084
|
+
'15': [15, '+', '14', '16', '-15'];
|
|
1085
|
+
'16': [16, '+', '15', '17', '-16'];
|
|
1086
|
+
'17': [17, '+', '16', '18', '-17'];
|
|
1087
|
+
'18': [18, '+', '17', '19', '-18'];
|
|
1088
|
+
'19': [19, '+', '18', '20', '-19'];
|
|
1089
|
+
'20': [20, '+', '19', '21', '-20'];
|
|
1090
|
+
'21': [21, '+', '20', '22', '-21'];
|
|
1091
|
+
'22': [22, '+', '21', '23', '-22'];
|
|
1092
|
+
'23': [23, '+', '22', '24', '-23'];
|
|
1093
|
+
'24': [24, '+', '23', '25', '-24'];
|
|
1094
|
+
'25': [25, '+', '24', '26', '-25'];
|
|
1095
|
+
'26': [26, '+', '25', '27', '-26'];
|
|
1096
|
+
'27': [27, '+', '26', '28', '-27'];
|
|
1097
|
+
'28': [28, '+', '27', '29', '-28'];
|
|
1098
|
+
'29': [29, '+', '28', '30', '-29'];
|
|
1099
|
+
'30': [30, '+', '29', '31', '-30'];
|
|
1100
|
+
'31': [31, '+', '30', '32', '-31'];
|
|
1101
|
+
'32': [32, '+', '31', '33', '-32'];
|
|
1102
|
+
'33': [33, '+', '32', '34', '-33'];
|
|
1103
|
+
'34': [34, '+', '33', '35', '-34'];
|
|
1104
|
+
'35': [35, '+', '34', '36', '-35'];
|
|
1105
|
+
'36': [36, '+', '35', '37', '-36'];
|
|
1106
|
+
'37': [37, '+', '36', '38', '-37'];
|
|
1107
|
+
'38': [38, '+', '37', '39', '-38'];
|
|
1108
|
+
'39': [39, '+', '38', '40', '-39'];
|
|
1109
|
+
'40': [40, '+', '39', '41', '-40'];
|
|
1110
|
+
'41': [41, '+', '40', '42', '-41'];
|
|
1111
|
+
'42': [42, '+', '41', '43', '-42'];
|
|
1112
|
+
'43': [43, '+', '42', '44', '-43'];
|
|
1113
|
+
'44': [44, '+', '43', '45', '-44'];
|
|
1114
|
+
'45': [45, '+', '44', '46', '-45'];
|
|
1115
|
+
'46': [46, '+', '45', '47', '-46'];
|
|
1116
|
+
'47': [47, '+', '46', '48', '-47'];
|
|
1117
|
+
'48': [48, '+', '47', '49', '-48'];
|
|
1118
|
+
'49': [49, '+', '48', '50', '-49'];
|
|
1119
|
+
'50': [50, '+', '49', '51', '-50'];
|
|
1120
|
+
'51': [51, '+', '50', '52', '-51'];
|
|
1121
|
+
'52': [52, '+', '51', '53', '-52'];
|
|
1122
|
+
'53': [53, '+', '52', '54', '-53'];
|
|
1123
|
+
'54': [54, '+', '53', '55', '-54'];
|
|
1124
|
+
'55': [55, '+', '54', '56', '-55'];
|
|
1125
|
+
'56': [56, '+', '55', '57', '-56'];
|
|
1126
|
+
'57': [57, '+', '56', '58', '-57'];
|
|
1127
|
+
'58': [58, '+', '57', '59', '-58'];
|
|
1128
|
+
'59': [59, '+', '58', '60', '-59'];
|
|
1129
|
+
'60': [60, '+', '59', '61', '-60'];
|
|
1130
|
+
'61': [61, '+', '60', '62', '-61'];
|
|
1131
|
+
'62': [62, '+', '61', '63', '-62'];
|
|
1132
|
+
'63': [63, '+', '62', '64', '-63'];
|
|
1133
|
+
'64': [64, '+', '63', '65', '-64'];
|
|
1134
|
+
'65': [65, '+', '64', '66', '-65'];
|
|
1135
|
+
'66': [66, '+', '65', '67', '-66'];
|
|
1136
|
+
'67': [67, '+', '66', '68', '-67'];
|
|
1137
|
+
'68': [68, '+', '67', '69', '-68'];
|
|
1138
|
+
'69': [69, '+', '68', '70', '-69'];
|
|
1139
|
+
'70': [70, '+', '69', '71', '-70'];
|
|
1140
|
+
'71': [71, '+', '70', '72', '-71'];
|
|
1141
|
+
'72': [72, '+', '71', '73', '-72'];
|
|
1142
|
+
'73': [73, '+', '72', '74', '-73'];
|
|
1143
|
+
'74': [74, '+', '73', '75', '-74'];
|
|
1144
|
+
'75': [75, '+', '74', '76', '-75'];
|
|
1145
|
+
'76': [76, '+', '75', '77', '-76'];
|
|
1146
|
+
'77': [77, '+', '76', '78', '-77'];
|
|
1147
|
+
'78': [78, '+', '77', '79', '-78'];
|
|
1148
|
+
'79': [79, '+', '78', '80', '-79'];
|
|
1149
|
+
'80': [80, '+', '79', '81', '-80'];
|
|
1150
|
+
'81': [81, '+', '80', '82', '-81'];
|
|
1151
|
+
'82': [82, '+', '81', '83', '-82'];
|
|
1152
|
+
'83': [83, '+', '82', '84', '-83'];
|
|
1153
|
+
'84': [84, '+', '83', '85', '-84'];
|
|
1154
|
+
'85': [85, '+', '84', '86', '-85'];
|
|
1155
|
+
'86': [86, '+', '85', '87', '-86'];
|
|
1156
|
+
'87': [87, '+', '86', '88', '-87'];
|
|
1157
|
+
'88': [88, '+', '87', '89', '-88'];
|
|
1158
|
+
'89': [89, '+', '88', '90', '-89'];
|
|
1159
|
+
'90': [90, '+', '89', '91', '-90'];
|
|
1160
|
+
'91': [91, '+', '90', '92', '-91'];
|
|
1161
|
+
'92': [92, '+', '91', '93', '-92'];
|
|
1162
|
+
'93': [93, '+', '92', '94', '-93'];
|
|
1163
|
+
'94': [94, '+', '93', '95', '-94'];
|
|
1164
|
+
'95': [95, '+', '94', '96', '-95'];
|
|
1165
|
+
'96': [96, '+', '95', '97', '-96'];
|
|
1166
|
+
'97': [97, '+', '96', '98', '-97'];
|
|
1167
|
+
'98': [98, '+', '97', '99', '-98'];
|
|
1168
|
+
'99': [99, '+', '98', '100', '-99'];
|
|
1169
|
+
'100': [100, '+', '99', '__', '-100'];
|
|
1170
|
+
};
|
|
1180
1171
|
//#endregion
|
|
1181
|
-
//#region
|
|
1172
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Iteration/Prev.d.ts
|
|
1182
1173
|
/**
|
|
1183
|
-
*
|
|
1184
|
-
*
|
|
1185
|
-
* @
|
|
1186
|
-
* @param dpi - 标准 DPI 基准(默认 160)
|
|
1187
|
-
* @returns 是否为移动设备
|
|
1174
|
+
* Move `I`'s position backwards
|
|
1175
|
+
* @param I to move
|
|
1176
|
+
* @returns [[Iteration]]
|
|
1188
1177
|
* @example
|
|
1189
1178
|
* ```ts
|
|
1190
|
-
*
|
|
1191
|
-
* isMobile(); // true
|
|
1192
|
-
* ```
|
|
1193
|
-
*/
|
|
1194
|
-
declare function isMobile(maxWidth?: number, dpi?: number): boolean;
|
|
1195
|
-
/**
|
|
1196
|
-
* 检测当前设备是否为IOS移动设备
|
|
1179
|
+
* import {I} from 'ts-toolbelt'
|
|
1197
1180
|
*
|
|
1198
|
-
*
|
|
1199
|
-
*
|
|
1200
|
-
*
|
|
1201
|
-
*
|
|
1202
|
-
* ```ts
|
|
1203
|
-
* // UA contains iPhone
|
|
1204
|
-
* isIOSMobile(); // true
|
|
1181
|
+
* type i = I.IterationOf<'20'>
|
|
1182
|
+
*
|
|
1183
|
+
* type test0 = I.Pos<i> // 20
|
|
1184
|
+
* type test1 = I.Pos<I.Prev<i>> // 19
|
|
1205
1185
|
* ```
|
|
1206
1186
|
*/
|
|
1207
|
-
declare
|
|
1187
|
+
declare type Prev<I$1 extends Iteration> = IterationMap[I$1[2]];
|
|
1208
1188
|
//#endregion
|
|
1209
|
-
//#region
|
|
1189
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Iteration/IterationOf.d.ts
|
|
1210
1190
|
/**
|
|
1211
|
-
*
|
|
1191
|
+
* Transform a number into an [[Iteration]]
|
|
1192
|
+
* (to use [[Prev]], [[Next]], & [[Pos]])
|
|
1193
|
+
* @param N to transform
|
|
1194
|
+
* @returns [[Iteration]]
|
|
1195
|
+
* @example
|
|
1196
|
+
* ```ts
|
|
1197
|
+
* import {I} from 'ts-toolbelt'
|
|
1212
1198
|
*
|
|
1213
|
-
*
|
|
1214
|
-
*
|
|
1215
|
-
*
|
|
1216
|
-
*
|
|
1199
|
+
* type i = I.IterationOf<0> // ["-1", "1", "0", 0, "0"]
|
|
1200
|
+
*
|
|
1201
|
+
* type next = I.Next<i> // ["0", "2", "1", 1, "+"]
|
|
1202
|
+
* type prev = I.Prev<i> // ["-2", "0", "-1", -1, "-"]
|
|
1203
|
+
*
|
|
1204
|
+
* type nnext = I.Pos<next> // +1
|
|
1205
|
+
* type nprev = I.Pos<prev> // -1
|
|
1206
|
+
* ```
|
|
1207
|
+
*/
|
|
1208
|
+
declare type IterationOf<N extends number> = `${N}` extends keyof IterationMap ? IterationMap[`${N}`] : IterationMap['__'];
|
|
1209
|
+
//#endregion
|
|
1210
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Iteration/Pos.d.ts
|
|
1211
|
+
/**
|
|
1212
|
+
* Get the position of `I` (**number**)
|
|
1213
|
+
* @param I to query
|
|
1214
|
+
* @returns `number`
|
|
1217
1215
|
* @example
|
|
1218
1216
|
* ```ts
|
|
1219
|
-
*
|
|
1220
|
-
*
|
|
1217
|
+
* import {I} from 'ts-toolbelt'
|
|
1218
|
+
*
|
|
1219
|
+
* type i = I.IterationOf<'20'>
|
|
1220
|
+
*
|
|
1221
|
+
* type test0 = I.Pos<i> // 20
|
|
1222
|
+
* type test1 = I.Pos<I.Next<i>> // 21
|
|
1221
1223
|
* ```
|
|
1222
1224
|
*/
|
|
1223
|
-
declare
|
|
1225
|
+
declare type Pos<I$1 extends Iteration> = I$1[0];
|
|
1224
1226
|
//#endregion
|
|
1225
|
-
//#region
|
|
1227
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Tail.d.ts
|
|
1226
1228
|
/**
|
|
1227
|
-
|
|
1228
|
-
*
|
|
1229
|
-
* @
|
|
1230
|
-
* @param errorExt 附加到 error 对象的扩展信息(注意:如果原 error 是 Error 实例,扩展属性可能会覆盖或无法正确合并非枚举属性)
|
|
1231
|
-
* @returns `[err, null]` 或 `[null, data]`
|
|
1229
|
+
* Remove the first item out of a [[List]]
|
|
1230
|
+
* @param L
|
|
1231
|
+
* @returns [[List]]
|
|
1232
1232
|
* @example
|
|
1233
1233
|
* ```ts
|
|
1234
|
-
* const [err, data] = await to(someAsyncFunc());
|
|
1235
|
-
* if (err) return;
|
|
1236
|
-
* console.log(data);
|
|
1237
1234
|
* ```
|
|
1238
1235
|
*/
|
|
1239
|
-
declare
|
|
1236
|
+
declare type Tail$1<L extends List> = L extends readonly [] ? L : L extends readonly [any?, ...infer LTail] ? LTail : L;
|
|
1240
1237
|
//#endregion
|
|
1241
|
-
//#region
|
|
1238
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Object/Overwrite.d.ts
|
|
1242
1239
|
/**
|
|
1243
|
-
*
|
|
1244
|
-
*
|
|
1245
|
-
* @param
|
|
1246
|
-
* @param
|
|
1247
|
-
* @
|
|
1248
|
-
* @returns 转换后的 BigNumber
|
|
1240
|
+
* Update the fields of `O` with the ones of `O1`
|
|
1241
|
+
* (only the existing fields will be updated)
|
|
1242
|
+
* @param O to update
|
|
1243
|
+
* @param O1 to update with
|
|
1244
|
+
* @returns [[Object]]
|
|
1249
1245
|
* @example
|
|
1250
1246
|
* ```ts
|
|
1251
|
-
* import { create, all } from "mathjs";
|
|
1252
|
-
* const math = create(all);
|
|
1253
|
-
* toMathBignumber(math, "0.1");
|
|
1254
1247
|
* ```
|
|
1255
1248
|
*/
|
|
1256
|
-
declare
|
|
1249
|
+
declare type Overwrite<O extends object, O1 extends object> = { [K in keyof O]: K extends keyof O1 ? O1[K] : O[K] } & {};
|
|
1257
1250
|
//#endregion
|
|
1258
|
-
//#region
|
|
1251
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/_Internal.d.ts
|
|
1259
1252
|
/**
|
|
1260
|
-
*
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
*
|
|
1253
|
+
* Remove `?` & `readonly` from a [[List]]
|
|
1254
|
+
*/
|
|
1255
|
+
declare type Naked<L extends List> = Overwrite<Required<L>, L>;
|
|
1256
|
+
//#endregion
|
|
1257
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Prepend.d.ts
|
|
1258
|
+
/**
|
|
1259
|
+
* Add an element `A` at the beginning of `L`
|
|
1260
|
+
* @param L to append to
|
|
1261
|
+
* @param A to be added to
|
|
1262
|
+
* @returns [[List]]
|
|
1267
1263
|
* @example
|
|
1268
1264
|
* ```ts
|
|
1269
|
-
* toMathDecimal(math, 0.12345, 2); // "0.12"
|
|
1270
1265
|
* ```
|
|
1271
1266
|
*/
|
|
1272
|
-
declare
|
|
1273
|
-
|
|
1267
|
+
declare type Prepend<L extends List, A$1 extends any> = [A$1, ...L];
|
|
1268
|
+
//#endregion
|
|
1269
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Iteration/_Internal.d.ts
|
|
1270
|
+
/**
|
|
1271
|
+
* Describes how to perform iterations
|
|
1272
|
+
*/
|
|
1273
|
+
declare type Way = '->' | '<-';
|
|
1274
1274
|
//#endregion
|
|
1275
|
-
//#region
|
|
1275
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Append.d.ts
|
|
1276
1276
|
/**
|
|
1277
|
-
*
|
|
1278
|
-
*
|
|
1279
|
-
* @param
|
|
1280
|
-
* @
|
|
1281
|
-
* @param scope 键值映射
|
|
1282
|
-
* @returns 计算结果的字符串表示
|
|
1277
|
+
* Add an element `A` at the end of `L`.
|
|
1278
|
+
* @param L to append to
|
|
1279
|
+
* @param A to be added to
|
|
1280
|
+
* @returns [[List]]
|
|
1283
1281
|
* @example
|
|
1284
1282
|
* ```ts
|
|
1285
|
-
*
|
|
1283
|
+
* import {L} from 'ts-toolbelt'
|
|
1284
|
+
*
|
|
1285
|
+
* type test0 = L.Append<[1, 2, 3], 4> // [1, 2, 3, 4]
|
|
1286
|
+
* type test1 = L.Append<[], 'a'> // ['a']
|
|
1287
|
+
* type test2 = L.Append<readonly ['a', 'b'], 'c'> // ['a', 'b', 'c']
|
|
1288
|
+
* type test3 = L.Append<[1, 2], [3, 4]> // [1, 2, [3, 4]]
|
|
1286
1289
|
* ```
|
|
1287
1290
|
*/
|
|
1288
|
-
declare
|
|
1291
|
+
declare type Append<L extends List, A$1 extends any> = [...L, A$1];
|
|
1289
1292
|
//#endregion
|
|
1290
|
-
//#region
|
|
1293
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Drop.d.ts
|
|
1291
1294
|
/**
|
|
1292
|
-
*
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1295
|
+
* @hidden
|
|
1296
|
+
*/
|
|
1297
|
+
declare type DropForth<L extends List, N extends Iteration> = {
|
|
1298
|
+
0: DropForth<Tail$1<L>, Prev<N>>;
|
|
1299
|
+
1: L;
|
|
1300
|
+
}[Extends<0, Pos<N>>];
|
|
1301
|
+
/**
|
|
1302
|
+
* @hidden
|
|
1303
|
+
*/
|
|
1304
|
+
declare type DropBack<L extends List, N extends Iteration, I$1 extends Iteration = Prev<N>, LN extends List = []> = {
|
|
1305
|
+
0: DropBack<L, N, Prev<I$1>, Prepend<LN, L[Pos<I$1>]>>;
|
|
1306
|
+
1: LN;
|
|
1307
|
+
}[Extends<-1, Pos<I$1>>];
|
|
1308
|
+
/**
|
|
1309
|
+
* @hidden
|
|
1310
|
+
*/
|
|
1311
|
+
declare type __Drop<L extends List, N extends Iteration, way extends Way> = {
|
|
1312
|
+
'->': DropForth<L, N>;
|
|
1313
|
+
'<-': DropBack<L, N>;
|
|
1314
|
+
}[way];
|
|
1315
|
+
/**
|
|
1316
|
+
* @hidden
|
|
1317
|
+
*/
|
|
1318
|
+
declare type _Drop<L extends List, N extends number, way extends Way = '->'> = __Drop<Naked<L>, IterationOf<N>, way> extends infer X ? Cast<X, List> : never;
|
|
1319
|
+
/**
|
|
1320
|
+
* Remove `N` entries out of `L`
|
|
1321
|
+
* @param L to remove from
|
|
1322
|
+
* @param N to remove out
|
|
1323
|
+
* @param way (?=`'->'`) from front: '->', from end: '<-'
|
|
1324
|
+
* @returns [[List]]
|
|
1299
1325
|
* @example
|
|
1300
1326
|
* ```ts
|
|
1301
|
-
* isWithinInterval(5, [1, 10]); // true
|
|
1302
|
-
* isWithinInterval(1, [1, 10], false); // false
|
|
1303
1327
|
* ```
|
|
1304
1328
|
*/
|
|
1305
|
-
declare
|
|
1329
|
+
declare type Drop<L extends List, N extends number, way extends Way = '->'> = L extends unknown ? N extends unknown ? _Drop<L, N, way> : never : never;
|
|
1306
1330
|
//#endregion
|
|
1307
|
-
//#region
|
|
1308
|
-
interface CloningStrategy {
|
|
1309
|
-
cloneMap: typeof cloneMap;
|
|
1310
|
-
cloneSet: typeof cloneSet;
|
|
1311
|
-
cloneDate: typeof cloneDate;
|
|
1312
|
-
cloneArray: typeof cloneArray;
|
|
1313
|
-
cloneObject: typeof cloneObject;
|
|
1314
|
-
cloneOther: typeof cloneOther;
|
|
1315
|
-
}
|
|
1316
|
-
declare function cloneMap<K$1, V$1>(input: 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>;
|
|
1317
|
-
declare function cloneSet<T>(input: Set<T>, track: (newParent: Set<T>) => Set<T>, clone: <T>(value: T) => T): Set<T>;
|
|
1318
|
-
declare function cloneDate(input: Date, track: (newParent: Date) => Date): Date;
|
|
1319
|
-
declare function cloneArray<T>(input: readonly T[], track: (newParent: T[]) => T[], clone: <T>(value: T) => T): T[];
|
|
1320
|
-
declare function cloneObject<T extends AnyObject>(input: T, track: (newParent: T) => T, clone: <T>(value: T) => T): T;
|
|
1321
|
-
declare function cloneOther<T>(input: T, track: (newParent: T) => T): T;
|
|
1331
|
+
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Take.d.ts
|
|
1322
1332
|
/**
|
|
1323
|
-
*
|
|
1324
|
-
*
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1333
|
+
* starts in reverse from `N` till `N` = 0
|
|
1334
|
+
* @hidden
|
|
1335
|
+
*/
|
|
1336
|
+
declare type TakeForth<L extends List, N extends Iteration, I$1 extends Iteration = Prev<N>, LN extends List = []> = {
|
|
1337
|
+
0: TakeForth<L, N, Prev<I$1>, Prepend<LN, L[Pos<I$1>]>>;
|
|
1338
|
+
1: LN;
|
|
1339
|
+
}[Extends<-1, Pos<I$1>>];
|
|
1340
|
+
/**
|
|
1341
|
+
* starts in reverse from the end till `N` = 0
|
|
1342
|
+
* @hidden
|
|
1343
|
+
*/
|
|
1344
|
+
declare type TakeBack<L extends List, N extends Iteration> = {
|
|
1345
|
+
0: TakeBack<Tail$1<L>, Prev<N>>;
|
|
1346
|
+
1: L;
|
|
1347
|
+
}[Extends<0, Pos<N>>];
|
|
1348
|
+
/**
|
|
1349
|
+
* @hidden
|
|
1350
|
+
*/
|
|
1351
|
+
declare type __Take<L extends List, N extends Iteration, way extends Way> = {
|
|
1352
|
+
'->': TakeForth<L, N>;
|
|
1353
|
+
'<-': TakeBack<L, N>;
|
|
1354
|
+
}[way];
|
|
1355
|
+
/**
|
|
1356
|
+
* @hidden
|
|
1357
|
+
*/
|
|
1358
|
+
declare type _Take<L extends List, N extends number, way extends Way = '->'> = __Take<L, IterationOf<N>, way> extends infer X ? Cast<X, List> : never;
|
|
1359
|
+
/**
|
|
1360
|
+
* Extract `N` entries out of `L`
|
|
1361
|
+
* @param L to extract from
|
|
1362
|
+
* @param N to extract out
|
|
1363
|
+
* @param way (?=`'->'`) to extract from end
|
|
1364
|
+
* @returns [[List]]
|
|
1330
1365
|
* @example
|
|
1331
1366
|
* ```ts
|
|
1332
|
-
* const original = { a: 1, b: { c: 2 } };
|
|
1333
|
-
* const copy = cloneDeep(original);
|
|
1334
|
-
* copy.b.c = 3;
|
|
1335
|
-
* // original.b.c === 2
|
|
1336
1367
|
* ```
|
|
1337
|
-
* @reference https://github.com/radashi-org/radashi/blob/main/src/object/cloneDeep.ts
|
|
1338
1368
|
*/
|
|
1339
|
-
declare
|
|
1369
|
+
declare type Take<L extends List, N extends number, way extends Way = '->'> = L extends unknown ? N extends unknown ? _Take<L, N, way> : never : never;
|
|
1340
1370
|
//#endregion
|
|
1341
|
-
//#region src/
|
|
1371
|
+
//#region src/types/index.type.d.ts
|
|
1372
|
+
type AnyArray<A$1 = any> = readonly A$1[];
|
|
1373
|
+
type Range<Start extends number, End extends number> = Exclude<keyof TupleOf<End>, keyof TupleOf<Start>>;
|
|
1374
|
+
type TupleToEntries<A$1 extends readonly unknown[]> = If<IsAny<A$1>, unknown, { [Key in keyof A$1]: [Key, A$1[Key]] }>;
|
|
1375
|
+
type Groups<L extends AnyArray, LN extends AnyArray = [], D extends number[] = []> = D["length"] extends 40 ? LN : {
|
|
1376
|
+
0: Groups<Drop<L, 1>, Append<LN, [`${LN["length"]}`, Take<L, 1>]>, [...D, 0]>;
|
|
1377
|
+
1: LN;
|
|
1378
|
+
}[Extends<L, AnyArray<never>>];
|
|
1379
|
+
type TupleToGroups<L extends AnyArray> = Groups<L> extends infer X ? Cast<X, AnyArray> : never;
|
|
1380
|
+
type MatchFunction<T, R$1 = unknown> = (row: T, index: number) => R$1;
|
|
1381
|
+
//#endregion
|
|
1382
|
+
//#region src/utils/array/arrayCounting.d.ts
|
|
1342
1383
|
/**
|
|
1343
|
-
*
|
|
1384
|
+
* 统计数组的项目出现次数
|
|
1385
|
+
* - 通过给定的标识符匹配函数,返回一个对象,其中键是回调函数返回的 key 值,每个值是一个整数,表示该 key 出现的次数
|
|
1344
1386
|
*
|
|
1345
|
-
* @param
|
|
1346
|
-
* @
|
|
1387
|
+
* @param initialList 初始数组
|
|
1388
|
+
* @param match 匹配函数
|
|
1389
|
+
* @returns 统计对象
|
|
1347
1390
|
* @example
|
|
1348
1391
|
* ```ts
|
|
1349
|
-
*
|
|
1350
|
-
*
|
|
1392
|
+
* const list = ["a", "b", "a", "c"];
|
|
1393
|
+
* arrayCounting(list, (x) => x); // { a: 2, b: 1, c: 1 }
|
|
1394
|
+
*
|
|
1395
|
+
* const users = [{ id: 1, group: "A" }, { id: 2, group: "B" }, { id: 3, group: "A" }];
|
|
1396
|
+
* arrayCounting(users, (u) => u.group); // { A: 2, B: 1 }
|
|
1351
1397
|
* ```
|
|
1352
1398
|
*/
|
|
1353
|
-
declare function
|
|
1354
|
-
declare function enumEntries<E extends AnyObject>(enumeration: E): [keyof E, E[keyof E]][];
|
|
1399
|
+
declare function arrayCounting<T, K$1 extends PropertyKey>(initialList: readonly T[], match: MatchFunction<T, K$1>): Record<string, number>;
|
|
1355
1400
|
//#endregion
|
|
1356
|
-
//#region src/utils/
|
|
1401
|
+
//#region src/utils/array/arrayDifference.d.ts
|
|
1357
1402
|
/**
|
|
1358
|
-
*
|
|
1403
|
+
* 求数组差集
|
|
1404
|
+
* - 返回在 `initialList` 中存在,但在 `diffList` 中不存在的元素
|
|
1359
1405
|
*
|
|
1360
|
-
* @param
|
|
1361
|
-
* @
|
|
1406
|
+
* @param initialList 初始数组
|
|
1407
|
+
* @param diffList 对比数组
|
|
1408
|
+
* @param match 匹配函数
|
|
1409
|
+
* @returns 差集数组
|
|
1362
1410
|
* @example
|
|
1363
1411
|
* ```ts
|
|
1364
|
-
*
|
|
1365
|
-
*
|
|
1412
|
+
* arrayDifference([1, 2, 3], [2, 3, 4]); // [1]
|
|
1413
|
+
* arrayDifference([{ id: 1 }, { id: 2 }], [{ id: 2 }], (x) => x.id); // [{ id: 1 }]
|
|
1366
1414
|
* ```
|
|
1367
1415
|
*/
|
|
1368
|
-
declare function
|
|
1369
|
-
declare function enumKeys<E extends AnyObject>(enumeration: E): (keyof E)[];
|
|
1416
|
+
declare function arrayDifference<T>(initialList: readonly T[], diffList: readonly T[], match?: (row: T, index: number) => unknown): T[];
|
|
1370
1417
|
//#endregion
|
|
1371
|
-
//#region src/utils/
|
|
1418
|
+
//#region src/utils/array/arrayFirst.d.ts
|
|
1372
1419
|
/**
|
|
1373
|
-
*
|
|
1420
|
+
* 获取数组第一项
|
|
1374
1421
|
*
|
|
1375
|
-
* @param
|
|
1376
|
-
* @
|
|
1422
|
+
* @param initialList 初始数组
|
|
1423
|
+
* @param saveValue 安全值
|
|
1424
|
+
* @returns 数组第一项,如果为空则返回安全值
|
|
1377
1425
|
* @example
|
|
1378
1426
|
* ```ts
|
|
1379
|
-
*
|
|
1380
|
-
*
|
|
1427
|
+
* arrayFirst([1, 2]); // 1
|
|
1428
|
+
* arrayFirst([], 0); // 0
|
|
1381
1429
|
* ```
|
|
1382
1430
|
*/
|
|
1383
|
-
declare function
|
|
1384
|
-
declare function
|
|
1431
|
+
declare function arrayFirst<T>(initialList: readonly T[]): T | undefined;
|
|
1432
|
+
declare function arrayFirst<T>(initialList: readonly T[], saveValue: T): T;
|
|
1385
1433
|
//#endregion
|
|
1386
|
-
//#region src/utils/
|
|
1434
|
+
//#region src/utils/array/arrayFork.d.ts
|
|
1387
1435
|
/**
|
|
1388
|
-
*
|
|
1389
|
-
* -
|
|
1436
|
+
* 数组分组过滤
|
|
1437
|
+
* - 给定一个数组和一个条件,返回一个由两个数组组成的元组,其中第一个数组包含所有满足条件的项,第二个数组包含所有不满足条件的项
|
|
1390
1438
|
*
|
|
1391
|
-
* @param
|
|
1392
|
-
* @param
|
|
1393
|
-
* @returns
|
|
1439
|
+
* @param initialList 初始数组
|
|
1440
|
+
* @param match 条件匹配函数
|
|
1441
|
+
* @returns [满足条件的项[], 不满足条件的项[]]
|
|
1394
1442
|
* @example
|
|
1395
1443
|
* ```ts
|
|
1396
|
-
*
|
|
1397
|
-
* mapEntries(obj, (k, v) => [k, v * 2]); // { a: 2, b: 4 }
|
|
1444
|
+
* arrayFork([1, 2, 3, 4], (n) => n % 2 === 0); // [[2, 4], [1, 3]]
|
|
1398
1445
|
* ```
|
|
1399
1446
|
*/
|
|
1400
|
-
declare function
|
|
1447
|
+
declare function arrayFork<T>(initialList: readonly T[], match: MatchFunction<T, boolean>): [T[], T[]];
|
|
1401
1448
|
//#endregion
|
|
1402
|
-
//#region
|
|
1403
|
-
|
|
1404
|
-
interface BigInt {
|
|
1405
|
-
/**
|
|
1406
|
-
* Returns a string representation of an object.
|
|
1407
|
-
* @param radix Specifies a radix for converting numeric values to strings.
|
|
1408
|
-
*/
|
|
1409
|
-
toString(radix?: number): string;
|
|
1410
|
-
/** Returns a string representation appropriate to the host environment's current locale. */
|
|
1411
|
-
toLocaleString(locales?: any, options?: BigIntToLocaleStringOptions): string;
|
|
1412
|
-
/** Returns the primitive value of the specified object. */
|
|
1413
|
-
valueOf(): bigint;
|
|
1414
|
-
readonly [Symbol.toStringTag]: "BigInt";
|
|
1415
|
-
}
|
|
1449
|
+
//#region src/utils/array/arrayIntersection.d.ts
|
|
1416
1450
|
/**
|
|
1417
|
-
*
|
|
1418
|
-
*
|
|
1451
|
+
* 求数组交集
|
|
1452
|
+
* - 返回在 `initialList` 和 `diffList` 中都存在的元素
|
|
1453
|
+
*
|
|
1454
|
+
* @param initialList 初始数组
|
|
1455
|
+
* @param diffList 对比数组
|
|
1456
|
+
* @param match 匹配函数
|
|
1457
|
+
* @returns 交集数组
|
|
1458
|
+
* @example
|
|
1459
|
+
* ```ts
|
|
1460
|
+
* arrayIntersection([1, 2], [2, 3]); // [2]
|
|
1461
|
+
* arrayIntersection([{ id: 1 }, { id: 2 }], [{ id: 2 }], (x) => x.id); // [{ id: 2 }]
|
|
1462
|
+
* ```
|
|
1419
1463
|
*/
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
readonly buffer: ArrayBufferLike;
|
|
1425
|
-
/** The length in bytes of the array. */
|
|
1426
|
-
readonly byteLength: number;
|
|
1427
|
-
/** The offset in bytes of the array. */
|
|
1428
|
-
readonly byteOffset: number;
|
|
1429
|
-
/**
|
|
1430
|
-
* Returns the this object after copying a section of the array identified by start and end
|
|
1431
|
-
* to the same array starting at position target
|
|
1432
|
-
* @param target If target is negative, it is treated as length+target where length is the
|
|
1433
|
-
* length of the array.
|
|
1434
|
-
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
1435
|
-
* is treated as length+end.
|
|
1436
|
-
* @param end If not specified, length of the this object is used as its default value.
|
|
1437
|
-
*/
|
|
1438
|
-
copyWithin(target: number, start: number, end?: number): this;
|
|
1439
|
-
/** Yields index, value pairs for every entry in the array. */
|
|
1440
|
-
entries(): IterableIterator<[number, bigint]>;
|
|
1441
|
-
/**
|
|
1442
|
-
* Determines whether all the members of an array satisfy the specified test.
|
|
1443
|
-
* @param predicate A function that accepts up to three arguments. The every method calls
|
|
1444
|
-
* the predicate function for each element in the array until the predicate returns false,
|
|
1445
|
-
* or until the end of the array.
|
|
1446
|
-
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
1447
|
-
* If thisArg is omitted, undefined is used as the this value.
|
|
1448
|
-
*/
|
|
1449
|
-
every(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): boolean;
|
|
1450
|
-
/**
|
|
1451
|
-
* Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
|
|
1452
|
-
* @param value value to fill array section with
|
|
1453
|
-
* @param start index to start filling the array at. If start is negative, it is treated as
|
|
1454
|
-
* length+start where length is the length of the array.
|
|
1455
|
-
* @param end index to stop filling the array at. If end is negative, it is treated as
|
|
1456
|
-
* length+end.
|
|
1457
|
-
*/
|
|
1458
|
-
fill(value: bigint, start?: number, end?: number): this;
|
|
1459
|
-
/**
|
|
1460
|
-
* Returns the elements of an array that meet the condition specified in a callback function.
|
|
1461
|
-
* @param predicate A function that accepts up to three arguments. The filter method calls
|
|
1462
|
-
* the predicate function one time for each element in the array.
|
|
1463
|
-
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
1464
|
-
* If thisArg is omitted, undefined is used as the this value.
|
|
1465
|
-
*/
|
|
1466
|
-
filter(predicate: (value: bigint, index: number, array: BigInt64Array$1) => any, thisArg?: any): BigInt64Array$1;
|
|
1467
|
-
/**
|
|
1468
|
-
* Returns the value of the first element in the array where predicate is true, and undefined
|
|
1469
|
-
* otherwise.
|
|
1470
|
-
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
1471
|
-
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
1472
|
-
* immediately returns that element value. Otherwise, find returns undefined.
|
|
1473
|
-
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
1474
|
-
* predicate. If it is not provided, undefined is used instead.
|
|
1475
|
-
*/
|
|
1476
|
-
find(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): bigint | undefined;
|
|
1477
|
-
/**
|
|
1478
|
-
* Returns the index of the first element in the array where predicate is true, and -1
|
|
1479
|
-
* otherwise.
|
|
1480
|
-
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
1481
|
-
* order, until it finds one where predicate returns true. If such an element is found,
|
|
1482
|
-
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
|
|
1483
|
-
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
1484
|
-
* predicate. If it is not provided, undefined is used instead.
|
|
1485
|
-
*/
|
|
1486
|
-
findIndex(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): number;
|
|
1487
|
-
/**
|
|
1488
|
-
* Performs the specified action for each element in an array.
|
|
1489
|
-
* @param callbackfn A function that accepts up to three arguments. forEach calls the
|
|
1490
|
-
* callbackfn function one time for each element in the array.
|
|
1491
|
-
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
|
|
1492
|
-
* If thisArg is omitted, undefined is used as the this value.
|
|
1493
|
-
*/
|
|
1494
|
-
forEach(callbackfn: (value: bigint, index: number, array: BigInt64Array$1) => void, thisArg?: any): void;
|
|
1495
|
-
/**
|
|
1496
|
-
* Determines whether an array includes a certain element, returning true or false as appropriate.
|
|
1497
|
-
* @param searchElement The element to search for.
|
|
1498
|
-
* @param fromIndex The position in this array at which to begin searching for searchElement.
|
|
1499
|
-
*/
|
|
1500
|
-
includes(searchElement: bigint, fromIndex?: number): boolean;
|
|
1501
|
-
/**
|
|
1502
|
-
* Returns the index of the first occurrence of a value in an array.
|
|
1503
|
-
* @param searchElement The value to locate in the array.
|
|
1504
|
-
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
|
|
1505
|
-
* search starts at index 0.
|
|
1506
|
-
*/
|
|
1507
|
-
indexOf(searchElement: bigint, fromIndex?: number): number;
|
|
1508
|
-
/**
|
|
1509
|
-
* Adds all the elements of an array separated by the specified separator string.
|
|
1510
|
-
* @param separator A string used to separate one element of an array from the next in the
|
|
1511
|
-
* resulting String. If omitted, the array elements are separated with a comma.
|
|
1512
|
-
*/
|
|
1513
|
-
join(separator?: string): string;
|
|
1514
|
-
/** Yields each index in the array. */
|
|
1515
|
-
keys(): IterableIterator<number>;
|
|
1516
|
-
/**
|
|
1517
|
-
* Returns the index of the last occurrence of a value in an array.
|
|
1518
|
-
* @param searchElement The value to locate in the array.
|
|
1519
|
-
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
|
|
1520
|
-
* search starts at index 0.
|
|
1521
|
-
*/
|
|
1522
|
-
lastIndexOf(searchElement: bigint, fromIndex?: number): number;
|
|
1523
|
-
/** The length of the array. */
|
|
1524
|
-
readonly length: number;
|
|
1525
|
-
/**
|
|
1526
|
-
* Calls a defined callback function on each element of an array, and returns an array that
|
|
1527
|
-
* contains the results.
|
|
1528
|
-
* @param callbackfn A function that accepts up to three arguments. The map method calls the
|
|
1529
|
-
* callbackfn function one time for each element in the array.
|
|
1530
|
-
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
|
|
1531
|
-
* If thisArg is omitted, undefined is used as the this value.
|
|
1532
|
-
*/
|
|
1533
|
-
map(callbackfn: (value: bigint, index: number, array: BigInt64Array$1) => bigint, thisArg?: any): BigInt64Array$1;
|
|
1534
|
-
/**
|
|
1535
|
-
* Calls the specified callback function for all the elements in an array. The return value of
|
|
1536
|
-
* the callback function is the accumulated result, and is provided as an argument in the next
|
|
1537
|
-
* call to the callback function.
|
|
1538
|
-
* @param callbackfn A function that accepts up to four arguments. The reduce method calls the
|
|
1539
|
-
* callbackfn function one time for each element in the array.
|
|
1540
|
-
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
1541
|
-
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
|
1542
|
-
* instead of an array value.
|
|
1543
|
-
*/
|
|
1544
|
-
reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => bigint): bigint;
|
|
1545
|
-
/**
|
|
1546
|
-
* Calls the specified callback function for all the elements in an array. The return value of
|
|
1547
|
-
* the callback function is the accumulated result, and is provided as an argument in the next
|
|
1548
|
-
* call to the callback function.
|
|
1549
|
-
* @param callbackfn A function that accepts up to four arguments. The reduce method calls the
|
|
1550
|
-
* callbackfn function one time for each element in the array.
|
|
1551
|
-
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
1552
|
-
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
|
1553
|
-
* instead of an array value.
|
|
1554
|
-
*/
|
|
1555
|
-
reduce<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => U$1, initialValue: U$1): U$1;
|
|
1556
|
-
/**
|
|
1557
|
-
* Calls the specified callback function for all the elements in an array, in descending order.
|
|
1558
|
-
* The return value of the callback function is the accumulated result, and is provided as an
|
|
1559
|
-
* argument in the next call to the callback function.
|
|
1560
|
-
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
|
|
1561
|
-
* the callbackfn function one time for each element in the array.
|
|
1562
|
-
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
1563
|
-
* the accumulation. The first call to the callbackfn function provides this value as an
|
|
1564
|
-
* argument instead of an array value.
|
|
1565
|
-
*/
|
|
1566
|
-
reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => bigint): bigint;
|
|
1567
|
-
/**
|
|
1568
|
-
* Calls the specified callback function for all the elements in an array, in descending order.
|
|
1569
|
-
* The return value of the callback function is the accumulated result, and is provided as an
|
|
1570
|
-
* argument in the next call to the callback function.
|
|
1571
|
-
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
|
|
1572
|
-
* the callbackfn function one time for each element in the array.
|
|
1573
|
-
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
1574
|
-
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
|
1575
|
-
* instead of an array value.
|
|
1576
|
-
*/
|
|
1577
|
-
reduceRight<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => U$1, initialValue: U$1): U$1;
|
|
1578
|
-
/** Reverses the elements in the array. */
|
|
1579
|
-
reverse(): this;
|
|
1580
|
-
/**
|
|
1581
|
-
* Sets a value or an array of values.
|
|
1582
|
-
* @param array A typed or untyped array of values to set.
|
|
1583
|
-
* @param offset The index in the current array at which the values are to be written.
|
|
1584
|
-
*/
|
|
1585
|
-
set(array: ArrayLike<bigint>, offset?: number): void;
|
|
1586
|
-
/**
|
|
1587
|
-
* Returns a section of an array.
|
|
1588
|
-
* @param start The beginning of the specified portion of the array.
|
|
1589
|
-
* @param end The end of the specified portion of the array.
|
|
1590
|
-
*/
|
|
1591
|
-
slice(start?: number, end?: number): BigInt64Array$1;
|
|
1592
|
-
/**
|
|
1593
|
-
* Determines whether the specified callback function returns true for any element of an array.
|
|
1594
|
-
* @param predicate A function that accepts up to three arguments. The some method calls the
|
|
1595
|
-
* predicate function for each element in the array until the predicate returns true, or until
|
|
1596
|
-
* the end of the array.
|
|
1597
|
-
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
1598
|
-
* If thisArg is omitted, undefined is used as the this value.
|
|
1599
|
-
*/
|
|
1600
|
-
some(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): boolean;
|
|
1601
|
-
/**
|
|
1602
|
-
* Sorts the array.
|
|
1603
|
-
* @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.
|
|
1604
|
-
*/
|
|
1605
|
-
sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;
|
|
1606
|
-
/**
|
|
1607
|
-
* Gets a new BigInt64Array view of the ArrayBuffer store for this array, referencing the elements
|
|
1608
|
-
* at begin, inclusive, up to end, exclusive.
|
|
1609
|
-
* @param begin The index of the beginning of the array.
|
|
1610
|
-
* @param end The index of the end of the array.
|
|
1611
|
-
*/
|
|
1612
|
-
subarray(begin?: number, end?: number): BigInt64Array$1;
|
|
1613
|
-
/** Converts the array to a string by using the current locale. */
|
|
1614
|
-
toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;
|
|
1615
|
-
/** Returns a string representation of the array. */
|
|
1616
|
-
toString(): string;
|
|
1617
|
-
/** Returns the primitive value of the specified object. */
|
|
1618
|
-
valueOf(): BigInt64Array$1;
|
|
1619
|
-
/** Yields each value in the array. */
|
|
1620
|
-
values(): IterableIterator<bigint>;
|
|
1621
|
-
[Symbol.iterator](): IterableIterator<bigint>;
|
|
1622
|
-
readonly [Symbol.toStringTag]: "BigInt64Array";
|
|
1623
|
-
[index: number]: bigint;
|
|
1624
|
-
}
|
|
1464
|
+
declare function arrayIntersection<T>(initialList: readonly T[], diffList: readonly T[]): T[];
|
|
1465
|
+
declare function arrayIntersection<T, D = T>(initialList: readonly T[], diffList: readonly D[], match: MatchFunction<T>): T[];
|
|
1466
|
+
//#endregion
|
|
1467
|
+
//#region src/utils/array/arrayLast.d.ts
|
|
1625
1468
|
/**
|
|
1626
|
-
*
|
|
1627
|
-
*
|
|
1469
|
+
* 获取数组最后一项
|
|
1470
|
+
*
|
|
1471
|
+
* @param initialList 初始数组
|
|
1472
|
+
* @param saveValue 安全值
|
|
1473
|
+
* @returns 数组最后一项,如果为空则返回安全值
|
|
1474
|
+
* @example
|
|
1475
|
+
* ```ts
|
|
1476
|
+
* arrayLast([1, 2, 3]); // 3
|
|
1477
|
+
* arrayLast([], 0); // 0
|
|
1478
|
+
* ```
|
|
1628
1479
|
*/
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
readonly buffer: ArrayBufferLike;
|
|
1634
|
-
/** The length in bytes of the array. */
|
|
1635
|
-
readonly byteLength: number;
|
|
1636
|
-
/** The offset in bytes of the array. */
|
|
1637
|
-
readonly byteOffset: number;
|
|
1638
|
-
/**
|
|
1639
|
-
* Returns the this object after copying a section of the array identified by start and end
|
|
1640
|
-
* to the same array starting at position target
|
|
1641
|
-
* @param target If target is negative, it is treated as length+target where length is the
|
|
1642
|
-
* length of the array.
|
|
1643
|
-
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
1644
|
-
* is treated as length+end.
|
|
1645
|
-
* @param end If not specified, length of the this object is used as its default value.
|
|
1646
|
-
*/
|
|
1647
|
-
copyWithin(target: number, start: number, end?: number): this;
|
|
1648
|
-
/** Yields index, value pairs for every entry in the array. */
|
|
1649
|
-
entries(): IterableIterator<[number, bigint]>;
|
|
1650
|
-
/**
|
|
1651
|
-
* Determines whether all the members of an array satisfy the specified test.
|
|
1652
|
-
* @param predicate A function that accepts up to three arguments. The every method calls
|
|
1653
|
-
* the predicate function for each element in the array until the predicate returns false,
|
|
1654
|
-
* or until the end of the array.
|
|
1655
|
-
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
1656
|
-
* If thisArg is omitted, undefined is used as the this value.
|
|
1657
|
-
*/
|
|
1658
|
-
every(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): boolean;
|
|
1659
|
-
/**
|
|
1660
|
-
* Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
|
|
1661
|
-
* @param value value to fill array section with
|
|
1662
|
-
* @param start index to start filling the array at. If start is negative, it is treated as
|
|
1663
|
-
* length+start where length is the length of the array.
|
|
1664
|
-
* @param end index to stop filling the array at. If end is negative, it is treated as
|
|
1665
|
-
* length+end.
|
|
1666
|
-
*/
|
|
1667
|
-
fill(value: bigint, start?: number, end?: number): this;
|
|
1668
|
-
/**
|
|
1669
|
-
* Returns the elements of an array that meet the condition specified in a callback function.
|
|
1670
|
-
* @param predicate A function that accepts up to three arguments. The filter method calls
|
|
1671
|
-
* the predicate function one time for each element in the array.
|
|
1672
|
-
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
1673
|
-
* If thisArg is omitted, undefined is used as the this value.
|
|
1674
|
-
*/
|
|
1675
|
-
filter(predicate: (value: bigint, index: number, array: BigUint64Array$1) => any, thisArg?: any): BigUint64Array$1;
|
|
1676
|
-
/**
|
|
1677
|
-
* Returns the value of the first element in the array where predicate is true, and undefined
|
|
1678
|
-
* otherwise.
|
|
1679
|
-
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
1680
|
-
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
1681
|
-
* immediately returns that element value. Otherwise, find returns undefined.
|
|
1682
|
-
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
1683
|
-
* predicate. If it is not provided, undefined is used instead.
|
|
1684
|
-
*/
|
|
1685
|
-
find(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): bigint | undefined;
|
|
1686
|
-
/**
|
|
1687
|
-
* Returns the index of the first element in the array where predicate is true, and -1
|
|
1688
|
-
* otherwise.
|
|
1689
|
-
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
1690
|
-
* order, until it finds one where predicate returns true. If such an element is found,
|
|
1691
|
-
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
|
|
1692
|
-
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
1693
|
-
* predicate. If it is not provided, undefined is used instead.
|
|
1694
|
-
*/
|
|
1695
|
-
findIndex(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): number;
|
|
1696
|
-
/**
|
|
1697
|
-
* Performs the specified action for each element in an array.
|
|
1698
|
-
* @param callbackfn A function that accepts up to three arguments. forEach calls the
|
|
1699
|
-
* callbackfn function one time for each element in the array.
|
|
1700
|
-
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
|
|
1701
|
-
* If thisArg is omitted, undefined is used as the this value.
|
|
1702
|
-
*/
|
|
1703
|
-
forEach(callbackfn: (value: bigint, index: number, array: BigUint64Array$1) => void, thisArg?: any): void;
|
|
1704
|
-
/**
|
|
1705
|
-
* Determines whether an array includes a certain element, returning true or false as appropriate.
|
|
1706
|
-
* @param searchElement The element to search for.
|
|
1707
|
-
* @param fromIndex The position in this array at which to begin searching for searchElement.
|
|
1708
|
-
*/
|
|
1709
|
-
includes(searchElement: bigint, fromIndex?: number): boolean;
|
|
1710
|
-
/**
|
|
1711
|
-
* Returns the index of the first occurrence of a value in an array.
|
|
1712
|
-
* @param searchElement The value to locate in the array.
|
|
1713
|
-
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
|
|
1714
|
-
* search starts at index 0.
|
|
1715
|
-
*/
|
|
1716
|
-
indexOf(searchElement: bigint, fromIndex?: number): number;
|
|
1717
|
-
/**
|
|
1718
|
-
* Adds all the elements of an array separated by the specified separator string.
|
|
1719
|
-
* @param separator A string used to separate one element of an array from the next in the
|
|
1720
|
-
* resulting String. If omitted, the array elements are separated with a comma.
|
|
1721
|
-
*/
|
|
1722
|
-
join(separator?: string): string;
|
|
1723
|
-
/** Yields each index in the array. */
|
|
1724
|
-
keys(): IterableIterator<number>;
|
|
1725
|
-
/**
|
|
1726
|
-
* Returns the index of the last occurrence of a value in an array.
|
|
1727
|
-
* @param searchElement The value to locate in the array.
|
|
1728
|
-
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
|
|
1729
|
-
* search starts at index 0.
|
|
1730
|
-
*/
|
|
1731
|
-
lastIndexOf(searchElement: bigint, fromIndex?: number): number;
|
|
1732
|
-
/** The length of the array. */
|
|
1733
|
-
readonly length: number;
|
|
1734
|
-
/**
|
|
1735
|
-
* Calls a defined callback function on each element of an array, and returns an array that
|
|
1736
|
-
* contains the results.
|
|
1737
|
-
* @param callbackfn A function that accepts up to three arguments. The map method calls the
|
|
1738
|
-
* callbackfn function one time for each element in the array.
|
|
1739
|
-
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
|
|
1740
|
-
* If thisArg is omitted, undefined is used as the this value.
|
|
1741
|
-
*/
|
|
1742
|
-
map(callbackfn: (value: bigint, index: number, array: BigUint64Array$1) => bigint, thisArg?: any): BigUint64Array$1;
|
|
1743
|
-
/**
|
|
1744
|
-
* Calls the specified callback function for all the elements in an array. The return value of
|
|
1745
|
-
* the callback function is the accumulated result, and is provided as an argument in the next
|
|
1746
|
-
* call to the callback function.
|
|
1747
|
-
* @param callbackfn A function that accepts up to four arguments. The reduce method calls the
|
|
1748
|
-
* callbackfn function one time for each element in the array.
|
|
1749
|
-
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
1750
|
-
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
|
1751
|
-
* instead of an array value.
|
|
1752
|
-
*/
|
|
1753
|
-
reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => bigint): bigint;
|
|
1754
|
-
/**
|
|
1755
|
-
* Calls the specified callback function for all the elements in an array. The return value of
|
|
1756
|
-
* the callback function is the accumulated result, and is provided as an argument in the next
|
|
1757
|
-
* call to the callback function.
|
|
1758
|
-
* @param callbackfn A function that accepts up to four arguments. The reduce method calls the
|
|
1759
|
-
* callbackfn function one time for each element in the array.
|
|
1760
|
-
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
1761
|
-
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
|
1762
|
-
* instead of an array value.
|
|
1763
|
-
*/
|
|
1764
|
-
reduce<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => U$1, initialValue: U$1): U$1;
|
|
1765
|
-
/**
|
|
1766
|
-
* Calls the specified callback function for all the elements in an array, in descending order.
|
|
1767
|
-
* The return value of the callback function is the accumulated result, and is provided as an
|
|
1768
|
-
* argument in the next call to the callback function.
|
|
1769
|
-
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
|
|
1770
|
-
* the callbackfn function one time for each element in the array.
|
|
1771
|
-
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
1772
|
-
* the accumulation. The first call to the callbackfn function provides this value as an
|
|
1773
|
-
* argument instead of an array value.
|
|
1774
|
-
*/
|
|
1775
|
-
reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => bigint): bigint;
|
|
1776
|
-
/**
|
|
1777
|
-
* Calls the specified callback function for all the elements in an array, in descending order.
|
|
1778
|
-
* The return value of the callback function is the accumulated result, and is provided as an
|
|
1779
|
-
* argument in the next call to the callback function.
|
|
1780
|
-
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
|
|
1781
|
-
* the callbackfn function one time for each element in the array.
|
|
1782
|
-
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
1783
|
-
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
|
1784
|
-
* instead of an array value.
|
|
1785
|
-
*/
|
|
1786
|
-
reduceRight<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => U$1, initialValue: U$1): U$1;
|
|
1787
|
-
/** Reverses the elements in the array. */
|
|
1788
|
-
reverse(): this;
|
|
1789
|
-
/**
|
|
1790
|
-
* Sets a value or an array of values.
|
|
1791
|
-
* @param array A typed or untyped array of values to set.
|
|
1792
|
-
* @param offset The index in the current array at which the values are to be written.
|
|
1793
|
-
*/
|
|
1794
|
-
set(array: ArrayLike<bigint>, offset?: number): void;
|
|
1795
|
-
/**
|
|
1796
|
-
* Returns a section of an array.
|
|
1797
|
-
* @param start The beginning of the specified portion of the array.
|
|
1798
|
-
* @param end The end of the specified portion of the array.
|
|
1799
|
-
*/
|
|
1800
|
-
slice(start?: number, end?: number): BigUint64Array$1;
|
|
1801
|
-
/**
|
|
1802
|
-
* Determines whether the specified callback function returns true for any element of an array.
|
|
1803
|
-
* @param predicate A function that accepts up to three arguments. The some method calls the
|
|
1804
|
-
* predicate function for each element in the array until the predicate returns true, or until
|
|
1805
|
-
* the end of the array.
|
|
1806
|
-
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
1807
|
-
* If thisArg is omitted, undefined is used as the this value.
|
|
1808
|
-
*/
|
|
1809
|
-
some(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): boolean;
|
|
1810
|
-
/**
|
|
1811
|
-
* Sorts the array.
|
|
1812
|
-
* @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.
|
|
1813
|
-
*/
|
|
1814
|
-
sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;
|
|
1815
|
-
/**
|
|
1816
|
-
* Gets a new BigUint64Array view of the ArrayBuffer store for this array, referencing the elements
|
|
1817
|
-
* at begin, inclusive, up to end, exclusive.
|
|
1818
|
-
* @param begin The index of the beginning of the array.
|
|
1819
|
-
* @param end The index of the end of the array.
|
|
1820
|
-
*/
|
|
1821
|
-
subarray(begin?: number, end?: number): BigUint64Array$1;
|
|
1822
|
-
/** Converts the array to a string by using the current locale. */
|
|
1823
|
-
toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;
|
|
1824
|
-
/** Returns a string representation of the array. */
|
|
1825
|
-
toString(): string;
|
|
1826
|
-
/** Returns the primitive value of the specified object. */
|
|
1827
|
-
valueOf(): BigUint64Array$1;
|
|
1828
|
-
/** Yields each value in the array. */
|
|
1829
|
-
values(): IterableIterator<bigint>;
|
|
1830
|
-
[Symbol.iterator](): IterableIterator<bigint>;
|
|
1831
|
-
readonly [Symbol.toStringTag]: "BigUint64Array";
|
|
1832
|
-
[index: number]: bigint;
|
|
1833
|
-
}
|
|
1834
|
-
interface BigIntToLocaleStringOptions {
|
|
1835
|
-
/**
|
|
1836
|
-
* 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}.
|
|
1837
|
-
*/
|
|
1838
|
-
localeMatcher?: string;
|
|
1839
|
-
/**
|
|
1840
|
-
* The formatting style to use , the default is "decimal".
|
|
1841
|
-
*/
|
|
1842
|
-
style?: string;
|
|
1843
|
-
numberingSystem?: string;
|
|
1844
|
-
/**
|
|
1845
|
-
* 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.
|
|
1846
|
-
*/
|
|
1847
|
-
unit?: string;
|
|
1848
|
-
/**
|
|
1849
|
-
* The unit formatting style to use in unit formatting, the defaults is "short".
|
|
1850
|
-
*/
|
|
1851
|
-
unitDisplay?: string;
|
|
1852
|
-
/**
|
|
1853
|
-
* 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".
|
|
1854
|
-
*/
|
|
1855
|
-
currency?: string;
|
|
1856
|
-
/**
|
|
1857
|
-
* How to display the currency in currency formatting. It is only used when [[Style]] has the value "currency". The default is "symbol".
|
|
1858
|
-
*
|
|
1859
|
-
* "symbol" to use a localized currency symbol such as €,
|
|
1860
|
-
*
|
|
1861
|
-
* "code" to use the ISO currency code,
|
|
1862
|
-
*
|
|
1863
|
-
* "name" to use a localized currency name such as "dollar"
|
|
1864
|
-
*/
|
|
1865
|
-
currencyDisplay?: string;
|
|
1866
|
-
/**
|
|
1867
|
-
* Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. The default is true.
|
|
1868
|
-
*/
|
|
1869
|
-
useGrouping?: boolean;
|
|
1870
|
-
/**
|
|
1871
|
-
* The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1.
|
|
1872
|
-
*/
|
|
1873
|
-
minimumIntegerDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
|
|
1874
|
-
/**
|
|
1875
|
-
* 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).
|
|
1876
|
-
*/
|
|
1877
|
-
minimumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
|
|
1878
|
-
/**
|
|
1879
|
-
* 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.
|
|
1880
|
-
*/
|
|
1881
|
-
maximumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
|
|
1882
|
-
/**
|
|
1883
|
-
* The minimum number of significant digits to use. Possible values are from 1 to 21; the default is 1.
|
|
1884
|
-
*/
|
|
1885
|
-
minimumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
|
|
1886
|
-
/**
|
|
1887
|
-
* The maximum number of significant digits to use. Possible values are from 1 to 21; the default is 21.
|
|
1888
|
-
*/
|
|
1889
|
-
maximumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
|
|
1890
|
-
/**
|
|
1891
|
-
* The formatting that should be displayed for the number, the defaults is "standard"
|
|
1892
|
-
*
|
|
1893
|
-
* "standard" plain number formatting
|
|
1894
|
-
*
|
|
1895
|
-
* "scientific" return the order-of-magnitude for formatted number.
|
|
1896
|
-
*
|
|
1897
|
-
* "engineering" return the exponent of ten when divisible by three
|
|
1898
|
-
*
|
|
1899
|
-
* "compact" string representing exponent, defaults is using the "short" form
|
|
1900
|
-
*/
|
|
1901
|
-
notation?: string;
|
|
1902
|
-
/**
|
|
1903
|
-
* used only when notation is "compact"
|
|
1904
|
-
*/
|
|
1905
|
-
compactDisplay?: string;
|
|
1906
|
-
}
|
|
1907
|
-
/**
|
|
1908
|
-
* The `Any` class does not exist at runtime. It's used in type
|
|
1909
|
-
* definitions to detect an `any` type.
|
|
1910
|
-
*
|
|
1911
|
-
* ```ts
|
|
1912
|
-
* type IsAny<T> = [T] extends [Any] ? 'is any' : 'is not any'
|
|
1913
|
-
* ```
|
|
1914
|
-
*/
|
|
1915
|
-
declare class Any {
|
|
1916
|
-
private any;
|
|
1917
|
-
}
|
|
1918
|
-
/**
|
|
1919
|
-
* Represents a class constructor.
|
|
1920
|
-
*/
|
|
1921
|
-
|
|
1922
|
-
/**
|
|
1923
|
-
* Get all properties **not using** the `?:` type operator.
|
|
1924
|
-
*/
|
|
1925
|
-
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;
|
|
1926
|
-
/**
|
|
1927
|
-
* Get all properties using the `?:` type operator.
|
|
1928
|
-
*/
|
|
1929
|
-
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;
|
|
1930
|
-
/**
|
|
1931
|
-
* Resolves to `true` if `Left` and `Right` are exactly the same type.
|
|
1932
|
-
*
|
|
1933
|
-
* Otherwise false.
|
|
1934
|
-
*/
|
|
1935
|
-
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;
|
|
1936
|
-
type Primitive = number | string | boolean | symbol | bigint | null | undefined | void;
|
|
1937
|
-
/**
|
|
1938
|
-
* Coerce a primitive type to its boxed equivalent.
|
|
1939
|
-
*
|
|
1940
|
-
* @example
|
|
1941
|
-
* ```ts
|
|
1942
|
-
* type A = BoxedPrimitive<string>
|
|
1943
|
-
* // ^? String
|
|
1944
|
-
* type B = BoxedPrimitive<number>
|
|
1945
|
-
* // ^? Number
|
|
1946
|
-
* ```
|
|
1947
|
-
*/
|
|
1948
|
-
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;
|
|
1949
|
-
type TypedArray$1 = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array$1 | BigUint64Array$1 | DataView | ArrayBuffer | SharedArrayBuffer;
|
|
1950
|
-
/**
|
|
1951
|
-
* Add your own classes to this registry by extending its interface
|
|
1952
|
-
* with what's called “declaration merging” in TypeScript.
|
|
1953
|
-
*
|
|
1954
|
-
* All property types in this registry type may be treated specially
|
|
1955
|
-
* by any of Radashi's complex types. For example, `assign` will avoid
|
|
1956
|
-
* merging with types in this registry.
|
|
1957
|
-
*/
|
|
1958
|
-
interface CustomClassRegistry {}
|
|
1959
|
-
/**
|
|
1960
|
-
* This type represents any custom class that was "registered" through
|
|
1961
|
-
* the `CustomClassRegistry` type.
|
|
1962
|
-
*/
|
|
1963
|
-
type CustomClass = CustomClassRegistry[keyof CustomClassRegistry];
|
|
1964
|
-
/**
|
|
1965
|
-
* These types are implemented natively.
|
|
1966
|
-
*
|
|
1967
|
-
* Note that boxed primitives like `Boolean` (different from
|
|
1968
|
-
* `boolean`) are not included, because `boolean extends Boolean ? 1 :
|
|
1969
|
-
* 0` resolves to 1.
|
|
1970
|
-
*/
|
|
1971
|
-
type BuiltInType = ES2021.BuiltInType | WebAPI.BuiltInType | NodeJS.BuiltInType;
|
|
1972
|
-
declare namespace ES2020 {
|
|
1973
|
-
type BuiltInType = Primitive | Promise<any> | Date | RegExp | Error | readonly any[] | ReadonlyMap<any, any> | ReadonlySet<any> | WeakMap<WeakKey, any> | WeakSet<WeakKey> | TypedArray$1 | Function;
|
|
1974
|
-
}
|
|
1975
|
-
declare namespace ES2021 {
|
|
1976
|
-
type BuiltInType = ES2020.BuiltInType | GlobalObjectType<'FinalizationRegistry'> | GlobalObjectType<'WeakRef'>;
|
|
1977
|
-
}
|
|
1978
|
-
declare namespace NodeJS {
|
|
1979
|
-
type BuiltInType = GlobalObjectType<'Buffer'>;
|
|
1980
|
-
}
|
|
1981
|
-
declare namespace WebAPI {
|
|
1982
|
-
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;
|
|
1983
|
-
}
|
|
1984
|
-
declare namespace WebDocumentAPI {
|
|
1985
|
-
type BuiltInType = GlobalObjectType<'Node'> | GlobalObjectType<'NodeList'> | GlobalObjectType<'NodeIterator'> | GlobalObjectType<'HTMLCollection'> | GlobalObjectType<'CSSStyleDeclaration'> | GlobalObjectType<'DOMStringList'> | GlobalObjectType<'DOMTokenList'>;
|
|
1986
|
-
}
|
|
1987
|
-
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;
|
|
1988
|
-
|
|
1480
|
+
declare function arrayLast<T>(initialList: readonly T[]): T | undefined;
|
|
1481
|
+
declare function arrayLast<T>(initialList: readonly T[], saveValue: T): T;
|
|
1482
|
+
//#endregion
|
|
1483
|
+
//#region src/utils/array/arrayMerge.d.ts
|
|
1989
1484
|
/**
|
|
1990
|
-
*
|
|
1991
|
-
*
|
|
1992
|
-
*
|
|
1993
|
-
* rethrown.
|
|
1485
|
+
* 数组合并
|
|
1486
|
+
* - 如果未提供 `match` 函数,则合并两个数组并去重(Union)
|
|
1487
|
+
* - 如果提供了 `match` 函数,则仅更新 `initialList` 中匹配到的项(Left Join Update),不会追加 `mergeList` 中新增的项
|
|
1994
1488
|
*
|
|
1995
|
-
* @
|
|
1489
|
+
* @param initialList 初始数组
|
|
1490
|
+
* @param mergeList 待合并数组
|
|
1491
|
+
* @param match 匹配函数
|
|
1492
|
+
* @returns 合并后的数组
|
|
1996
1493
|
* @example
|
|
1997
1494
|
* ```ts
|
|
1998
|
-
*
|
|
1999
|
-
*
|
|
2000
|
-
*
|
|
2001
|
-
* const bad = async (): Promise<number> => { throw new Error('bad') }
|
|
2002
|
-
*
|
|
2003
|
-
* const goodResult = await toResult(good())
|
|
2004
|
-
* // => [undefined, 1]
|
|
2005
|
-
*
|
|
2006
|
-
* const badResult = await toResult(bad())
|
|
2007
|
-
* // => [Error('bad'), undefined]
|
|
2008
|
-
* ```
|
|
2009
|
-
* @version 12.4.0
|
|
2010
|
-
*/
|
|
2011
|
-
|
|
2012
|
-
/**
|
|
2013
|
-
* The return type for `assign`.
|
|
2014
|
-
*
|
|
2015
|
-
* It recursively merges object types that are not native objects. The
|
|
2016
|
-
* root objects are always merged.
|
|
2017
|
-
*
|
|
2018
|
-
* @see https://radashi.js.org/reference/object/assign
|
|
2019
|
-
*/
|
|
2020
|
-
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;
|
|
2021
|
-
/**
|
|
2022
|
-
* Mimic the `Simplify` type and also remove `readonly` modifiers.
|
|
2023
|
-
*/
|
|
2024
|
-
type SimplifyMutable<T> = {} & { -readonly [P in keyof T]: T[P] };
|
|
2025
|
-
/**
|
|
2026
|
-
* This represents a value that should only be replaced if it exists
|
|
2027
|
-
* as an initial value; never deeply assigned into.
|
|
2028
|
-
*/
|
|
2029
|
-
type AtomicValue = BuiltInType | CustomClass | BoxedPrimitive;
|
|
2030
|
-
/**
|
|
2031
|
-
* Handle mixed types when merging nested plain objects.
|
|
2032
|
-
*
|
|
2033
|
-
* For example, if the type `TOverride` includes both `string` and `{ n:
|
|
2034
|
-
* number }` in a union, `AssignDeep` will treat `string` as
|
|
2035
|
-
* unmergeable and `{ n: number }` as mergeable.
|
|
2036
|
-
*/
|
|
2037
|
-
type AssignDeep<TInitial, TOverride, IsOptional = false> = never
|
|
2038
|
-
/**
|
|
2039
|
-
* When a native type is found in TInitial, it will only exist in
|
|
2040
|
-
* the result type if the override is optional.
|
|
2041
|
-
*/ | (TInitial extends AtomicValue ? IsOptional extends true ? TInitial : never : never)
|
|
2042
|
-
/**
|
|
2043
|
-
* When a native type is found in TOverride, it will always exists
|
|
2044
|
-
* in the result type.
|
|
2045
|
-
*/ | (TOverride extends AtomicValue ? TOverride : never)
|
|
2046
|
-
/**
|
|
2047
|
-
* Deep assignment is handled in this branch.
|
|
2048
|
-
*
|
|
2049
|
-
* 1. Exclude any native types from TInitial and TOverride
|
|
2050
|
-
* 2. If a non-native object type is not found in TInitial, simply
|
|
2051
|
-
* replace TInitial (or use "A | B" if the override is optional)
|
|
2052
|
-
* 3. For each non-native object type in TOverride, deep assign to
|
|
2053
|
-
* every non-native object in TInitial
|
|
2054
|
-
* 4. For each non-object type in TOverride, simply replace TInitial
|
|
2055
|
-
* (or use "A | B" if the override is optional)
|
|
2056
|
-
*/ | (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> :
|
|
2057
|
-
// 4.
|
|
2058
|
-
TOverride | (IsOptional extends true ? TInitial : never) : Extract<TOverride, object> | (IsOptional extends true ? TInitial : never) : never : never);
|
|
2059
|
-
|
|
2060
|
-
/**
|
|
2061
|
-
* Creates a shallow copy of the given object/value.
|
|
1495
|
+
* // 基础合并去重
|
|
1496
|
+
* arrayMerge([1, 2], [2, 3]); // [1, 2, 3]
|
|
1497
|
+
* arrayMerge([], [1, 2, 3]); // [1, 2, 3]
|
|
2062
1498
|
*
|
|
2063
|
-
*
|
|
2064
|
-
*
|
|
2065
|
-
*
|
|
2066
|
-
*
|
|
2067
|
-
*
|
|
2068
|
-
* // => { a: 1, b: { c: 3 } }
|
|
2069
|
-
* original !== cloned
|
|
2070
|
-
* // => true
|
|
2071
|
-
* original.b === cloned.b
|
|
2072
|
-
* // => true
|
|
1499
|
+
* // 按条件更新
|
|
1500
|
+
* const source = [{ id: 1, val: "a" }, { id: 2, val: "b" }];
|
|
1501
|
+
* const update = [{ id: 2, val: "new" }, { id: 3, val: "c" }];
|
|
1502
|
+
* arrayMerge(source, update, (x) => x.id);
|
|
1503
|
+
* // [{ id: 1, val: "a" }, { id: 2, val: "new" }] -> id:3 被忽略
|
|
2073
1504
|
* ```
|
|
2074
|
-
* @version 12.1.0
|
|
2075
1505
|
*/
|
|
1506
|
+
declare function arrayMerge<T>(initialList: readonly T[], mergeList: readonly T[]): T[];
|
|
1507
|
+
declare function arrayMerge<T, D = T>(initialList: readonly T[], mergeList: readonly D[], match: MatchFunction<T>): T[];
|
|
2076
1508
|
//#endregion
|
|
2077
|
-
//#region src/utils/
|
|
1509
|
+
//#region src/utils/array/arrayPick.d.ts
|
|
2078
1510
|
/**
|
|
2079
|
-
*
|
|
2080
|
-
* -
|
|
1511
|
+
* 数组选择
|
|
1512
|
+
* - 一次性应用 `filter` 和 `map` 操作
|
|
2081
1513
|
*
|
|
2082
|
-
* @param
|
|
2083
|
-
* @param
|
|
2084
|
-
* @
|
|
1514
|
+
* @param initialList 初始数组
|
|
1515
|
+
* @param filter filter 函数
|
|
1516
|
+
* @param mapper map 函数
|
|
1517
|
+
* @returns 处理后的新数组
|
|
2085
1518
|
* @example
|
|
2086
1519
|
* ```ts
|
|
2087
|
-
* const
|
|
2088
|
-
*
|
|
2089
|
-
*
|
|
1520
|
+
* const list = [1, 2, 3, 4];
|
|
1521
|
+
* arrayPick(list, (n) => n % 2 === 0); // [2, 4]
|
|
1522
|
+
* arrayPick(list, (n) => n % 2 === 0, (n) => n * 2); // [4, 8]
|
|
2090
1523
|
* ```
|
|
2091
1524
|
*/
|
|
2092
|
-
declare function
|
|
2093
|
-
declare function
|
|
1525
|
+
declare function arrayPick<const T>(initialList: readonly T[], filter: (row: T, index: number) => boolean): T[];
|
|
1526
|
+
declare function arrayPick<const T, K$1 = T>(initialList: readonly T[], filter: (row: T, index: number) => boolean, mapper: ((row: T, index: number) => K$1)): K$1[];
|
|
2094
1527
|
//#endregion
|
|
2095
|
-
//#region src/utils/
|
|
2096
|
-
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>>;
|
|
1528
|
+
//#region src/utils/array/arrayReplace.d.ts
|
|
2097
1529
|
/**
|
|
2098
|
-
*
|
|
2099
|
-
* -
|
|
1530
|
+
* 数组项替换
|
|
1531
|
+
* - 在给定的数组中,替换符合匹配函数结果的项目
|
|
1532
|
+
* - 只替换第一个匹配项
|
|
2100
1533
|
*
|
|
2101
|
-
* @param
|
|
2102
|
-
* @
|
|
1534
|
+
* @param initialList 初始数组
|
|
1535
|
+
* @param newItem 替换项
|
|
1536
|
+
* @param match 匹配函数
|
|
1537
|
+
* @returns 替换后的新数组
|
|
2103
1538
|
* @example
|
|
2104
1539
|
* ```ts
|
|
2105
|
-
*
|
|
2106
|
-
* objectCrush(obj); // { "a.b": 1 }
|
|
1540
|
+
* arrayReplace([1, 2, 3], 4, (n) => n === 2); // [1, 4, 3]
|
|
2107
1541
|
* ```
|
|
2108
1542
|
*/
|
|
2109
|
-
declare function
|
|
2110
|
-
declare function
|
|
2111
|
-
|
|
2112
|
-
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Any/Key.d.ts
|
|
2113
|
-
/**
|
|
2114
|
-
* Describes index keys for any type
|
|
2115
|
-
*/
|
|
2116
|
-
declare type Key$1 = string | number | symbol;
|
|
1543
|
+
declare function arrayReplace<const T>(initialList: readonly T[], newItem: T, match: MatchFunction<T, boolean>): T[];
|
|
1544
|
+
declare function arrayReplace<const T, K$1 extends T>(initialList: readonly T[], newItem: K$1, match: MatchFunction<T, boolean>): T[];
|
|
1545
|
+
declare function arrayReplace<const T, K$1>(initialList: readonly T[], newItem: K$1, match: MatchFunction<T, boolean>): (T | K$1)[];
|
|
2117
1546
|
//#endregion
|
|
2118
|
-
//#region
|
|
1547
|
+
//#region src/utils/array/arrayReplaceMove.d.ts
|
|
1548
|
+
type PositionType = "start" | "end" | number;
|
|
2119
1549
|
/**
|
|
2120
|
-
*
|
|
2121
|
-
*
|
|
2122
|
-
*
|
|
1550
|
+
* 数组项替换并移动
|
|
1551
|
+
* - 在给定的数组中,替换并移动符合匹配函数结果的项目
|
|
1552
|
+
* - 只替换和移动第一个匹配项
|
|
1553
|
+
* - 未匹配时,根据 `position` 在指定位置插入 `newItem`
|
|
1554
|
+
*
|
|
1555
|
+
* @param initialList 初始数组
|
|
1556
|
+
* @param newItem 替换项
|
|
1557
|
+
* @param match 匹配函数
|
|
1558
|
+
* @param position 移动位置,可选 `start` | `end` | 索引位置, 默认为 `end`
|
|
1559
|
+
* @returns
|
|
2123
1560
|
* @example
|
|
2124
1561
|
* ```ts
|
|
2125
|
-
*
|
|
2126
|
-
*
|
|
1562
|
+
* arrayReplaceMove([1, 2, 3, 4], 5, (n) => n === 2, 0); // [5, 1, 3, 4]
|
|
1563
|
+
* arrayReplaceMove([1, 2, 3, 4], 5, (n) => n === 2, 2); // [1, 3, 5, 4]
|
|
1564
|
+
* arrayReplaceMove([1, 2, 3, 4], 5, (n) => n === 2, "start"); // [5, 1, 3, 4]
|
|
1565
|
+
* arrayReplaceMove([1, 2, 3, 4], 5, (n) => n === 2); // [1, 3, 4, 5]
|
|
2127
1566
|
* ```
|
|
2128
1567
|
*/
|
|
2129
|
-
declare
|
|
1568
|
+
declare function arrayReplaceMove<const T>(initialList: readonly T[], newItem: T, match: MatchFunction<T, boolean>, position?: PositionType): T[];
|
|
2130
1569
|
//#endregion
|
|
2131
|
-
//#region
|
|
1570
|
+
//#region src/utils/array/arraySplit.d.ts
|
|
2132
1571
|
/**
|
|
2133
|
-
*
|
|
2134
|
-
*
|
|
2135
|
-
*
|
|
2136
|
-
* @param
|
|
2137
|
-
* @param
|
|
2138
|
-
* @returns
|
|
1572
|
+
* 数组切分
|
|
1573
|
+
* - 将数组以指定的长度切分后,组合在高维数组中
|
|
1574
|
+
*
|
|
1575
|
+
* @param initialList 初始数组
|
|
1576
|
+
* @param size 分割尺寸,默认 `10`
|
|
1577
|
+
* @returns 切分后的二维数组
|
|
2139
1578
|
* @example
|
|
2140
1579
|
* ```ts
|
|
2141
|
-
*
|
|
2142
|
-
*
|
|
2143
|
-
* type test0 = A.Cast<'42', string> // '42'
|
|
2144
|
-
* type test1 = A.Cast<'42', number> // number
|
|
1580
|
+
* arraySplit([1, 2, 3, 4, 5], 2); // [[1, 2], [3, 4], [5]]
|
|
2145
1581
|
* ```
|
|
2146
1582
|
*/
|
|
2147
|
-
declare
|
|
2148
|
-
//#endregion
|
|
2149
|
-
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Object/_Internal.d.ts
|
|
2150
|
-
/**
|
|
2151
|
-
* Describes the permissions/modifiers fields can have
|
|
2152
|
-
* `R`: readonly
|
|
2153
|
-
* `W`: writable
|
|
2154
|
-
* `!`: required
|
|
2155
|
-
* `?`: optional
|
|
2156
|
-
*/
|
|
2157
|
-
declare type Modx = ['?' | '!', 'W' | 'R'];
|
|
2158
|
-
//#endregion
|
|
2159
|
-
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Any/Compute.d.ts
|
|
2160
|
-
/**
|
|
2161
|
-
* @hidden
|
|
2162
|
-
*/
|
|
2163
|
-
declare type ComputeRaw<A$1 extends any> = A$1 extends Function ? A$1 : { [K in keyof A$1]: A$1[K] } & unknown;
|
|
1583
|
+
declare function arraySplit<T>(initialList: readonly T[], size?: number): T[][];
|
|
2164
1584
|
//#endregion
|
|
2165
|
-
//#region
|
|
1585
|
+
//#region src/utils/array/arrayZip.d.ts
|
|
2166
1586
|
/**
|
|
2167
|
-
*
|
|
2168
|
-
* `
|
|
2169
|
-
*
|
|
2170
|
-
* @param
|
|
2171
|
-
* @returns
|
|
1587
|
+
* 数组解压
|
|
1588
|
+
* - `arrayZip` 的反向操作
|
|
1589
|
+
*
|
|
1590
|
+
* @param arrays 压缩后的数组
|
|
1591
|
+
* @returns 解压后的二维数组
|
|
2172
1592
|
* @example
|
|
2173
1593
|
* ```ts
|
|
2174
|
-
*
|
|
2175
|
-
*
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
*
|
|
2180
|
-
*
|
|
1594
|
+
* arrayUnzip([[1, "a"], [2, "b"]]); // [[1, 2], ["a", "b"]]
|
|
1595
|
+
* ```
|
|
1596
|
+
*/
|
|
1597
|
+
declare function arrayUnzip<T>(arrays: readonly (readonly T[])[]): T[][];
|
|
1598
|
+
/**
|
|
1599
|
+
* 数组压缩
|
|
1600
|
+
* - 将多个数组的元素按索引组合成元组
|
|
2181
1601
|
*
|
|
2182
|
-
*
|
|
2183
|
-
*
|
|
1602
|
+
* @param arrays 多个数组
|
|
1603
|
+
* @returns 压缩后的元组数组
|
|
1604
|
+
* @example
|
|
1605
|
+
* ```ts
|
|
1606
|
+
* arrayZip([1, 2], ["a", "b"]); // [[1, "a"], [2, "b"]]
|
|
2184
1607
|
* ```
|
|
2185
1608
|
*/
|
|
2186
|
-
declare
|
|
1609
|
+
declare function arrayZip<T1, T2, T3, T4, T5>(array1: readonly T1[], array2: readonly T2[], array3: readonly T3[], array4: readonly T4[], array5: readonly T5[]): [T1, T2, T3, T4, T5][];
|
|
1610
|
+
declare function arrayZip<T1, T2, T3, T4>(array1: readonly T1[], array2: readonly T2[], array3: readonly T3[], array4: readonly T4[]): [T1, T2, T3, T4][];
|
|
1611
|
+
declare function arrayZip<T1, T2, T3>(array1: readonly T1[], array2: readonly T2[], array3: readonly T3[]): [T1, T2, T3][];
|
|
1612
|
+
declare function arrayZip<T1, T2>(array1: readonly T1[], array2: readonly T2[]): [T1, T2][];
|
|
1613
|
+
declare function arrayZip(): [];
|
|
2187
1614
|
//#endregion
|
|
2188
|
-
//#region
|
|
1615
|
+
//#region src/utils/array/arrayZipToObject.d.ts
|
|
2189
1616
|
/**
|
|
2190
|
-
*
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
'-89': [-89, '-', '-90', '-88', '89'];
|
|
2207
|
-
'-88': [-88, '-', '-89', '-87', '88'];
|
|
2208
|
-
'-87': [-87, '-', '-88', '-86', '87'];
|
|
2209
|
-
'-86': [-86, '-', '-87', '-85', '86'];
|
|
2210
|
-
'-85': [-85, '-', '-86', '-84', '85'];
|
|
2211
|
-
'-84': [-84, '-', '-85', '-83', '84'];
|
|
2212
|
-
'-83': [-83, '-', '-84', '-82', '83'];
|
|
2213
|
-
'-82': [-82, '-', '-83', '-81', '82'];
|
|
2214
|
-
'-81': [-81, '-', '-82', '-80', '81'];
|
|
2215
|
-
'-80': [-80, '-', '-81', '-79', '80'];
|
|
2216
|
-
'-79': [-79, '-', '-80', '-78', '79'];
|
|
2217
|
-
'-78': [-78, '-', '-79', '-77', '78'];
|
|
2218
|
-
'-77': [-77, '-', '-78', '-76', '77'];
|
|
2219
|
-
'-76': [-76, '-', '-77', '-75', '76'];
|
|
2220
|
-
'-75': [-75, '-', '-76', '-74', '75'];
|
|
2221
|
-
'-74': [-74, '-', '-75', '-73', '74'];
|
|
2222
|
-
'-73': [-73, '-', '-74', '-72', '73'];
|
|
2223
|
-
'-72': [-72, '-', '-73', '-71', '72'];
|
|
2224
|
-
'-71': [-71, '-', '-72', '-70', '71'];
|
|
2225
|
-
'-70': [-70, '-', '-71', '-69', '70'];
|
|
2226
|
-
'-69': [-69, '-', '-70', '-68', '69'];
|
|
2227
|
-
'-68': [-68, '-', '-69', '-67', '68'];
|
|
2228
|
-
'-67': [-67, '-', '-68', '-66', '67'];
|
|
2229
|
-
'-66': [-66, '-', '-67', '-65', '66'];
|
|
2230
|
-
'-65': [-65, '-', '-66', '-64', '65'];
|
|
2231
|
-
'-64': [-64, '-', '-65', '-63', '64'];
|
|
2232
|
-
'-63': [-63, '-', '-64', '-62', '63'];
|
|
2233
|
-
'-62': [-62, '-', '-63', '-61', '62'];
|
|
2234
|
-
'-61': [-61, '-', '-62', '-60', '61'];
|
|
2235
|
-
'-60': [-60, '-', '-61', '-59', '60'];
|
|
2236
|
-
'-59': [-59, '-', '-60', '-58', '59'];
|
|
2237
|
-
'-58': [-58, '-', '-59', '-57', '58'];
|
|
2238
|
-
'-57': [-57, '-', '-58', '-56', '57'];
|
|
2239
|
-
'-56': [-56, '-', '-57', '-55', '56'];
|
|
2240
|
-
'-55': [-55, '-', '-56', '-54', '55'];
|
|
2241
|
-
'-54': [-54, '-', '-55', '-53', '54'];
|
|
2242
|
-
'-53': [-53, '-', '-54', '-52', '53'];
|
|
2243
|
-
'-52': [-52, '-', '-53', '-51', '52'];
|
|
2244
|
-
'-51': [-51, '-', '-52', '-50', '51'];
|
|
2245
|
-
'-50': [-50, '-', '-51', '-49', '50'];
|
|
2246
|
-
'-49': [-49, '-', '-50', '-48', '49'];
|
|
2247
|
-
'-48': [-48, '-', '-49', '-47', '48'];
|
|
2248
|
-
'-47': [-47, '-', '-48', '-46', '47'];
|
|
2249
|
-
'-46': [-46, '-', '-47', '-45', '46'];
|
|
2250
|
-
'-45': [-45, '-', '-46', '-44', '45'];
|
|
2251
|
-
'-44': [-44, '-', '-45', '-43', '44'];
|
|
2252
|
-
'-43': [-43, '-', '-44', '-42', '43'];
|
|
2253
|
-
'-42': [-42, '-', '-43', '-41', '42'];
|
|
2254
|
-
'-41': [-41, '-', '-42', '-40', '41'];
|
|
2255
|
-
'-40': [-40, '-', '-41', '-39', '40'];
|
|
2256
|
-
'-39': [-39, '-', '-40', '-38', '39'];
|
|
2257
|
-
'-38': [-38, '-', '-39', '-37', '38'];
|
|
2258
|
-
'-37': [-37, '-', '-38', '-36', '37'];
|
|
2259
|
-
'-36': [-36, '-', '-37', '-35', '36'];
|
|
2260
|
-
'-35': [-35, '-', '-36', '-34', '35'];
|
|
2261
|
-
'-34': [-34, '-', '-35', '-33', '34'];
|
|
2262
|
-
'-33': [-33, '-', '-34', '-32', '33'];
|
|
2263
|
-
'-32': [-32, '-', '-33', '-31', '32'];
|
|
2264
|
-
'-31': [-31, '-', '-32', '-30', '31'];
|
|
2265
|
-
'-30': [-30, '-', '-31', '-29', '30'];
|
|
2266
|
-
'-29': [-29, '-', '-30', '-28', '29'];
|
|
2267
|
-
'-28': [-28, '-', '-29', '-27', '28'];
|
|
2268
|
-
'-27': [-27, '-', '-28', '-26', '27'];
|
|
2269
|
-
'-26': [-26, '-', '-27', '-25', '26'];
|
|
2270
|
-
'-25': [-25, '-', '-26', '-24', '25'];
|
|
2271
|
-
'-24': [-24, '-', '-25', '-23', '24'];
|
|
2272
|
-
'-23': [-23, '-', '-24', '-22', '23'];
|
|
2273
|
-
'-22': [-22, '-', '-23', '-21', '22'];
|
|
2274
|
-
'-21': [-21, '-', '-22', '-20', '21'];
|
|
2275
|
-
'-20': [-20, '-', '-21', '-19', '20'];
|
|
2276
|
-
'-19': [-19, '-', '-20', '-18', '19'];
|
|
2277
|
-
'-18': [-18, '-', '-19', '-17', '18'];
|
|
2278
|
-
'-17': [-17, '-', '-18', '-16', '17'];
|
|
2279
|
-
'-16': [-16, '-', '-17', '-15', '16'];
|
|
2280
|
-
'-15': [-15, '-', '-16', '-14', '15'];
|
|
2281
|
-
'-14': [-14, '-', '-15', '-13', '14'];
|
|
2282
|
-
'-13': [-13, '-', '-14', '-12', '13'];
|
|
2283
|
-
'-12': [-12, '-', '-13', '-11', '12'];
|
|
2284
|
-
'-11': [-11, '-', '-12', '-10', '11'];
|
|
2285
|
-
'-10': [-10, '-', '-11', '-9', '10'];
|
|
2286
|
-
'-9': [-9, '-', '-10', '-8', '9'];
|
|
2287
|
-
'-8': [-8, '-', '-9', '-7', '8'];
|
|
2288
|
-
'-7': [-7, '-', '-8', '-6', '7'];
|
|
2289
|
-
'-6': [-6, '-', '-7', '-5', '6'];
|
|
2290
|
-
'-5': [-5, '-', '-6', '-4', '5'];
|
|
2291
|
-
'-4': [-4, '-', '-5', '-3', '4'];
|
|
2292
|
-
'-3': [-3, '-', '-4', '-2', '3'];
|
|
2293
|
-
'-2': [-2, '-', '-3', '-1', '2'];
|
|
2294
|
-
'-1': [-1, '-', '-2', '0', '1'];
|
|
2295
|
-
'0': [0, '0', '-1', '1', '0'];
|
|
2296
|
-
'1': [1, '+', '0', '2', '-1'];
|
|
2297
|
-
'2': [2, '+', '1', '3', '-2'];
|
|
2298
|
-
'3': [3, '+', '2', '4', '-3'];
|
|
2299
|
-
'4': [4, '+', '3', '5', '-4'];
|
|
2300
|
-
'5': [5, '+', '4', '6', '-5'];
|
|
2301
|
-
'6': [6, '+', '5', '7', '-6'];
|
|
2302
|
-
'7': [7, '+', '6', '8', '-7'];
|
|
2303
|
-
'8': [8, '+', '7', '9', '-8'];
|
|
2304
|
-
'9': [9, '+', '8', '10', '-9'];
|
|
2305
|
-
'10': [10, '+', '9', '11', '-10'];
|
|
2306
|
-
'11': [11, '+', '10', '12', '-11'];
|
|
2307
|
-
'12': [12, '+', '11', '13', '-12'];
|
|
2308
|
-
'13': [13, '+', '12', '14', '-13'];
|
|
2309
|
-
'14': [14, '+', '13', '15', '-14'];
|
|
2310
|
-
'15': [15, '+', '14', '16', '-15'];
|
|
2311
|
-
'16': [16, '+', '15', '17', '-16'];
|
|
2312
|
-
'17': [17, '+', '16', '18', '-17'];
|
|
2313
|
-
'18': [18, '+', '17', '19', '-18'];
|
|
2314
|
-
'19': [19, '+', '18', '20', '-19'];
|
|
2315
|
-
'20': [20, '+', '19', '21', '-20'];
|
|
2316
|
-
'21': [21, '+', '20', '22', '-21'];
|
|
2317
|
-
'22': [22, '+', '21', '23', '-22'];
|
|
2318
|
-
'23': [23, '+', '22', '24', '-23'];
|
|
2319
|
-
'24': [24, '+', '23', '25', '-24'];
|
|
2320
|
-
'25': [25, '+', '24', '26', '-25'];
|
|
2321
|
-
'26': [26, '+', '25', '27', '-26'];
|
|
2322
|
-
'27': [27, '+', '26', '28', '-27'];
|
|
2323
|
-
'28': [28, '+', '27', '29', '-28'];
|
|
2324
|
-
'29': [29, '+', '28', '30', '-29'];
|
|
2325
|
-
'30': [30, '+', '29', '31', '-30'];
|
|
2326
|
-
'31': [31, '+', '30', '32', '-31'];
|
|
2327
|
-
'32': [32, '+', '31', '33', '-32'];
|
|
2328
|
-
'33': [33, '+', '32', '34', '-33'];
|
|
2329
|
-
'34': [34, '+', '33', '35', '-34'];
|
|
2330
|
-
'35': [35, '+', '34', '36', '-35'];
|
|
2331
|
-
'36': [36, '+', '35', '37', '-36'];
|
|
2332
|
-
'37': [37, '+', '36', '38', '-37'];
|
|
2333
|
-
'38': [38, '+', '37', '39', '-38'];
|
|
2334
|
-
'39': [39, '+', '38', '40', '-39'];
|
|
2335
|
-
'40': [40, '+', '39', '41', '-40'];
|
|
2336
|
-
'41': [41, '+', '40', '42', '-41'];
|
|
2337
|
-
'42': [42, '+', '41', '43', '-42'];
|
|
2338
|
-
'43': [43, '+', '42', '44', '-43'];
|
|
2339
|
-
'44': [44, '+', '43', '45', '-44'];
|
|
2340
|
-
'45': [45, '+', '44', '46', '-45'];
|
|
2341
|
-
'46': [46, '+', '45', '47', '-46'];
|
|
2342
|
-
'47': [47, '+', '46', '48', '-47'];
|
|
2343
|
-
'48': [48, '+', '47', '49', '-48'];
|
|
2344
|
-
'49': [49, '+', '48', '50', '-49'];
|
|
2345
|
-
'50': [50, '+', '49', '51', '-50'];
|
|
2346
|
-
'51': [51, '+', '50', '52', '-51'];
|
|
2347
|
-
'52': [52, '+', '51', '53', '-52'];
|
|
2348
|
-
'53': [53, '+', '52', '54', '-53'];
|
|
2349
|
-
'54': [54, '+', '53', '55', '-54'];
|
|
2350
|
-
'55': [55, '+', '54', '56', '-55'];
|
|
2351
|
-
'56': [56, '+', '55', '57', '-56'];
|
|
2352
|
-
'57': [57, '+', '56', '58', '-57'];
|
|
2353
|
-
'58': [58, '+', '57', '59', '-58'];
|
|
2354
|
-
'59': [59, '+', '58', '60', '-59'];
|
|
2355
|
-
'60': [60, '+', '59', '61', '-60'];
|
|
2356
|
-
'61': [61, '+', '60', '62', '-61'];
|
|
2357
|
-
'62': [62, '+', '61', '63', '-62'];
|
|
2358
|
-
'63': [63, '+', '62', '64', '-63'];
|
|
2359
|
-
'64': [64, '+', '63', '65', '-64'];
|
|
2360
|
-
'65': [65, '+', '64', '66', '-65'];
|
|
2361
|
-
'66': [66, '+', '65', '67', '-66'];
|
|
2362
|
-
'67': [67, '+', '66', '68', '-67'];
|
|
2363
|
-
'68': [68, '+', '67', '69', '-68'];
|
|
2364
|
-
'69': [69, '+', '68', '70', '-69'];
|
|
2365
|
-
'70': [70, '+', '69', '71', '-70'];
|
|
2366
|
-
'71': [71, '+', '70', '72', '-71'];
|
|
2367
|
-
'72': [72, '+', '71', '73', '-72'];
|
|
2368
|
-
'73': [73, '+', '72', '74', '-73'];
|
|
2369
|
-
'74': [74, '+', '73', '75', '-74'];
|
|
2370
|
-
'75': [75, '+', '74', '76', '-75'];
|
|
2371
|
-
'76': [76, '+', '75', '77', '-76'];
|
|
2372
|
-
'77': [77, '+', '76', '78', '-77'];
|
|
2373
|
-
'78': [78, '+', '77', '79', '-78'];
|
|
2374
|
-
'79': [79, '+', '78', '80', '-79'];
|
|
2375
|
-
'80': [80, '+', '79', '81', '-80'];
|
|
2376
|
-
'81': [81, '+', '80', '82', '-81'];
|
|
2377
|
-
'82': [82, '+', '81', '83', '-82'];
|
|
2378
|
-
'83': [83, '+', '82', '84', '-83'];
|
|
2379
|
-
'84': [84, '+', '83', '85', '-84'];
|
|
2380
|
-
'85': [85, '+', '84', '86', '-85'];
|
|
2381
|
-
'86': [86, '+', '85', '87', '-86'];
|
|
2382
|
-
'87': [87, '+', '86', '88', '-87'];
|
|
2383
|
-
'88': [88, '+', '87', '89', '-88'];
|
|
2384
|
-
'89': [89, '+', '88', '90', '-89'];
|
|
2385
|
-
'90': [90, '+', '89', '91', '-90'];
|
|
2386
|
-
'91': [91, '+', '90', '92', '-91'];
|
|
2387
|
-
'92': [92, '+', '91', '93', '-92'];
|
|
2388
|
-
'93': [93, '+', '92', '94', '-93'];
|
|
2389
|
-
'94': [94, '+', '93', '95', '-94'];
|
|
2390
|
-
'95': [95, '+', '94', '96', '-95'];
|
|
2391
|
-
'96': [96, '+', '95', '97', '-96'];
|
|
2392
|
-
'97': [97, '+', '96', '98', '-97'];
|
|
2393
|
-
'98': [98, '+', '97', '99', '-98'];
|
|
2394
|
-
'99': [99, '+', '98', '100', '-99'];
|
|
2395
|
-
'100': [100, '+', '99', '__', '-100'];
|
|
2396
|
-
};
|
|
1617
|
+
* 数组压缩为对象
|
|
1618
|
+
* - 将键数组和值(数组、函数或静态值)组合成对象
|
|
1619
|
+
*
|
|
1620
|
+
* @param keys 键数组
|
|
1621
|
+
* @param values 值数组、生成值的函数或静态值
|
|
1622
|
+
* @returns 生成的对象
|
|
1623
|
+
* @example
|
|
1624
|
+
* ```ts
|
|
1625
|
+
* arrayZipToObject(["a", "b"], [1, 2]); // { a: 1, b: 2 }
|
|
1626
|
+
* arrayZipToObject(["a", "b"], (k, i) => k + i); // { a: "a0", b: "b1" }
|
|
1627
|
+
* arrayZipToObject(["a", "b"], 1); // { a: 1, b: 1 }
|
|
1628
|
+
* ```
|
|
1629
|
+
*/
|
|
1630
|
+
declare function arrayZipToObject<const K$1 extends PropertyKey, const V$1>(keys: readonly K$1[], array: readonly V$1[]): Record<K$1, V$1>;
|
|
1631
|
+
declare function arrayZipToObject<const K$1 extends PropertyKey, const V$1>(keys: readonly K$1[], match: MatchFunction<K$1, V$1>): Record<K$1, V$1>;
|
|
1632
|
+
declare function arrayZipToObject<const K$1 extends PropertyKey, const V$1>(keys: readonly K$1[], value: V$1): Record<K$1, V$1>;
|
|
2397
1633
|
//#endregion
|
|
2398
|
-
//#region
|
|
1634
|
+
//#region src/utils/device/isBrowser.d.ts
|
|
1635
|
+
declare function isBrowser(): boolean;
|
|
1636
|
+
declare function isWebWorker(): boolean;
|
|
1637
|
+
//#endregion
|
|
1638
|
+
//#region src/utils/device/isMobile.d.ts
|
|
2399
1639
|
/**
|
|
2400
|
-
*
|
|
2401
|
-
*
|
|
2402
|
-
* @
|
|
1640
|
+
* 检测当前设备是否为移动设备
|
|
1641
|
+
*
|
|
1642
|
+
* @param maxWidth - 移动设备最大宽度(默认 768px)
|
|
1643
|
+
* @param dpi - 标准 DPI 基准(默认 160)
|
|
1644
|
+
* @returns 是否为移动设备
|
|
2403
1645
|
* @example
|
|
2404
1646
|
* ```ts
|
|
2405
|
-
*
|
|
1647
|
+
* // 假设 window.innerWidth = 500
|
|
1648
|
+
* isMobile(); // true
|
|
1649
|
+
* ```
|
|
1650
|
+
*/
|
|
1651
|
+
declare function isMobile(maxWidth?: number, dpi?: number): boolean;
|
|
1652
|
+
/**
|
|
1653
|
+
* 检测当前设备是否为IOS移动设备
|
|
2406
1654
|
*
|
|
2407
|
-
*
|
|
1655
|
+
* @param maxWidth - 移动设备最大宽度(默认 768px)
|
|
1656
|
+
* @param dpi - 标准 DPI 基准(默认 160)
|
|
1657
|
+
* @returns 是否为 iOS 移动设备 (iPhone/iPad/iPod 且非平板)
|
|
1658
|
+
* @example
|
|
1659
|
+
* ```ts
|
|
1660
|
+
* // UA contains iPhone
|
|
1661
|
+
* isIOSMobile(); // true
|
|
1662
|
+
* ```
|
|
1663
|
+
*/
|
|
1664
|
+
declare function isIOSMobile(maxWidth?: number, dpi?: number): boolean;
|
|
1665
|
+
//#endregion
|
|
1666
|
+
//#region src/utils/device/isTablet.d.ts
|
|
1667
|
+
/**
|
|
1668
|
+
* 检测当前设备是否为平板
|
|
2408
1669
|
*
|
|
2409
|
-
*
|
|
2410
|
-
*
|
|
1670
|
+
* @param minWidth - 平板最小宽度(默认 768px)
|
|
1671
|
+
* @param maxWidth - 平板最大宽度(默认 1200px)
|
|
1672
|
+
* @param dpi - 标准 DPI 基准(默认 160)
|
|
1673
|
+
* @returns 是否为平板设备
|
|
1674
|
+
* @example
|
|
1675
|
+
* ```ts
|
|
1676
|
+
* // 假设 window.innerWidth = 1000
|
|
1677
|
+
* isTablet(); // true
|
|
2411
1678
|
* ```
|
|
2412
1679
|
*/
|
|
2413
|
-
declare
|
|
1680
|
+
declare function isTablet(minWidth?: number, maxWidth?: number, dpi?: number): boolean;
|
|
2414
1681
|
//#endregion
|
|
2415
|
-
//#region
|
|
1682
|
+
//#region src/utils/function/to.d.ts
|
|
1683
|
+
/**
|
|
1684
|
+
*将 Promise 转换为 `[err, result]` 格式,方便 async/await 错误处理
|
|
1685
|
+
*
|
|
1686
|
+
* @param promise 待处理的 Promise
|
|
1687
|
+
* @param errorExt 附加到 error 对象的扩展信息(注意:如果原 error 是 Error 实例,扩展属性可能会覆盖或无法正确合并非枚举属性)
|
|
1688
|
+
* @returns `[err, null]` 或 `[null, data]`
|
|
1689
|
+
* @example
|
|
1690
|
+
* ```ts
|
|
1691
|
+
* const [err, data] = await to(someAsyncFunc());
|
|
1692
|
+
* if (err) return;
|
|
1693
|
+
* console.log(data);
|
|
1694
|
+
* ```
|
|
1695
|
+
*/
|
|
1696
|
+
declare function to<T, U$1 = Error>(promise: Readonly<Promise<T>>, errorExt?: PlainObject): Promise<[U$1, undefined] | [null, T]>;
|
|
1697
|
+
//#endregion
|
|
1698
|
+
//#region src/utils/math/mathToBignumber.d.ts
|
|
1699
|
+
/**
|
|
1700
|
+
* 将任意类型的值转换为 `math.bignumber`
|
|
1701
|
+
*
|
|
1702
|
+
* @param mathJsInstance mathJs 实例
|
|
1703
|
+
* @param value 任意类型的值
|
|
1704
|
+
* @param saveValue 安全值
|
|
1705
|
+
* @returns 转换后的 BigNumber
|
|
1706
|
+
* @example
|
|
1707
|
+
* ```ts
|
|
1708
|
+
* import { create, all } from "mathjs";
|
|
1709
|
+
* const math = create(all);
|
|
1710
|
+
* mathToBignumber(math, "0.1");
|
|
1711
|
+
* ```
|
|
1712
|
+
*/
|
|
1713
|
+
declare function mathToBignumber(mathJsInstance: MathJsInstance, value: unknown, saveValue?: BigNumber | undefined): BigNumber;
|
|
1714
|
+
//#endregion
|
|
1715
|
+
//#region src/utils/math/mathToDecimal.d.ts
|
|
1716
|
+
/**
|
|
1717
|
+
* 将任意类型的值转换为十进制数字字符串
|
|
1718
|
+
*
|
|
1719
|
+
* @param mathJsInstance mathJs 实例
|
|
1720
|
+
* @param value 任意类型的值
|
|
1721
|
+
* @param precision 精度
|
|
1722
|
+
* @param isFormat 是否格式化为字符串
|
|
1723
|
+
* @returns 格式化后的字符串或 BigNumber
|
|
1724
|
+
* @example
|
|
1725
|
+
* ```ts
|
|
1726
|
+
* mathToDecimal(math, 0.12345, 2); // "0.12"
|
|
1727
|
+
* ```
|
|
1728
|
+
*/
|
|
1729
|
+
declare function mathToDecimal(mathJsInstance: MathJsInstance, value: unknown, precision?: number | undefined, isFormat?: true): string;
|
|
1730
|
+
declare function mathToDecimal(mathJsInstance: MathJsInstance, value: unknown, precision?: number | undefined, isFormat?: false): BigNumber;
|
|
1731
|
+
//#endregion
|
|
1732
|
+
//#region src/utils/math/mathToEvaluate.d.ts
|
|
1733
|
+
/**
|
|
1734
|
+
* 数学表达式求值
|
|
1735
|
+
*
|
|
1736
|
+
* @param mathJsInstance mathJs 实例
|
|
1737
|
+
* @param expr 表达式
|
|
1738
|
+
* @param scope 键值映射
|
|
1739
|
+
* @returns 计算结果的字符串表示
|
|
1740
|
+
* @example
|
|
1741
|
+
* ```ts
|
|
1742
|
+
* mathToEvaluate(math, "a + b", { a: 1, b: 2 }); // "3"
|
|
1743
|
+
* ```
|
|
1744
|
+
*/
|
|
1745
|
+
declare function mathToEvaluate(mathJsInstance: MathJsInstance, expr: MathExpression | Matrix, scope?: Record<string, BigNumber>): string;
|
|
1746
|
+
//#endregion
|
|
1747
|
+
//#region src/utils/number/numberWithin.d.ts
|
|
1748
|
+
/**
|
|
1749
|
+
* 数字区间检查函数
|
|
1750
|
+
*
|
|
1751
|
+
* @param input 待检查数字
|
|
1752
|
+
* @param interval 由两个数字组成的元组 [left, right]
|
|
1753
|
+
* @param includeLeft 是否包含左边界(默认 true)
|
|
1754
|
+
* @param includeRight 是否包含右边界(默认 false)
|
|
1755
|
+
* @returns 是否在区间内
|
|
1756
|
+
* @example
|
|
1757
|
+
* ```ts
|
|
1758
|
+
* numberWithin(5, [1, 10]); // true
|
|
1759
|
+
* numberWithin(1, [1, 10], false); // false
|
|
1760
|
+
* ```
|
|
1761
|
+
*/
|
|
1762
|
+
declare function numberWithin(input: number, interval: [number, number], includeLeft?: boolean, includeRight?: boolean): boolean;
|
|
1763
|
+
//#endregion
|
|
1764
|
+
//#region src/utils/object/enumEntries.d.ts
|
|
1765
|
+
/**
|
|
1766
|
+
* 获取所有枚举成员的键/值数组
|
|
1767
|
+
*
|
|
1768
|
+
* @param enumeration 枚举对象
|
|
1769
|
+
* @returns 键值对数组
|
|
1770
|
+
* @example
|
|
1771
|
+
* ```ts
|
|
1772
|
+
* enum A { k = "v" }
|
|
1773
|
+
* enumEntries(A); // [["k", "v"]]
|
|
1774
|
+
* ```
|
|
1775
|
+
*/
|
|
1776
|
+
declare function enumEntries<E extends PlainObject>(enumeration: E): [keyof E, E[keyof E]][];
|
|
1777
|
+
declare function enumEntries<E extends AnyObject>(enumeration: E): [keyof E, E[keyof E]][];
|
|
1778
|
+
//#endregion
|
|
1779
|
+
//#region src/utils/object/enumKeys.d.ts
|
|
1780
|
+
/**
|
|
1781
|
+
* 获取所有枚举成员的键
|
|
1782
|
+
*
|
|
1783
|
+
* @param enumeration 枚举对象
|
|
1784
|
+
* @returns 键数组
|
|
1785
|
+
* @example
|
|
1786
|
+
* ```ts
|
|
1787
|
+
* enum A { k = "v" }
|
|
1788
|
+
* enumKeys(A); // ["k"]
|
|
1789
|
+
* ```
|
|
1790
|
+
*/
|
|
1791
|
+
declare function enumKeys<E extends PlainObject>(enumeration: E): (keyof E)[];
|
|
1792
|
+
declare function enumKeys<E extends AnyObject>(enumeration: E): (keyof E)[];
|
|
1793
|
+
//#endregion
|
|
1794
|
+
//#region src/utils/object/enumValues.d.ts
|
|
1795
|
+
/**
|
|
1796
|
+
* 获取所有枚举成员的值
|
|
1797
|
+
*
|
|
1798
|
+
* @param enumeration 枚举对象
|
|
1799
|
+
* @returns 值数组
|
|
1800
|
+
* @example
|
|
1801
|
+
* ```ts
|
|
1802
|
+
* enum A { k = "v" }
|
|
1803
|
+
* enumValues(A); // ["v"]
|
|
1804
|
+
* ```
|
|
1805
|
+
*/
|
|
1806
|
+
declare function enumValues<E extends PlainObject>(enumeration: E): UnionToTuple<ValueOf<E>>;
|
|
1807
|
+
declare function enumValues<E extends AnyObject>(enumeration: E): UnionToTuple<ValueOf<E>>;
|
|
1808
|
+
//#endregion
|
|
1809
|
+
//#region src/utils/object/objectMapEntries.d.ts
|
|
1810
|
+
/**
|
|
1811
|
+
* 映射对象条目
|
|
1812
|
+
* - 将对象的键值对映射为新的键值对
|
|
1813
|
+
*
|
|
1814
|
+
* @param plainObject 对象
|
|
1815
|
+
* @param toEntry 映射函数
|
|
1816
|
+
* @returns 映射后的新对象
|
|
1817
|
+
* @example
|
|
1818
|
+
* ```ts
|
|
1819
|
+
* const obj = { a: 1, b: 2 };
|
|
1820
|
+
* objectMapEntries(obj, (k, v) => [k, v * 2]); // { a: 2, b: 4 }
|
|
1821
|
+
* ```
|
|
1822
|
+
*/
|
|
1823
|
+
declare function objectMapEntries<O extends PlainObject, NK extends PropertyKey, NV>(plainObject: O, toEntry: (key: keyof O, value: O[keyof O]) => [NK, NV]): PlainObject<NK, NV>;
|
|
1824
|
+
//#endregion
|
|
1825
|
+
//#region node_modules/.pnpm/radashi@12.7.2/node_modules/radashi/dist/radashi.d.cts
|
|
1826
|
+
interface BigInt {
|
|
1827
|
+
/**
|
|
1828
|
+
* Returns a string representation of an object.
|
|
1829
|
+
* @param radix Specifies a radix for converting numeric values to strings.
|
|
1830
|
+
*/
|
|
1831
|
+
toString(radix?: number): string;
|
|
1832
|
+
/** Returns a string representation appropriate to the host environment's current locale. */
|
|
1833
|
+
toLocaleString(locales?: any, options?: BigIntToLocaleStringOptions): string;
|
|
1834
|
+
/** Returns the primitive value of the specified object. */
|
|
1835
|
+
valueOf(): bigint;
|
|
1836
|
+
readonly [Symbol.toStringTag]: "BigInt";
|
|
1837
|
+
}
|
|
1838
|
+
/**
|
|
1839
|
+
* A typed array of 64-bit signed integer values. The contents are initialized to 0. If the
|
|
1840
|
+
* requested number of bytes could not be allocated, an exception is raised.
|
|
1841
|
+
*/
|
|
1842
|
+
interface BigInt64Array$1 {
|
|
1843
|
+
/** The size in bytes of each element in the array. */
|
|
1844
|
+
readonly BYTES_PER_ELEMENT: number;
|
|
1845
|
+
/** The ArrayBuffer instance referenced by the array. */
|
|
1846
|
+
readonly buffer: ArrayBufferLike;
|
|
1847
|
+
/** The length in bytes of the array. */
|
|
1848
|
+
readonly byteLength: number;
|
|
1849
|
+
/** The offset in bytes of the array. */
|
|
1850
|
+
readonly byteOffset: number;
|
|
1851
|
+
/**
|
|
1852
|
+
* Returns the this object after copying a section of the array identified by start and end
|
|
1853
|
+
* to the same array starting at position target
|
|
1854
|
+
* @param target If target is negative, it is treated as length+target where length is the
|
|
1855
|
+
* length of the array.
|
|
1856
|
+
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
1857
|
+
* is treated as length+end.
|
|
1858
|
+
* @param end If not specified, length of the this object is used as its default value.
|
|
1859
|
+
*/
|
|
1860
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
1861
|
+
/** Yields index, value pairs for every entry in the array. */
|
|
1862
|
+
entries(): IterableIterator<[number, bigint]>;
|
|
1863
|
+
/**
|
|
1864
|
+
* Determines whether all the members of an array satisfy the specified test.
|
|
1865
|
+
* @param predicate A function that accepts up to three arguments. The every method calls
|
|
1866
|
+
* the predicate function for each element in the array until the predicate returns false,
|
|
1867
|
+
* or until the end of the array.
|
|
1868
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
1869
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
1870
|
+
*/
|
|
1871
|
+
every(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): boolean;
|
|
1872
|
+
/**
|
|
1873
|
+
* Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
|
|
1874
|
+
* @param value value to fill array section with
|
|
1875
|
+
* @param start index to start filling the array at. If start is negative, it is treated as
|
|
1876
|
+
* length+start where length is the length of the array.
|
|
1877
|
+
* @param end index to stop filling the array at. If end is negative, it is treated as
|
|
1878
|
+
* length+end.
|
|
1879
|
+
*/
|
|
1880
|
+
fill(value: bigint, start?: number, end?: number): this;
|
|
1881
|
+
/**
|
|
1882
|
+
* Returns the elements of an array that meet the condition specified in a callback function.
|
|
1883
|
+
* @param predicate A function that accepts up to three arguments. The filter method calls
|
|
1884
|
+
* the predicate function one time for each element in the array.
|
|
1885
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
1886
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
1887
|
+
*/
|
|
1888
|
+
filter(predicate: (value: bigint, index: number, array: BigInt64Array$1) => any, thisArg?: any): BigInt64Array$1;
|
|
1889
|
+
/**
|
|
1890
|
+
* Returns the value of the first element in the array where predicate is true, and undefined
|
|
1891
|
+
* otherwise.
|
|
1892
|
+
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
1893
|
+
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
1894
|
+
* immediately returns that element value. Otherwise, find returns undefined.
|
|
1895
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
1896
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
1897
|
+
*/
|
|
1898
|
+
find(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): bigint | undefined;
|
|
1899
|
+
/**
|
|
1900
|
+
* Returns the index of the first element in the array where predicate is true, and -1
|
|
1901
|
+
* otherwise.
|
|
1902
|
+
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
1903
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
1904
|
+
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
|
|
1905
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
1906
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
1907
|
+
*/
|
|
1908
|
+
findIndex(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): number;
|
|
1909
|
+
/**
|
|
1910
|
+
* Performs the specified action for each element in an array.
|
|
1911
|
+
* @param callbackfn A function that accepts up to three arguments. forEach calls the
|
|
1912
|
+
* callbackfn function one time for each element in the array.
|
|
1913
|
+
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
|
|
1914
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
1915
|
+
*/
|
|
1916
|
+
forEach(callbackfn: (value: bigint, index: number, array: BigInt64Array$1) => void, thisArg?: any): void;
|
|
1917
|
+
/**
|
|
1918
|
+
* Determines whether an array includes a certain element, returning true or false as appropriate.
|
|
1919
|
+
* @param searchElement The element to search for.
|
|
1920
|
+
* @param fromIndex The position in this array at which to begin searching for searchElement.
|
|
1921
|
+
*/
|
|
1922
|
+
includes(searchElement: bigint, fromIndex?: number): boolean;
|
|
1923
|
+
/**
|
|
1924
|
+
* Returns the index of the first occurrence of a value in an array.
|
|
1925
|
+
* @param searchElement The value to locate in the array.
|
|
1926
|
+
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
|
|
1927
|
+
* search starts at index 0.
|
|
1928
|
+
*/
|
|
1929
|
+
indexOf(searchElement: bigint, fromIndex?: number): number;
|
|
1930
|
+
/**
|
|
1931
|
+
* Adds all the elements of an array separated by the specified separator string.
|
|
1932
|
+
* @param separator A string used to separate one element of an array from the next in the
|
|
1933
|
+
* resulting String. If omitted, the array elements are separated with a comma.
|
|
1934
|
+
*/
|
|
1935
|
+
join(separator?: string): string;
|
|
1936
|
+
/** Yields each index in the array. */
|
|
1937
|
+
keys(): IterableIterator<number>;
|
|
1938
|
+
/**
|
|
1939
|
+
* Returns the index of the last occurrence of a value in an array.
|
|
1940
|
+
* @param searchElement The value to locate in the array.
|
|
1941
|
+
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
|
|
1942
|
+
* search starts at index 0.
|
|
1943
|
+
*/
|
|
1944
|
+
lastIndexOf(searchElement: bigint, fromIndex?: number): number;
|
|
1945
|
+
/** The length of the array. */
|
|
1946
|
+
readonly length: number;
|
|
1947
|
+
/**
|
|
1948
|
+
* Calls a defined callback function on each element of an array, and returns an array that
|
|
1949
|
+
* contains the results.
|
|
1950
|
+
* @param callbackfn A function that accepts up to three arguments. The map method calls the
|
|
1951
|
+
* callbackfn function one time for each element in the array.
|
|
1952
|
+
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
|
|
1953
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
1954
|
+
*/
|
|
1955
|
+
map(callbackfn: (value: bigint, index: number, array: BigInt64Array$1) => bigint, thisArg?: any): BigInt64Array$1;
|
|
1956
|
+
/**
|
|
1957
|
+
* Calls the specified callback function for all the elements in an array. The return value of
|
|
1958
|
+
* the callback function is the accumulated result, and is provided as an argument in the next
|
|
1959
|
+
* call to the callback function.
|
|
1960
|
+
* @param callbackfn A function that accepts up to four arguments. The reduce method calls the
|
|
1961
|
+
* callbackfn function one time for each element in the array.
|
|
1962
|
+
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
1963
|
+
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
|
1964
|
+
* instead of an array value.
|
|
1965
|
+
*/
|
|
1966
|
+
reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => bigint): bigint;
|
|
1967
|
+
/**
|
|
1968
|
+
* Calls the specified callback function for all the elements in an array. The return value of
|
|
1969
|
+
* the callback function is the accumulated result, and is provided as an argument in the next
|
|
1970
|
+
* call to the callback function.
|
|
1971
|
+
* @param callbackfn A function that accepts up to four arguments. The reduce method calls the
|
|
1972
|
+
* callbackfn function one time for each element in the array.
|
|
1973
|
+
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
1974
|
+
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
|
1975
|
+
* instead of an array value.
|
|
1976
|
+
*/
|
|
1977
|
+
reduce<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => U$1, initialValue: U$1): U$1;
|
|
1978
|
+
/**
|
|
1979
|
+
* Calls the specified callback function for all the elements in an array, in descending order.
|
|
1980
|
+
* The return value of the callback function is the accumulated result, and is provided as an
|
|
1981
|
+
* argument in the next call to the callback function.
|
|
1982
|
+
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
|
|
1983
|
+
* the callbackfn function one time for each element in the array.
|
|
1984
|
+
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
1985
|
+
* the accumulation. The first call to the callbackfn function provides this value as an
|
|
1986
|
+
* argument instead of an array value.
|
|
1987
|
+
*/
|
|
1988
|
+
reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => bigint): bigint;
|
|
1989
|
+
/**
|
|
1990
|
+
* Calls the specified callback function for all the elements in an array, in descending order.
|
|
1991
|
+
* The return value of the callback function is the accumulated result, and is provided as an
|
|
1992
|
+
* argument in the next call to the callback function.
|
|
1993
|
+
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
|
|
1994
|
+
* the callbackfn function one time for each element in the array.
|
|
1995
|
+
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
1996
|
+
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
|
1997
|
+
* instead of an array value.
|
|
1998
|
+
*/
|
|
1999
|
+
reduceRight<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigInt64Array$1) => U$1, initialValue: U$1): U$1;
|
|
2000
|
+
/** Reverses the elements in the array. */
|
|
2001
|
+
reverse(): this;
|
|
2002
|
+
/**
|
|
2003
|
+
* Sets a value or an array of values.
|
|
2004
|
+
* @param array A typed or untyped array of values to set.
|
|
2005
|
+
* @param offset The index in the current array at which the values are to be written.
|
|
2006
|
+
*/
|
|
2007
|
+
set(array: ArrayLike<bigint>, offset?: number): void;
|
|
2008
|
+
/**
|
|
2009
|
+
* Returns a section of an array.
|
|
2010
|
+
* @param start The beginning of the specified portion of the array.
|
|
2011
|
+
* @param end The end of the specified portion of the array.
|
|
2012
|
+
*/
|
|
2013
|
+
slice(start?: number, end?: number): BigInt64Array$1;
|
|
2014
|
+
/**
|
|
2015
|
+
* Determines whether the specified callback function returns true for any element of an array.
|
|
2016
|
+
* @param predicate A function that accepts up to three arguments. The some method calls the
|
|
2017
|
+
* predicate function for each element in the array until the predicate returns true, or until
|
|
2018
|
+
* the end of the array.
|
|
2019
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
2020
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
2021
|
+
*/
|
|
2022
|
+
some(predicate: (value: bigint, index: number, array: BigInt64Array$1) => boolean, thisArg?: any): boolean;
|
|
2023
|
+
/**
|
|
2024
|
+
* Sorts the array.
|
|
2025
|
+
* @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.
|
|
2026
|
+
*/
|
|
2027
|
+
sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;
|
|
2028
|
+
/**
|
|
2029
|
+
* Gets a new BigInt64Array view of the ArrayBuffer store for this array, referencing the elements
|
|
2030
|
+
* at begin, inclusive, up to end, exclusive.
|
|
2031
|
+
* @param begin The index of the beginning of the array.
|
|
2032
|
+
* @param end The index of the end of the array.
|
|
2033
|
+
*/
|
|
2034
|
+
subarray(begin?: number, end?: number): BigInt64Array$1;
|
|
2035
|
+
/** Converts the array to a string by using the current locale. */
|
|
2036
|
+
toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;
|
|
2037
|
+
/** Returns a string representation of the array. */
|
|
2038
|
+
toString(): string;
|
|
2039
|
+
/** Returns the primitive value of the specified object. */
|
|
2040
|
+
valueOf(): BigInt64Array$1;
|
|
2041
|
+
/** Yields each value in the array. */
|
|
2042
|
+
values(): IterableIterator<bigint>;
|
|
2043
|
+
[Symbol.iterator](): IterableIterator<bigint>;
|
|
2044
|
+
readonly [Symbol.toStringTag]: "BigInt64Array";
|
|
2045
|
+
[index: number]: bigint;
|
|
2046
|
+
}
|
|
2416
2047
|
/**
|
|
2417
|
-
*
|
|
2418
|
-
*
|
|
2419
|
-
* @param N to transform
|
|
2420
|
-
* @returns [[Iteration]]
|
|
2421
|
-
* @example
|
|
2422
|
-
* ```ts
|
|
2423
|
-
* import {I} from 'ts-toolbelt'
|
|
2424
|
-
*
|
|
2425
|
-
* type i = I.IterationOf<0> // ["-1", "1", "0", 0, "0"]
|
|
2426
|
-
*
|
|
2427
|
-
* type next = I.Next<i> // ["0", "2", "1", 1, "+"]
|
|
2428
|
-
* type prev = I.Prev<i> // ["-2", "0", "-1", -1, "-"]
|
|
2429
|
-
*
|
|
2430
|
-
* type nnext = I.Pos<next> // +1
|
|
2431
|
-
* type nprev = I.Pos<prev> // -1
|
|
2432
|
-
* ```
|
|
2048
|
+
* A typed array of 64-bit unsigned integer values. The contents are initialized to 0. If the
|
|
2049
|
+
* requested number of bytes could not be allocated, an exception is raised.
|
|
2433
2050
|
*/
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2051
|
+
interface BigUint64Array$1 {
|
|
2052
|
+
/** The size in bytes of each element in the array. */
|
|
2053
|
+
readonly BYTES_PER_ELEMENT: number;
|
|
2054
|
+
/** The ArrayBuffer instance referenced by the array. */
|
|
2055
|
+
readonly buffer: ArrayBufferLike;
|
|
2056
|
+
/** The length in bytes of the array. */
|
|
2057
|
+
readonly byteLength: number;
|
|
2058
|
+
/** The offset in bytes of the array. */
|
|
2059
|
+
readonly byteOffset: number;
|
|
2060
|
+
/**
|
|
2061
|
+
* Returns the this object after copying a section of the array identified by start and end
|
|
2062
|
+
* to the same array starting at position target
|
|
2063
|
+
* @param target If target is negative, it is treated as length+target where length is the
|
|
2064
|
+
* length of the array.
|
|
2065
|
+
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
2066
|
+
* is treated as length+end.
|
|
2067
|
+
* @param end If not specified, length of the this object is used as its default value.
|
|
2068
|
+
*/
|
|
2069
|
+
copyWithin(target: number, start: number, end?: number): this;
|
|
2070
|
+
/** Yields index, value pairs for every entry in the array. */
|
|
2071
|
+
entries(): IterableIterator<[number, bigint]>;
|
|
2072
|
+
/**
|
|
2073
|
+
* Determines whether all the members of an array satisfy the specified test.
|
|
2074
|
+
* @param predicate A function that accepts up to three arguments. The every method calls
|
|
2075
|
+
* the predicate function for each element in the array until the predicate returns false,
|
|
2076
|
+
* or until the end of the array.
|
|
2077
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
2078
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
2079
|
+
*/
|
|
2080
|
+
every(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): boolean;
|
|
2081
|
+
/**
|
|
2082
|
+
* Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
|
|
2083
|
+
* @param value value to fill array section with
|
|
2084
|
+
* @param start index to start filling the array at. If start is negative, it is treated as
|
|
2085
|
+
* length+start where length is the length of the array.
|
|
2086
|
+
* @param end index to stop filling the array at. If end is negative, it is treated as
|
|
2087
|
+
* length+end.
|
|
2088
|
+
*/
|
|
2089
|
+
fill(value: bigint, start?: number, end?: number): this;
|
|
2090
|
+
/**
|
|
2091
|
+
* Returns the elements of an array that meet the condition specified in a callback function.
|
|
2092
|
+
* @param predicate A function that accepts up to three arguments. The filter method calls
|
|
2093
|
+
* the predicate function one time for each element in the array.
|
|
2094
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
2095
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
2096
|
+
*/
|
|
2097
|
+
filter(predicate: (value: bigint, index: number, array: BigUint64Array$1) => any, thisArg?: any): BigUint64Array$1;
|
|
2098
|
+
/**
|
|
2099
|
+
* Returns the value of the first element in the array where predicate is true, and undefined
|
|
2100
|
+
* otherwise.
|
|
2101
|
+
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
2102
|
+
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
2103
|
+
* immediately returns that element value. Otherwise, find returns undefined.
|
|
2104
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
2105
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
2106
|
+
*/
|
|
2107
|
+
find(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): bigint | undefined;
|
|
2108
|
+
/**
|
|
2109
|
+
* Returns the index of the first element in the array where predicate is true, and -1
|
|
2110
|
+
* otherwise.
|
|
2111
|
+
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
2112
|
+
* order, until it finds one where predicate returns true. If such an element is found,
|
|
2113
|
+
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
|
|
2114
|
+
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
2115
|
+
* predicate. If it is not provided, undefined is used instead.
|
|
2116
|
+
*/
|
|
2117
|
+
findIndex(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): number;
|
|
2118
|
+
/**
|
|
2119
|
+
* Performs the specified action for each element in an array.
|
|
2120
|
+
* @param callbackfn A function that accepts up to three arguments. forEach calls the
|
|
2121
|
+
* callbackfn function one time for each element in the array.
|
|
2122
|
+
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
|
|
2123
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
2124
|
+
*/
|
|
2125
|
+
forEach(callbackfn: (value: bigint, index: number, array: BigUint64Array$1) => void, thisArg?: any): void;
|
|
2126
|
+
/**
|
|
2127
|
+
* Determines whether an array includes a certain element, returning true or false as appropriate.
|
|
2128
|
+
* @param searchElement The element to search for.
|
|
2129
|
+
* @param fromIndex The position in this array at which to begin searching for searchElement.
|
|
2130
|
+
*/
|
|
2131
|
+
includes(searchElement: bigint, fromIndex?: number): boolean;
|
|
2132
|
+
/**
|
|
2133
|
+
* Returns the index of the first occurrence of a value in an array.
|
|
2134
|
+
* @param searchElement The value to locate in the array.
|
|
2135
|
+
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
|
|
2136
|
+
* search starts at index 0.
|
|
2137
|
+
*/
|
|
2138
|
+
indexOf(searchElement: bigint, fromIndex?: number): number;
|
|
2139
|
+
/**
|
|
2140
|
+
* Adds all the elements of an array separated by the specified separator string.
|
|
2141
|
+
* @param separator A string used to separate one element of an array from the next in the
|
|
2142
|
+
* resulting String. If omitted, the array elements are separated with a comma.
|
|
2143
|
+
*/
|
|
2144
|
+
join(separator?: string): string;
|
|
2145
|
+
/** Yields each index in the array. */
|
|
2146
|
+
keys(): IterableIterator<number>;
|
|
2147
|
+
/**
|
|
2148
|
+
* Returns the index of the last occurrence of a value in an array.
|
|
2149
|
+
* @param searchElement The value to locate in the array.
|
|
2150
|
+
* @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
|
|
2151
|
+
* search starts at index 0.
|
|
2152
|
+
*/
|
|
2153
|
+
lastIndexOf(searchElement: bigint, fromIndex?: number): number;
|
|
2154
|
+
/** The length of the array. */
|
|
2155
|
+
readonly length: number;
|
|
2156
|
+
/**
|
|
2157
|
+
* Calls a defined callback function on each element of an array, and returns an array that
|
|
2158
|
+
* contains the results.
|
|
2159
|
+
* @param callbackfn A function that accepts up to three arguments. The map method calls the
|
|
2160
|
+
* callbackfn function one time for each element in the array.
|
|
2161
|
+
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
|
|
2162
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
2163
|
+
*/
|
|
2164
|
+
map(callbackfn: (value: bigint, index: number, array: BigUint64Array$1) => bigint, thisArg?: any): BigUint64Array$1;
|
|
2165
|
+
/**
|
|
2166
|
+
* Calls the specified callback function for all the elements in an array. The return value of
|
|
2167
|
+
* the callback function is the accumulated result, and is provided as an argument in the next
|
|
2168
|
+
* call to the callback function.
|
|
2169
|
+
* @param callbackfn A function that accepts up to four arguments. The reduce method calls the
|
|
2170
|
+
* callbackfn function one time for each element in the array.
|
|
2171
|
+
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
2172
|
+
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
|
2173
|
+
* instead of an array value.
|
|
2174
|
+
*/
|
|
2175
|
+
reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => bigint): bigint;
|
|
2176
|
+
/**
|
|
2177
|
+
* Calls the specified callback function for all the elements in an array. The return value of
|
|
2178
|
+
* the callback function is the accumulated result, and is provided as an argument in the next
|
|
2179
|
+
* call to the callback function.
|
|
2180
|
+
* @param callbackfn A function that accepts up to four arguments. The reduce method calls the
|
|
2181
|
+
* callbackfn function one time for each element in the array.
|
|
2182
|
+
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
2183
|
+
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
|
2184
|
+
* instead of an array value.
|
|
2185
|
+
*/
|
|
2186
|
+
reduce<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => U$1, initialValue: U$1): U$1;
|
|
2187
|
+
/**
|
|
2188
|
+
* Calls the specified callback function for all the elements in an array, in descending order.
|
|
2189
|
+
* The return value of the callback function is the accumulated result, and is provided as an
|
|
2190
|
+
* argument in the next call to the callback function.
|
|
2191
|
+
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
|
|
2192
|
+
* the callbackfn function one time for each element in the array.
|
|
2193
|
+
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
2194
|
+
* the accumulation. The first call to the callbackfn function provides this value as an
|
|
2195
|
+
* argument instead of an array value.
|
|
2196
|
+
*/
|
|
2197
|
+
reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => bigint): bigint;
|
|
2198
|
+
/**
|
|
2199
|
+
* Calls the specified callback function for all the elements in an array, in descending order.
|
|
2200
|
+
* The return value of the callback function is the accumulated result, and is provided as an
|
|
2201
|
+
* argument in the next call to the callback function.
|
|
2202
|
+
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
|
|
2203
|
+
* the callbackfn function one time for each element in the array.
|
|
2204
|
+
* @param initialValue If initialValue is specified, it is used as the initial value to start
|
|
2205
|
+
* the accumulation. The first call to the callbackfn function provides this value as an argument
|
|
2206
|
+
* instead of an array value.
|
|
2207
|
+
*/
|
|
2208
|
+
reduceRight<U$1>(callbackfn: (previousValue: U$1, currentValue: bigint, currentIndex: number, array: BigUint64Array$1) => U$1, initialValue: U$1): U$1;
|
|
2209
|
+
/** Reverses the elements in the array. */
|
|
2210
|
+
reverse(): this;
|
|
2211
|
+
/**
|
|
2212
|
+
* Sets a value or an array of values.
|
|
2213
|
+
* @param array A typed or untyped array of values to set.
|
|
2214
|
+
* @param offset The index in the current array at which the values are to be written.
|
|
2215
|
+
*/
|
|
2216
|
+
set(array: ArrayLike<bigint>, offset?: number): void;
|
|
2217
|
+
/**
|
|
2218
|
+
* Returns a section of an array.
|
|
2219
|
+
* @param start The beginning of the specified portion of the array.
|
|
2220
|
+
* @param end The end of the specified portion of the array.
|
|
2221
|
+
*/
|
|
2222
|
+
slice(start?: number, end?: number): BigUint64Array$1;
|
|
2223
|
+
/**
|
|
2224
|
+
* Determines whether the specified callback function returns true for any element of an array.
|
|
2225
|
+
* @param predicate A function that accepts up to three arguments. The some method calls the
|
|
2226
|
+
* predicate function for each element in the array until the predicate returns true, or until
|
|
2227
|
+
* the end of the array.
|
|
2228
|
+
* @param thisArg An object to which the this keyword can refer in the predicate function.
|
|
2229
|
+
* If thisArg is omitted, undefined is used as the this value.
|
|
2230
|
+
*/
|
|
2231
|
+
some(predicate: (value: bigint, index: number, array: BigUint64Array$1) => boolean, thisArg?: any): boolean;
|
|
2232
|
+
/**
|
|
2233
|
+
* Sorts the array.
|
|
2234
|
+
* @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order.
|
|
2235
|
+
*/
|
|
2236
|
+
sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this;
|
|
2237
|
+
/**
|
|
2238
|
+
* Gets a new BigUint64Array view of the ArrayBuffer store for this array, referencing the elements
|
|
2239
|
+
* at begin, inclusive, up to end, exclusive.
|
|
2240
|
+
* @param begin The index of the beginning of the array.
|
|
2241
|
+
* @param end The index of the end of the array.
|
|
2242
|
+
*/
|
|
2243
|
+
subarray(begin?: number, end?: number): BigUint64Array$1;
|
|
2244
|
+
/** Converts the array to a string by using the current locale. */
|
|
2245
|
+
toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;
|
|
2246
|
+
/** Returns a string representation of the array. */
|
|
2247
|
+
toString(): string;
|
|
2248
|
+
/** Returns the primitive value of the specified object. */
|
|
2249
|
+
valueOf(): BigUint64Array$1;
|
|
2250
|
+
/** Yields each value in the array. */
|
|
2251
|
+
values(): IterableIterator<bigint>;
|
|
2252
|
+
[Symbol.iterator](): IterableIterator<bigint>;
|
|
2253
|
+
readonly [Symbol.toStringTag]: "BigUint64Array";
|
|
2254
|
+
[index: number]: bigint;
|
|
2255
|
+
}
|
|
2256
|
+
interface BigIntToLocaleStringOptions {
|
|
2257
|
+
/**
|
|
2258
|
+
* 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}.
|
|
2259
|
+
*/
|
|
2260
|
+
localeMatcher?: string;
|
|
2261
|
+
/**
|
|
2262
|
+
* The formatting style to use , the default is "decimal".
|
|
2263
|
+
*/
|
|
2264
|
+
style?: string;
|
|
2265
|
+
numberingSystem?: string;
|
|
2266
|
+
/**
|
|
2267
|
+
* 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.
|
|
2268
|
+
*/
|
|
2269
|
+
unit?: string;
|
|
2270
|
+
/**
|
|
2271
|
+
* The unit formatting style to use in unit formatting, the defaults is "short".
|
|
2272
|
+
*/
|
|
2273
|
+
unitDisplay?: string;
|
|
2274
|
+
/**
|
|
2275
|
+
* 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".
|
|
2276
|
+
*/
|
|
2277
|
+
currency?: string;
|
|
2278
|
+
/**
|
|
2279
|
+
* How to display the currency in currency formatting. It is only used when [[Style]] has the value "currency". The default is "symbol".
|
|
2280
|
+
*
|
|
2281
|
+
* "symbol" to use a localized currency symbol such as €,
|
|
2282
|
+
*
|
|
2283
|
+
* "code" to use the ISO currency code,
|
|
2284
|
+
*
|
|
2285
|
+
* "name" to use a localized currency name such as "dollar"
|
|
2286
|
+
*/
|
|
2287
|
+
currencyDisplay?: string;
|
|
2288
|
+
/**
|
|
2289
|
+
* Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. The default is true.
|
|
2290
|
+
*/
|
|
2291
|
+
useGrouping?: boolean;
|
|
2292
|
+
/**
|
|
2293
|
+
* The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1.
|
|
2294
|
+
*/
|
|
2295
|
+
minimumIntegerDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
|
|
2296
|
+
/**
|
|
2297
|
+
* 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).
|
|
2298
|
+
*/
|
|
2299
|
+
minimumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
|
|
2300
|
+
/**
|
|
2301
|
+
* 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.
|
|
2302
|
+
*/
|
|
2303
|
+
maximumFractionDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;
|
|
2304
|
+
/**
|
|
2305
|
+
* The minimum number of significant digits to use. Possible values are from 1 to 21; the default is 1.
|
|
2306
|
+
*/
|
|
2307
|
+
minimumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
|
|
2308
|
+
/**
|
|
2309
|
+
* The maximum number of significant digits to use. Possible values are from 1 to 21; the default is 21.
|
|
2310
|
+
*/
|
|
2311
|
+
maximumSignificantDigits?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21;
|
|
2312
|
+
/**
|
|
2313
|
+
* The formatting that should be displayed for the number, the defaults is "standard"
|
|
2314
|
+
*
|
|
2315
|
+
* "standard" plain number formatting
|
|
2316
|
+
*
|
|
2317
|
+
* "scientific" return the order-of-magnitude for formatted number.
|
|
2318
|
+
*
|
|
2319
|
+
* "engineering" return the exponent of ten when divisible by three
|
|
2320
|
+
*
|
|
2321
|
+
* "compact" string representing exponent, defaults is using the "short" form
|
|
2322
|
+
*/
|
|
2323
|
+
notation?: string;
|
|
2324
|
+
/**
|
|
2325
|
+
* used only when notation is "compact"
|
|
2326
|
+
*/
|
|
2327
|
+
compactDisplay?: string;
|
|
2328
|
+
}
|
|
2437
2329
|
/**
|
|
2438
|
-
*
|
|
2439
|
-
*
|
|
2440
|
-
* @returns `number`
|
|
2441
|
-
* @example
|
|
2442
|
-
* ```ts
|
|
2443
|
-
* import {I} from 'ts-toolbelt'
|
|
2444
|
-
*
|
|
2445
|
-
* type i = I.IterationOf<'20'>
|
|
2330
|
+
* The `Any` class does not exist at runtime. It's used in type
|
|
2331
|
+
* definitions to detect an `any` type.
|
|
2446
2332
|
*
|
|
2447
|
-
* type test0 = I.Pos<i> // 20
|
|
2448
|
-
* type test1 = I.Pos<I.Next<i>> // 21
|
|
2449
|
-
* ```
|
|
2450
|
-
*/
|
|
2451
|
-
declare type Pos<I$1 extends Iteration> = I$1[0];
|
|
2452
|
-
//#endregion
|
|
2453
|
-
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Tail.d.ts
|
|
2454
|
-
/**
|
|
2455
|
-
* Remove the first item out of a [[List]]
|
|
2456
|
-
* @param L
|
|
2457
|
-
* @returns [[List]]
|
|
2458
|
-
* @example
|
|
2459
|
-
* ```ts
|
|
2460
|
-
* ```
|
|
2461
|
-
*/
|
|
2462
|
-
declare type Tail$1<L extends List> = L extends readonly [] ? L : L extends readonly [any?, ...infer LTail] ? LTail : L;
|
|
2463
|
-
//#endregion
|
|
2464
|
-
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Union/IntersectOf.d.ts
|
|
2465
|
-
/**
|
|
2466
|
-
* Transform a [[Union]] to an * *intersection**
|
|
2467
|
-
* @param U to transform
|
|
2468
|
-
* @returns `&`
|
|
2469
|
-
* @example
|
|
2470
|
-
* ```ts
|
|
2471
|
-
* ```
|
|
2472
|
-
*/
|
|
2473
|
-
declare type IntersectOf<U$1 extends any> = (U$1 extends unknown ? (k: U$1) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
2474
|
-
//#endregion
|
|
2475
|
-
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Object/Overwrite.d.ts
|
|
2476
|
-
/**
|
|
2477
|
-
* Update the fields of `O` with the ones of `O1`
|
|
2478
|
-
* (only the existing fields will be updated)
|
|
2479
|
-
* @param O to update
|
|
2480
|
-
* @param O1 to update with
|
|
2481
|
-
* @returns [[Object]]
|
|
2482
|
-
* @example
|
|
2483
2333
|
* ```ts
|
|
2334
|
+
* type IsAny<T> = [T] extends [Any] ? 'is any' : 'is not any'
|
|
2484
2335
|
* ```
|
|
2485
2336
|
*/
|
|
2486
|
-
declare
|
|
2487
|
-
|
|
2488
|
-
|
|
2337
|
+
declare class Any {
|
|
2338
|
+
private any;
|
|
2339
|
+
}
|
|
2489
2340
|
/**
|
|
2490
|
-
*
|
|
2341
|
+
* Represents a class constructor.
|
|
2491
2342
|
*/
|
|
2492
|
-
|
|
2493
|
-
//#endregion
|
|
2494
|
-
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Prepend.d.ts
|
|
2343
|
+
|
|
2495
2344
|
/**
|
|
2496
|
-
*
|
|
2497
|
-
* @param L to append to
|
|
2498
|
-
* @param A to be added to
|
|
2499
|
-
* @returns [[List]]
|
|
2500
|
-
* @example
|
|
2501
|
-
* ```ts
|
|
2502
|
-
* ```
|
|
2345
|
+
* Get all properties **not using** the `?:` type operator.
|
|
2503
2346
|
*/
|
|
2504
|
-
|
|
2505
|
-
//#endregion
|
|
2506
|
-
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Iteration/_Internal.d.ts
|
|
2347
|
+
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;
|
|
2507
2348
|
/**
|
|
2508
|
-
*
|
|
2349
|
+
* Get all properties using the `?:` type operator.
|
|
2509
2350
|
*/
|
|
2510
|
-
|
|
2511
|
-
//#endregion
|
|
2512
|
-
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Append.d.ts
|
|
2351
|
+
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;
|
|
2513
2352
|
/**
|
|
2514
|
-
*
|
|
2515
|
-
* @param L to append to
|
|
2516
|
-
* @param A to be added to
|
|
2517
|
-
* @returns [[List]]
|
|
2518
|
-
* @example
|
|
2519
|
-
* ```ts
|
|
2520
|
-
* import {L} from 'ts-toolbelt'
|
|
2353
|
+
* Resolves to `true` if `Left` and `Right` are exactly the same type.
|
|
2521
2354
|
*
|
|
2522
|
-
*
|
|
2523
|
-
* type test1 = L.Append<[], 'a'> // ['a']
|
|
2524
|
-
* type test2 = L.Append<readonly ['a', 'b'], 'c'> // ['a', 'b', 'c']
|
|
2525
|
-
* type test3 = L.Append<[1, 2], [3, 4]> // [1, 2, [3, 4]]
|
|
2526
|
-
* ```
|
|
2355
|
+
* Otherwise false.
|
|
2527
2356
|
*/
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Object/Record.d.ts
|
|
2357
|
+
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;
|
|
2358
|
+
type Primitive = number | string | boolean | symbol | bigint | null | undefined | void;
|
|
2531
2359
|
/**
|
|
2532
|
-
*
|
|
2533
|
-
*
|
|
2534
|
-
* @param A (?=`unknown`) to fill fields with
|
|
2535
|
-
* @param modx (?=`['!', 'W']`) to set modifiers
|
|
2536
|
-
* @returns [[Object]]
|
|
2360
|
+
* Coerce a primitive type to its boxed equivalent.
|
|
2361
|
+
*
|
|
2537
2362
|
* @example
|
|
2538
2363
|
* ```ts
|
|
2364
|
+
* type A = BoxedPrimitive<string>
|
|
2365
|
+
* // ^? String
|
|
2366
|
+
* type B = BoxedPrimitive<number>
|
|
2367
|
+
* // ^? Number
|
|
2539
2368
|
* ```
|
|
2540
2369
|
*/
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
'R': { readonly [P in K$1]: A$1 };
|
|
2544
|
-
'W': { [P in K$1]: A$1 };
|
|
2545
|
-
};
|
|
2546
|
-
'?': {
|
|
2547
|
-
'R': { readonly [P in K$1]?: A$1 };
|
|
2548
|
-
'W': { [P in K$1]?: A$1 };
|
|
2549
|
-
};
|
|
2550
|
-
}[modx[0]][modx[1]];
|
|
2551
|
-
//#endregion
|
|
2552
|
-
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/Object/Invert.d.ts
|
|
2370
|
+
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;
|
|
2371
|
+
type TypedArray$1 = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array$1 | BigUint64Array$1 | DataView | ArrayBuffer | SharedArrayBuffer;
|
|
2553
2372
|
/**
|
|
2554
|
-
*
|
|
2373
|
+
* Add your own classes to this registry by extending its interface
|
|
2374
|
+
* with what's called “declaration merging” in TypeScript.
|
|
2375
|
+
*
|
|
2376
|
+
* All property types in this registry type may be treated specially
|
|
2377
|
+
* by any of Radashi's complex types. For example, `assign` will avoid
|
|
2378
|
+
* merging with types in this registry.
|
|
2555
2379
|
*/
|
|
2556
|
-
|
|
2380
|
+
interface CustomClassRegistry {}
|
|
2557
2381
|
/**
|
|
2558
|
-
*
|
|
2559
|
-
*
|
|
2560
|
-
|
|
2382
|
+
* This type represents any custom class that was "registered" through
|
|
2383
|
+
* the `CustomClassRegistry` type.
|
|
2384
|
+
*/
|
|
2385
|
+
type CustomClass = CustomClassRegistry[keyof CustomClassRegistry];
|
|
2386
|
+
/**
|
|
2387
|
+
* These types are implemented natively.
|
|
2388
|
+
*
|
|
2389
|
+
* Note that boxed primitives like `Boolean` (different from
|
|
2390
|
+
* `boolean`) are not included, because `boolean extends Boolean ? 1 :
|
|
2391
|
+
* 0` resolves to 1.
|
|
2392
|
+
*/
|
|
2393
|
+
type BuiltInType = ES2021.BuiltInType | WebAPI.BuiltInType | NodeJS.BuiltInType;
|
|
2394
|
+
declare namespace ES2020 {
|
|
2395
|
+
type BuiltInType = Primitive | Promise<any> | Date | RegExp | Error | readonly any[] | ReadonlyMap<any, any> | ReadonlySet<any> | WeakMap<WeakKey, any> | WeakSet<WeakKey> | TypedArray$1 | Function;
|
|
2396
|
+
}
|
|
2397
|
+
declare namespace ES2021 {
|
|
2398
|
+
type BuiltInType = ES2020.BuiltInType | GlobalObjectType<'FinalizationRegistry'> | GlobalObjectType<'WeakRef'>;
|
|
2399
|
+
}
|
|
2400
|
+
declare namespace NodeJS {
|
|
2401
|
+
type BuiltInType = GlobalObjectType<'Buffer'>;
|
|
2402
|
+
}
|
|
2403
|
+
declare namespace WebAPI {
|
|
2404
|
+
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;
|
|
2405
|
+
}
|
|
2406
|
+
declare namespace WebDocumentAPI {
|
|
2407
|
+
type BuiltInType = GlobalObjectType<'Node'> | GlobalObjectType<'NodeList'> | GlobalObjectType<'NodeIterator'> | GlobalObjectType<'HTMLCollection'> | GlobalObjectType<'CSSStyleDeclaration'> | GlobalObjectType<'DOMStringList'> | GlobalObjectType<'DOMTokenList'>;
|
|
2408
|
+
}
|
|
2409
|
+
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;
|
|
2410
|
+
|
|
2411
|
+
/**
|
|
2412
|
+
* Converts a `PromiseLike` to a `Promise<Result>`.
|
|
2413
|
+
*
|
|
2414
|
+
* Note: If the given promise throws a non-Error value, it will be
|
|
2415
|
+
* rethrown.
|
|
2416
|
+
*
|
|
2417
|
+
* @see https://radashi.js.org/reference/async/toResult
|
|
2561
2418
|
* @example
|
|
2562
2419
|
* ```ts
|
|
2563
|
-
* import {
|
|
2420
|
+
* import { toResult, Result } from 'radashi'
|
|
2564
2421
|
*
|
|
2565
|
-
*
|
|
2566
|
-
*
|
|
2567
|
-
* B = 'Bv',
|
|
2568
|
-
* C = 'Cv',
|
|
2569
|
-
* D = 'Dv',
|
|
2570
|
-
* X = 1
|
|
2571
|
-
* }
|
|
2422
|
+
* const good = async (): Promise<number> => 1
|
|
2423
|
+
* const bad = async (): Promise<number> => { throw new Error('bad') }
|
|
2572
2424
|
*
|
|
2573
|
-
*
|
|
2574
|
-
*
|
|
2575
|
-
* B: 'Bv'
|
|
2576
|
-
* C: 'Cv'
|
|
2577
|
-
* D: 'Dv'
|
|
2578
|
-
* X: 1
|
|
2579
|
-
* }
|
|
2425
|
+
* const goodResult = await toResult(good())
|
|
2426
|
+
* // => [undefined, 1]
|
|
2580
2427
|
*
|
|
2581
|
-
*
|
|
2582
|
-
*
|
|
2428
|
+
* const badResult = await toResult(bad())
|
|
2429
|
+
* // => [Error('bad'), undefined]
|
|
2583
2430
|
* ```
|
|
2431
|
+
* @version 12.4.0
|
|
2584
2432
|
*/
|
|
2585
|
-
|
|
2586
|
-
//#endregion
|
|
2587
|
-
//#region node_modules/.pnpm/ts-toolbelt@9.6.0/node_modules/ts-toolbelt/out/List/Drop.d.ts
|
|
2433
|
+
|
|
2588
2434
|
/**
|
|
2589
|
-
*
|
|
2435
|
+
* The return type for `assign`.
|
|
2436
|
+
*
|
|
2437
|
+
* It recursively merges object types that are not native objects. The
|
|
2438
|
+
* root objects are always merged.
|
|
2439
|
+
*
|
|
2440
|
+
* @see https://radashi.js.org/reference/object/assign
|
|
2590
2441
|
*/
|
|
2591
|
-
|
|
2592
|
-
0: DropForth<Tail$1<L>, Prev<N>>;
|
|
2593
|
-
1: L;
|
|
2594
|
-
}[Extends<0, Pos<N>>];
|
|
2442
|
+
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;
|
|
2595
2443
|
/**
|
|
2596
|
-
*
|
|
2444
|
+
* Mimic the `Simplify` type and also remove `readonly` modifiers.
|
|
2597
2445
|
*/
|
|
2598
|
-
|
|
2599
|
-
0: DropBack<L, N, Prev<I$1>, Prepend<LN, L[Pos<I$1>]>>;
|
|
2600
|
-
1: LN;
|
|
2601
|
-
}[Extends<-1, Pos<I$1>>];
|
|
2446
|
+
type SimplifyMutable<T> = {} & { -readonly [P in keyof T]: T[P] };
|
|
2602
2447
|
/**
|
|
2603
|
-
*
|
|
2448
|
+
* This represents a value that should only be replaced if it exists
|
|
2449
|
+
* as an initial value; never deeply assigned into.
|
|
2604
2450
|
*/
|
|
2605
|
-
|
|
2606
|
-
'->': DropForth<L, N>;
|
|
2607
|
-
'<-': DropBack<L, N>;
|
|
2608
|
-
}[way];
|
|
2451
|
+
type AtomicValue = BuiltInType | CustomClass | BoxedPrimitive;
|
|
2609
2452
|
/**
|
|
2610
|
-
*
|
|
2453
|
+
* Handle mixed types when merging nested plain objects.
|
|
2454
|
+
*
|
|
2455
|
+
* For example, if the type `TOverride` includes both `string` and `{ n:
|
|
2456
|
+
* number }` in a union, `AssignDeep` will treat `string` as
|
|
2457
|
+
* unmergeable and `{ n: number }` as mergeable.
|
|
2611
2458
|
*/
|
|
2612
|
-
|
|
2459
|
+
type AssignDeep<TInitial, TOverride, IsOptional = false> = never
|
|
2613
2460
|
/**
|
|
2614
|
-
*
|
|
2615
|
-
*
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
*
|
|
2461
|
+
* When a native type is found in TInitial, it will only exist in
|
|
2462
|
+
* the result type if the override is optional.
|
|
2463
|
+
*/ | (TInitial extends AtomicValue ? IsOptional extends true ? TInitial : never : never)
|
|
2464
|
+
/**
|
|
2465
|
+
* When a native type is found in TOverride, it will always exists
|
|
2466
|
+
* in the result type.
|
|
2467
|
+
*/ | (TOverride extends AtomicValue ? TOverride : never)
|
|
2468
|
+
/**
|
|
2469
|
+
* Deep assignment is handled in this branch.
|
|
2470
|
+
*
|
|
2471
|
+
* 1. Exclude any native types from TInitial and TOverride
|
|
2472
|
+
* 2. If a non-native object type is not found in TInitial, simply
|
|
2473
|
+
* replace TInitial (or use "A | B" if the override is optional)
|
|
2474
|
+
* 3. For each non-native object type in TOverride, deep assign to
|
|
2475
|
+
* every non-native object in TInitial
|
|
2476
|
+
* 4. For each non-object type in TOverride, simply replace TInitial
|
|
2477
|
+
* (or use "A | B" if the override is optional)
|
|
2478
|
+
*/ | (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> :
|
|
2479
|
+
// 4.
|
|
2480
|
+
TOverride | (IsOptional extends true ? TInitial : never) : Extract<TOverride, object> | (IsOptional extends true ? TInitial : never) : never : never);
|
|
2481
|
+
|
|
2482
|
+
/**
|
|
2483
|
+
* Creates a shallow copy of the given object/value.
|
|
2484
|
+
*
|
|
2485
|
+
* @see https://radashi.js.org/reference/object/clone
|
|
2619
2486
|
* @example
|
|
2620
2487
|
* ```ts
|
|
2488
|
+
* const original = { a: 1, b: { c: 3 } }
|
|
2489
|
+
* const cloned = clone(original)
|
|
2490
|
+
* // => { a: 1, b: { c: 3 } }
|
|
2491
|
+
* original !== cloned
|
|
2492
|
+
* // => true
|
|
2493
|
+
* original.b === cloned.b
|
|
2494
|
+
* // => true
|
|
2621
2495
|
* ```
|
|
2496
|
+
* @version 12.1.0
|
|
2622
2497
|
*/
|
|
2623
|
-
declare type Drop<L extends List, N extends number, way extends Way = '->'> = L extends unknown ? N extends unknown ? _Drop<L, N, way> : never : never;
|
|
2624
2498
|
//#endregion
|
|
2625
|
-
//#region
|
|
2626
|
-
/**
|
|
2627
|
-
* starts in reverse from `N` till `N` = 0
|
|
2628
|
-
* @hidden
|
|
2629
|
-
*/
|
|
2630
|
-
declare type TakeForth<L extends List, N extends Iteration, I$1 extends Iteration = Prev<N>, LN extends List = []> = {
|
|
2631
|
-
0: TakeForth<L, N, Prev<I$1>, Prepend<LN, L[Pos<I$1>]>>;
|
|
2632
|
-
1: LN;
|
|
2633
|
-
}[Extends<-1, Pos<I$1>>];
|
|
2634
|
-
/**
|
|
2635
|
-
* starts in reverse from the end till `N` = 0
|
|
2636
|
-
* @hidden
|
|
2637
|
-
*/
|
|
2638
|
-
declare type TakeBack<L extends List, N extends Iteration> = {
|
|
2639
|
-
0: TakeBack<Tail$1<L>, Prev<N>>;
|
|
2640
|
-
1: L;
|
|
2641
|
-
}[Extends<0, Pos<N>>];
|
|
2642
|
-
/**
|
|
2643
|
-
* @hidden
|
|
2644
|
-
*/
|
|
2645
|
-
declare type __Take<L extends List, N extends Iteration, way extends Way> = {
|
|
2646
|
-
'->': TakeForth<L, N>;
|
|
2647
|
-
'<-': TakeBack<L, N>;
|
|
2648
|
-
}[way];
|
|
2499
|
+
//#region src/utils/object/objectAssign.d.ts
|
|
2649
2500
|
/**
|
|
2650
|
-
*
|
|
2501
|
+
* 递归地将第二个对象合并到第一个对象的副本中
|
|
2502
|
+
* - 只有普通对象才会递归合并
|
|
2503
|
+
* - 会处理循环引用,避免无限递归
|
|
2504
|
+
*
|
|
2505
|
+
* @param initial 初始对象
|
|
2506
|
+
* @param override 待合并对象
|
|
2507
|
+
* @returns 合并后的新对象
|
|
2508
|
+
* @example
|
|
2509
|
+
* ```ts
|
|
2510
|
+
* const initial = { a: 1, b: { c: 2 } };
|
|
2511
|
+
* const override = { b: { d: 3 } };
|
|
2512
|
+
* objectAssign(initial, override); // { a: 1, b: { c: 2, d: 3 } }
|
|
2513
|
+
* ```
|
|
2651
2514
|
*/
|
|
2652
|
-
declare
|
|
2515
|
+
declare function objectAssign<I$1 extends PlainObject, O extends PlainObject>(initial: I$1, override: O): Assign<I$1, O>;
|
|
2516
|
+
declare function objectAssign<I$1 extends AnyObject, O extends AnyObject>(initial: I$1, override: O): Assign<I$1, O>;
|
|
2517
|
+
//#endregion
|
|
2518
|
+
//#region src/utils/object/objectCrush.d.ts
|
|
2519
|
+
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>>;
|
|
2653
2520
|
/**
|
|
2654
|
-
*
|
|
2655
|
-
*
|
|
2656
|
-
*
|
|
2657
|
-
* @param
|
|
2658
|
-
* @returns
|
|
2521
|
+
* 压平对象
|
|
2522
|
+
* - 将多层级的对象转换为单层级的对象,键名使用点号连接
|
|
2523
|
+
*
|
|
2524
|
+
* @param plainObject 平面对象
|
|
2525
|
+
* @returns 压平后的对象
|
|
2659
2526
|
* @example
|
|
2660
2527
|
* ```ts
|
|
2528
|
+
* const obj = { a: { b: 1 } };
|
|
2529
|
+
* objectCrush(obj); // { "a.b": 1 }
|
|
2661
2530
|
* ```
|
|
2662
2531
|
*/
|
|
2663
|
-
declare
|
|
2664
|
-
|
|
2665
|
-
//#region src/types/index.type.d.ts
|
|
2666
|
-
type AnyArray<A$1 = any> = readonly A$1[];
|
|
2667
|
-
type Range<Start extends number, End extends number> = Exclude<keyof TupleOf<End>, keyof TupleOf<Start>>;
|
|
2668
|
-
type TupleToEntries<A$1 extends readonly unknown[]> = If<IsAny<A$1>, unknown, { [Key in keyof A$1]: [Key, A$1[Key]] }>;
|
|
2669
|
-
type Groups<L extends AnyArray, LN extends AnyArray = [], D extends number[] = []> = D["length"] extends 40 ? LN : {
|
|
2670
|
-
0: Groups<Drop<L, 1>, Append<LN, [`${LN["length"]}`, Take<L, 1>]>, [...D, 0]>;
|
|
2671
|
-
1: LN;
|
|
2672
|
-
}[Extends<L, AnyArray<never>>];
|
|
2673
|
-
type TupleToGroups<L extends AnyArray> = Groups<L> extends infer X ? Cast<X, AnyArray> : never;
|
|
2532
|
+
declare function objectCrush<T extends PlainObject>(plainObject: T): Crush<T>;
|
|
2533
|
+
declare function objectCrush<T extends AnyObject>(anyObject: T): Crush<T>;
|
|
2674
2534
|
//#endregion
|
|
2675
2535
|
//#region src/utils/object/objectEntries.d.ts
|
|
2676
2536
|
/**
|
|
@@ -2685,13 +2545,14 @@ type TupleToGroups<L extends AnyArray> = Groups<L> extends infer X ? Cast<X, Any
|
|
|
2685
2545
|
*/
|
|
2686
2546
|
declare function objectEntries<const S extends string>(string: S): TupleToEntries<Split<S, "">>;
|
|
2687
2547
|
declare function objectEntries<const A$1 extends readonly unknown[]>(array: A$1): TupleToGroups<A$1>;
|
|
2688
|
-
declare function objectEntries<const O extends PlainObject>(plainObject: O): [
|
|
2689
|
-
declare function objectEntries<const O extends AnyObject>(anyObject: O): [
|
|
2548
|
+
declare function objectEntries<const O extends PlainObject>(plainObject: O): [`${keyof Except<O, symbol>}`, O[keyof Except<O, symbol>]][];
|
|
2549
|
+
declare function objectEntries<const O extends AnyObject>(anyObject: O): [`${keyof Except<O, symbol>}`, O[keyof Except<O, symbol>]][];
|
|
2690
2550
|
//#endregion
|
|
2691
2551
|
//#region src/utils/object/objectInvert.d.ts
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2552
|
+
type IntersectOf<U$1> = (U$1 extends unknown ? (k: U$1) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
2553
|
+
type ComputeRaw<A$1> = A$1 extends AnyFunction ? A$1 : { [K in keyof A$1]: A$1[K] } & unknown;
|
|
2554
|
+
type _Invert<O extends Record<PropertyKey, PropertyKey>> = ComputeRaw<IntersectOf<{ [K in keyof O]: Record<O[K], K> }[keyof O]>>;
|
|
2555
|
+
type Invert<O extends Record<keyof O, PropertyKey>> = O extends unknown ? _Invert<O> : never;
|
|
2695
2556
|
/**
|
|
2696
2557
|
* 尽可能地交换对象的键和值
|
|
2697
2558
|
*
|
|
@@ -2766,8 +2627,8 @@ declare function objectPick<O extends AnyObject, K$1 extends keyof O>(anyObject:
|
|
|
2766
2627
|
*/
|
|
2767
2628
|
declare function objectValues<S extends string>(string: S): Split<S, "">;
|
|
2768
2629
|
declare function objectValues<A$1 extends ArrayLike<unknown>>(array: A$1): A$1;
|
|
2769
|
-
declare function objectValues<O extends PlainObject>(plainObject: O):
|
|
2770
|
-
declare function objectValues<O extends AnyObject>(anyObject: O):
|
|
2630
|
+
declare function objectValues<O extends PlainObject>(plainObject: O): O[keyof O][];
|
|
2631
|
+
declare function objectValues<O extends AnyObject>(anyObject: O): O[keyof O][];
|
|
2771
2632
|
//#endregion
|
|
2772
2633
|
//#region src/utils/string/stringInitialCase.d.ts
|
|
2773
2634
|
/**
|
|
@@ -2818,9 +2679,7 @@ declare function stringReplace<I$1 extends string, S extends string, R$1 extends
|
|
|
2818
2679
|
//#region src/utils/string/stringTemplate.d.ts
|
|
2819
2680
|
/**
|
|
2820
2681
|
* 字符串模板替换
|
|
2821
|
-
*
|
|
2822
|
-
/**
|
|
2823
|
-
* 字符串模板替换
|
|
2682
|
+
* - 使用对象的属性值替换字符串中的 {{key}} 模板
|
|
2824
2683
|
*
|
|
2825
2684
|
* @param input 待处理字符串
|
|
2826
2685
|
* @param template 模板对象
|
|
@@ -2852,9 +2711,6 @@ declare function stringTemplate(input: string, template: PlainObject, regex?: Re
|
|
|
2852
2711
|
declare function stringToJson<D extends AnyObject = AnyObject>(input: string | null | undefined, safeValue: D): D;
|
|
2853
2712
|
//#endregion
|
|
2854
2713
|
//#region src/utils/string/stringToNumber.d.ts
|
|
2855
|
-
/**
|
|
2856
|
-
* 从字符串中提取数字字符串
|
|
2857
|
-
*
|
|
2858
2714
|
/**
|
|
2859
2715
|
* 从字符串中提取数字字符串
|
|
2860
2716
|
* - 移除非数字字符,保留符号和小数点
|
|
@@ -2872,18 +2728,28 @@ declare function stringToNumber(input: string): string;
|
|
|
2872
2728
|
//#region src/utils/string/stringToPosix.d.ts
|
|
2873
2729
|
/**
|
|
2874
2730
|
* 将路径转换为 POSIX 风格
|
|
2875
|
-
*
|
|
2876
|
-
|
|
2877
|
-
*
|
|
2878
|
-
* -
|
|
2879
|
-
* - 处理 Windows 盘符
|
|
2731
|
+
* - 统一使用正斜杠 (/)
|
|
2732
|
+
* - 可选移除 Windows 盘符 (如 C:)
|
|
2733
|
+
* - 可选移除开头的斜杠
|
|
2734
|
+
* - 规范化连续斜杠为单个斜杠
|
|
2880
2735
|
*
|
|
2881
2736
|
* @param input 待处理字符串
|
|
2882
|
-
* @param removeLeadingSlash 是否移除开头斜杠,默认为 `false
|
|
2883
|
-
* @returns
|
|
2737
|
+
* @param removeLeadingSlash 是否移除开头斜杠,默认为 `false`。如果移除了盘符,路径通常会以 / 开头,此参数可控制是否保留该 /
|
|
2738
|
+
* @returns 转换后的路径,如果输入无效则返回空字符串
|
|
2739
|
+
*
|
|
2884
2740
|
* @example
|
|
2885
2741
|
* ```ts
|
|
2886
|
-
* stringToPosix("C:\\Windows\\System32");
|
|
2742
|
+
* stringToPosix("C:\\Windows\\System32");
|
|
2743
|
+
* // 默认: "/Windows/System32" (移除了 C: 并标准化)
|
|
2744
|
+
*
|
|
2745
|
+
* stringToPosix("C:\\Windows\\System32", true);
|
|
2746
|
+
* // 移除开头斜杠: "Windows/System32"
|
|
2747
|
+
*
|
|
2748
|
+
* stringToPosix("\\\\server\\share\\file.txt");
|
|
2749
|
+
* // UNC 路径: "/server/share/file.txt"
|
|
2750
|
+
*
|
|
2751
|
+
* stringToPosix("folder\\subfolder\\file.txt");
|
|
2752
|
+
* // 相对路径: "folder/subfolder/file.txt"
|
|
2887
2753
|
* ```
|
|
2888
2754
|
*/
|
|
2889
2755
|
declare function stringToPosix(input: string | null | undefined, removeLeadingSlash?: boolean): string;
|
|
@@ -2922,7 +2788,6 @@ declare function stringToValues(input: string | null | undefined, valueType: "st
|
|
|
2922
2788
|
declare function stringTrim(input: string | null | undefined, charsToTrim?: string): string;
|
|
2923
2789
|
//#endregion
|
|
2924
2790
|
//#region src/utils/string/stringTruncate.d.ts
|
|
2925
|
-
/**
|
|
2926
2791
|
/**
|
|
2927
2792
|
* 截取字符串
|
|
2928
2793
|
* - 支持自定义省略符,不会截断在汉字中间(因为JS字符串本身按字符处理)
|
|
@@ -3188,14 +3053,17 @@ declare function isDate(value: unknown, invalidCheck?: boolean): value is Date;
|
|
|
3188
3053
|
//#endregion
|
|
3189
3054
|
//#region src/utils/typeof/isEnumeration.d.ts
|
|
3190
3055
|
/**
|
|
3191
|
-
*
|
|
3192
|
-
* -
|
|
3193
|
-
* -
|
|
3056
|
+
* 判断一个对象是否为有效的枚举
|
|
3057
|
+
* - 枚举成员不能为空
|
|
3058
|
+
* - 枚举成员的键不能具有数值名
|
|
3059
|
+
* - 枚举成员的值必须类型一致且为 `string` 或 `number` 类型
|
|
3060
|
+
* - 枚举成员的值不能重复
|
|
3061
|
+
* - 枚举成员的值必须全部为双向映射或非双向映射
|
|
3194
3062
|
*
|
|
3195
3063
|
* @param enumeration 待检查值
|
|
3196
|
-
* @returns
|
|
3064
|
+
* @returns [是否为有效的枚举, 是否为双向枚举]
|
|
3197
3065
|
*/
|
|
3198
|
-
declare function isEnumeration(enumeration:
|
|
3066
|
+
declare function isEnumeration(enumeration: PlainObject): [boolean, boolean];
|
|
3199
3067
|
//#endregion
|
|
3200
3068
|
//#region src/utils/typeof/isEqual.d.ts
|
|
3201
3069
|
/**
|
|
@@ -3254,6 +3122,15 @@ declare function isGeneratorFunction(value: unknown): value is AnyGeneratorFunct
|
|
|
3254
3122
|
*/
|
|
3255
3123
|
declare function isAsyncGeneratorFunction(value: unknown): value is AnyAsyncGeneratorFunction;
|
|
3256
3124
|
//#endregion
|
|
3125
|
+
//#region src/utils/typeof/isIframe.d.ts
|
|
3126
|
+
/**
|
|
3127
|
+
* 检查 value 是否为 HTMLIFrameElement
|
|
3128
|
+
* @param value 待检查值
|
|
3129
|
+
* @returns 是否为 HTMLIFrameElement
|
|
3130
|
+
*/
|
|
3131
|
+
declare function isIframe(value: unknown): value is HTMLIFrameElement;
|
|
3132
|
+
declare function isInIframe(): boolean;
|
|
3133
|
+
//#endregion
|
|
3257
3134
|
//#region src/utils/typeof/isIterable.d.ts
|
|
3258
3135
|
/**
|
|
3259
3136
|
* 检查 value 是否为可迭代对象 (Iterable)
|
|
@@ -3312,7 +3189,7 @@ declare function isNaN(value: unknown): value is number;
|
|
|
3312
3189
|
* 检查 value 是否为整数
|
|
3313
3190
|
*
|
|
3314
3191
|
* @param value 待检查值
|
|
3315
|
-
* @param safeCheck
|
|
3192
|
+
* @param safeCheck 是否附加安全整数检查
|
|
3316
3193
|
* @returns 是否为整数
|
|
3317
3194
|
*/
|
|
3318
3195
|
declare function isInteger(value: unknown, safeCheck?: boolean): value is number;
|
|
@@ -3321,7 +3198,7 @@ declare function isInteger(value: unknown, safeCheck?: boolean): value is number
|
|
|
3321
3198
|
* - 此函数中 `0` 不被视为正整数
|
|
3322
3199
|
*
|
|
3323
3200
|
* @param value 待检查值
|
|
3324
|
-
* @param safeCheck
|
|
3201
|
+
* @param safeCheck 是否附加安全整数检查
|
|
3325
3202
|
*/
|
|
3326
3203
|
declare function isPositiveInteger(value: unknown, safeCheck?: boolean): value is number;
|
|
3327
3204
|
/**
|
|
@@ -3329,7 +3206,7 @@ declare function isPositiveInteger(value: unknown, safeCheck?: boolean): value i
|
|
|
3329
3206
|
* - 此函数中 `0` 不被视为负整数
|
|
3330
3207
|
*
|
|
3331
3208
|
* @param value 待检查值
|
|
3332
|
-
* @param safeCheck
|
|
3209
|
+
* @param safeCheck 是否附加安全整数检查
|
|
3333
3210
|
*/
|
|
3334
3211
|
declare function isNegativeInteger(value: unknown, safeCheck?: boolean): value is number;
|
|
3335
3212
|
/**
|
|
@@ -3349,7 +3226,7 @@ declare function isInfinityLike(value: unknown): boolean;
|
|
|
3349
3226
|
//#endregion
|
|
3350
3227
|
//#region src/utils/typeof/isObject.d.ts
|
|
3351
3228
|
/**
|
|
3352
|
-
*
|
|
3229
|
+
* 判断是否为普通对象类型
|
|
3353
3230
|
* - 可选是否检查原型为 `Object.prototype`,防止原型链污染
|
|
3354
3231
|
*
|
|
3355
3232
|
* @param value 待检查值
|
|
@@ -3358,8 +3235,11 @@ declare function isInfinityLike(value: unknown): boolean;
|
|
|
3358
3235
|
* @example
|
|
3359
3236
|
* ```ts
|
|
3360
3237
|
* isObject({}); // true
|
|
3238
|
+
* isObject([]); // false
|
|
3361
3239
|
* isObject(new Date()); // false (because prototype is not Object.prototype)
|
|
3362
3240
|
* isObject(new Date(), false); // true (is object type)
|
|
3241
|
+
* isObject(Object.create(null)) // false
|
|
3242
|
+
* isObject(Object.create(null), false) // true
|
|
3363
3243
|
* ```
|
|
3364
3244
|
*/
|
|
3365
3245
|
declare function isObject(value: unknown, prototypeCheck?: boolean): value is Record<PropertyKey, unknown>;
|
|
@@ -3380,16 +3260,12 @@ declare function isPromiseLike(value: unknown): value is PromiseLike<unknown>;
|
|
|
3380
3260
|
//#endregion
|
|
3381
3261
|
//#region src/utils/typeof/isReadableStream.d.ts
|
|
3382
3262
|
/**
|
|
3383
|
-
*
|
|
3384
|
-
*
|
|
3263
|
+
* 检查 value 是否为 ReadableStream
|
|
3385
3264
|
* - Uses `Object.prototype.toString` where supported (modern browsers, Node.js ≥18).
|
|
3386
3265
|
* - Falls back to duck-typing in older environments.
|
|
3387
3266
|
* - Resistant to basic forgery, but not 100% secure in all polyfill scenarios.
|
|
3267
|
+
* - ⚠️ Note: In older Node.js (<18) or with non-compliant polyfills, this may return false positives or negatives.
|
|
3388
3268
|
*
|
|
3389
|
-
* ⚠️ Note: In older Node.js (<18) or with non-compliant polyfills, this may return false positives or negatives.
|
|
3390
|
-
*/
|
|
3391
|
-
/**
|
|
3392
|
-
* 检查 value 是否为 ReadableStream
|
|
3393
3269
|
* @param value 待检查值
|
|
3394
3270
|
* @returns 是否为 ReadableStream
|
|
3395
3271
|
*/
|
|
@@ -3473,5 +3349,5 @@ declare function isWebSocket(value: unknown): value is WebSocket;
|
|
|
3473
3349
|
*/
|
|
3474
3350
|
declare function isWindow(value: unknown): value is Window;
|
|
3475
3351
|
//#endregion
|
|
3476
|
-
export { arrayCast, arrayCompete, arrayCounting, arrayDifference, arrayFirst, arrayFork, arrayIntersection, arrayLast, arrayMerge, arrayPick, arrayReplace, arrayReplaceMove, arraySplit, arrayUnzip, arrayZip, arrayZipToObject, cloneDeep, enumEntries, enumKeys, enumValues, getTimeZone, isAbortSignal, isArray, isAsyncFunction, isAsyncGeneratorFunction, isBigInt, isBlob, isBoolean, isBrowser, isClass, isDate, isEnumeration, isEqual, isError, isFalsy, isFalsyLike, isFile, isFunction, isGeneratorFunction, isIOSMobile, 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, isWebWorker, isWindow,
|
|
3352
|
+
export { arrayCast, arrayCompete, arrayCounting, arrayDifference, arrayFirst, arrayFork, arrayIntersection, arrayLast, arrayMerge, arrayPick, arrayReplace, arrayReplaceMove, arraySplit, arrayUnzip, arrayZip, arrayZipToObject, clone, cloneDeep, cloneDeepWith, enumEntries, enumKeys, enumValues, getTimeZone, isAbortSignal, isArray, isAsyncFunction, isAsyncGeneratorFunction, isBigInt, isBlob, isBoolean, isBrowser, isClass, isDate, isEnumeration, isEqual, isError, isFalsy, isFalsyLike, isFile, isFunction, isGeneratorFunction, isIOSMobile, isIframe, isInIframe, 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, isWebWorker, isWindow, mathToBignumber, mathToDecimal, mathToEvaluate, numberWithin, objectAssign, objectCrush, objectEntries, objectInvert, objectKeys, objectMapEntries, objectOmit, objectPick, objectValues, rowsToTree, stringInitialCase, stringReplace, stringTemplate, stringToJson, stringToNumber, stringToPosix, stringToValues, stringTrim, stringTruncate, to, treeFilter, treeFind, treeForEach, treeMap, treeToRows };
|
|
3477
3353
|
//# sourceMappingURL=index.d.ts.map
|