@lukeaus/plain-tree
Version:
A plain tree with a bunch of tree tools
9 lines (8 loc) • 857 B
TypeScript
import { CreateOptions, CreateOptionsWithCustomChildrenKey, ObjectAnyProperties } from './types';
import Tree from './Tree';
import Node from './Node';
export declare const createTreeArrayFromFlatArray: (data: ObjectAnyProperties[], { idKey, parentIdKey, childrenKey }?: CreateOptionsWithCustomChildrenKey) => ObjectAnyProperties[];
export declare const objectToNode: (obj: object, parent?: Node, { idKey, parentIdKey, childrenKey }?: CreateOptionsWithCustomChildrenKey) => Node;
export declare const createNodes: (data: ObjectAnyProperties[], parentNode?: Node, opts?: CreateOptionsWithCustomChildrenKey) => void;
export declare const createTreeFromTreeArray: (data: ObjectAnyProperties[], opts?: CreateOptionsWithCustomChildrenKey) => Tree;
export declare const createTreeFromFlatArray: (data: ObjectAnyProperties[], opts?: CreateOptions) => any;