import {Store} from "./Store";
import {HashMap} from "../typings/common";


export abstract class TreeStore<V> extends Store<V> {
    treeHashMap: HashMap<V>;

    useBackend(): boolean;

    getChildrenKey(): string;

    getChildren(node): V[] | void;

    addChild(parent: V, child: V): void;

    getParentKey(): string;

    getParent(node: V, hashMap?: HashMap<V>): V | undefined;

    getHashMap(): HashMap<V>;

    getNodeById(id): V | void;

    countItems(list): number;

    addParentsToResultArray(node, array, hashMap): void;

    addChildrenToResultArray(node, array, hashMap): void;

    getFilteredTree(list, hashMap): HashMap<V>

    getItemsHashMap(data): HashMap<V>

    assembleTree(nodes, hashMap): V[];

    convert(data): V[];

    calculate(data): void;

    applyCallbackToSubtree(node, index, fn, level?: number): void;

    applyCallbackToParents(node, fn): void;

    loadWithParams(): void;
}