interface Tree { [key: string]: any; children?: Tree[]; } declare function flatTree(tree: Tree[], list?: Tree[]): Tree[]; export default flatTree;