import * as React from 'react';
import {List, ListProps, ListState} from './withStore/List';
import {TreeStore} from '../../data/TreeStore';

type TreeListProps<R> = ListProps<R> & {
    store: TreeStore<R>;
};

type TreeListState<R> = {
    nodes: R[];
};

// @ts-ignore
export abstract class TreeList<P extends TreeListProps<R>, S extends TreeListState<R>, R> extends List<P, S, R> {
    onStoreChange(data: any): void;

    hasItems(): boolean;

    renderItems(): React.ReactNode;

    abstract renderItem(...args): any;
}