/** * 对数组进行去重,适用于简单数组,对象为根据引用进行去重 * @param arr 输入数组 * @returns 去重后的数组 */ export declare function uniq(arr: any[]): any[]; /** * 对象数组转为对象 * @example [{ a: 'a' }, { b: 'b' }] -> { a: 'a', b: 'b' } * @param arr * @param getKey * @param getValue * @returns */ export declare function array2object(arr: Array>, getKey: (item: any) => any, getValue?: (item: any) => any): Record; /** * 树形嵌套数据的过滤 * @param array 输入的数组 * @param predict 断言函数,过滤出符合判断函数的数据 * @param childrenProp 子属性的名字 * @param onlyLeaf 是否子探测叶子结点,即存在子节点的父节点不执行断言函数 */ export declare function filterTreeData(array: T[], predict: (leaf: T) => boolean, childrenProp?: string, onlyLeaf?: boolean): T[]; export declare function mapTreeData(treeData: T[], mapper: (node: T) => any, childrenProp?: string): any[];