toTreeArray.d.ts 554 B

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