UNPKG

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