toTreeArray.d.ts 646 B

123456789101112131415161718192021222324
  1. export interface ToTreeArrayOptions {
  2. key?: string;
  3. parentKey?: string;
  4. children?: string;
  5. data?: string;
  6. updated?: boolean
  7. clear?: boolean;
  8. }
  9. /**
  10. * 将一个树结构转成数组列表
  11. * @param {Array} list 数组
  12. * @param {Object} options { key: 'id', parentKey: 'parentId', children: 'children', data: 'data', clear: false }
  13. */
  14. export declare function toTreeArray<T>(list: T[], options?: ToTreeArrayOptions): T[];
  15. export declare function toTreeArray(list: any, options?: ToTreeArrayOptions): any[];
  16. declare module './ctor' {
  17. interface XEUtilsMethods {
  18. toTreeArray: typeof toTreeArray;
  19. }
  20. }
  21. export default toTreeArray