eachTree.d.ts 1.0 KB

12345678910111213141516171819202122
  1. export interface EachTreeOptions {
  2. children?: string;
  3. }
  4. /**
  5. * 从树结构中遍历数据的键、值、路径
  6. * @param {Object} list 数组
  7. * @param {Function} iterate(item, index, items, path, parent, nodes) 回调
  8. * @param {Object} options {children: 'children'}
  9. * @param {Object} context 上下文
  10. */
  11. export declare function eachTree<T, C>(list: T[], iterate: (this: C, item: T, index: number, items: T[], path: string[], parent: T, nodes: T[]) => void, options?: EachTreeOptions, context?: C): void;
  12. export declare function eachTree<C>(list: any[], iterate: (this: C, item: any, index: number, items: any[], path: string[], parent: any, nodes: any[]) => void, options?: EachTreeOptions, context?: C): void;
  13. export declare function eachTree<C>(list: any, iterate: (this: C, item: any, index: number, items: any, path: string[], parent: any, nodes: any) => void, options?: EachTreeOptions, context?: C): void;
  14. declare module './ctor' {
  15. interface XEUtilsMethods {
  16. eachTree: typeof eachTree;
  17. }
  18. }
  19. export default eachTree