array-types-counter
Version:
Simple helper to obtain the count of different array item's types.
26 lines (25 loc) • 561 B
TypeScript
/**
* TypeCount class
*
* @class TypeCount
*/
declare class TypeCount {
type: string;
count: number;
/**
* Creates an instance of TypeCount.
* @param {string} type
* @param {number} count
* @memberof TypeCount
*/
constructor(type: string, count: number);
}
/**
* Counts the array's item types
*
* @export
* @param {any[]} array
* @return {TypeCount[]} The array item types ordered by count, descending
*/
export declare function countArrayTypes(array: any[]): TypeCount[];
export {};