UNPKG

vim-webgl-component

Version:

A demonstration app built on top of the vim-webgl-viewer

28 lines (27 loc) 1.06 kB
/** * @module viw-webgl-component */ /** * Recursive Tree implemented as a recursive map. */ export type MapTree<K, V> = Map<K, V[] | MapTree<K, V>>; /** * Returns true if both argument are null or pair-wise equal. */ export declare function ArrayEquals<T>(first: T[], second: T[]): boolean; /** * Creates N-level grouping of items using given grouping selector in the order provided. * @param items array of items to groups * @param grouping array of selectors * @returns a Map of Map ... of Map<string, item> with the first map containing a single element called root. */ export declare function toMapTree<V>(items: V[], grouping: ((v: V) => string)[]): MapTree<string, V>; /** * groups elements of an array into a map using values returned by selector. * Intended to work as Linq.GroupBy */ export declare function groupBy<K, V>(array: V[], selector: (o: V) => K): Map<K, V[]>; /** * Takes a N-deep Map tree and reinsert all element in sorted order. */ export declare function sort<K, V>(map: MapTree<K, V>): void;