Files
tekelanew_acs/acs/nladmin-ui/node_modules/xe-utils/mapTree.d.ts

24 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-12-03 17:40:13 +08:00
export interface MapTreeOptions {
children?: string;
mapChildren?: string;
}
/**
*
* @param {Object} obj /
* @param {Function} iterate(item, index, items, path, parent, nodes)
* @param {Object} options {children: 'children', mapChildren: 'children}
* @param {Object} context
*/
export declare function mapTree<T, U, C = any>(array: T[], iterate: (this: C, item: T, index: number, items: T[], path: string[], parent: T, nodes: T[]) => U, options?: MapTreeOptions, context?: C): U[];
export declare function mapTree<U, C = any>(array: any[], iterate: (this: C, item: any, index: number, items: any[], path: string[], parent: any, nodes: any[]) => U, options?: MapTreeOptions, context?: C): U[];
export declare function mapTree<U, C = any>(array: any, iterate: (this: C, item: any, index: number, items: any, path: string[], parent: any, nodes: any) => U, options?: MapTreeOptions, context?: C): U[];
declare module './ctor' {
interface XEUtilsMethods {
mapTree: typeof mapTree;
}
}
export default mapTree