1 | /**
|
2 | * 集合分组统计,返回各组中对象的数量统计
|
3 | * @param list 对象
|
4 | * @param iterate 回调/属性
|
5 | * @param context 上下文
|
6 | */
|
7 | export declare function countBy<T, C>(list: T[], iterate: (this: C, item: T, index: number, list: T[]) => string | number, context?: C): { [key: string]: number };
|
8 |
|
9 | /**
|
10 | * 集合分组统计,返回各组中对象的数量统计
|
11 | * @param obj 对象
|
12 | * @param iterate 回调/属性
|
13 | * @param context 上下文
|
14 | */
|
15 | export declare function countBy<T, C>(obj: T, iterate: (this: C, item: any, key: string, obj: T) => string | number, context?: C): { [key: string]: number };
|
16 |
|
17 | declare module './ctor' {
|
18 | interface XEUtilsMethods {
|
19 | countBy: typeof countBy;
|
20 | }
|
21 | }
|
22 |
|
23 | export default countBy
|