import * as React from 'react';
import {Store} from '../../../data/Store';

type ListProps<R> = {
    isBlocked?: boolean;
    noResultsText?: string;
    blockedText?: string;
    store?: Store<R>;
} & Partial<ListDefaultProps>;

type ListDefaultProps = {
    isBlocked: boolean;
    noResultsText: string;
    blockedText: string;
};

type ListState<R> = {
    rows: R[];
};

export abstract class List<P extends ListProps<R>, S extends ListState<R>, R = any> extends React.Component<P, S> {
    static defaultProps: Partial<ListDefaultProps>;
    _context: any;

    getChildContext(): any;
    onStoreChange(data: any): void;
    highlight(text: string): React.ReactNode;
    getDetails(): any;
    hasItems(): boolean;
    rowClickHandler(Function): (Event) => void;
    renderEmpty(): any;
    renderEmptyListMessage(): any;
    renderBlockedMessage(): any;
    renderItems(): any;
    abstract renderItem(...args): any;
}
