useFlattenRecords.d.ts 651 B

123456789101112131415161718
  1. import type { Ref } from 'vue';
  2. import type { GetRowKey, Key } from '../interface';
  3. /**
  4. * flat tree data on expanded state
  5. *
  6. * @export
  7. * @template T
  8. * @param {*} data : table data
  9. * @param {string} childrenColumnName : 指定树形结构的列名
  10. * @param {Set<Key>} expandedKeys : 展开的行对应的keys
  11. * @param {GetRowKey<T>} getRowKey : 获取当前rowKey的方法
  12. * @returns flattened data
  13. */
  14. export default function useFlattenRecords<T = unknown>(dataRef: Ref<T[]>, childrenColumnNameRef: Ref<string>, expandedKeysRef: Ref<Set<Key>>, getRowKey: Ref<GetRowKey<T>>): Ref<{
  15. record: T;
  16. indent: number;
  17. index: number;
  18. }[]>;