import * as React from 'react';
import {SortDirection} from "../../typings/common";

export const ASC: 'ASC';
export const DESC: 'ASC';
export const KEY_ENTER: number;
export const KEY_SPACE: number;

export interface ListSorterProps extends Partial<ListSorterDefaultProps> {
    children?: React.ReactNode;
    property?: string;
    displayName?: string;
    ascendingText?: string;
    descendingText?: string;
    sorterTitleText?: string;
}

export interface ListSorterDefaultProps {
    property: string;
    displayName: string;
    ascendingText: string | null;
    descendingText: string | null;
    sorterTitleText: string | null;
}

type AccessibilityHeaderProps = {
    role: string;
    onKeyDown: typeof ListSorter.prototype.handleKeyDown,
    tabIndex: number;
    title: string;
};

export class ListSorter extends React.Component<ListSorterProps> {
    onClick(): void;
    getDirection(): SortDirection | null;
    renderSorterIcon(): React.Component<any>; // FIXME change it to Icon
    sorterClassName(): string;
    handleKeyDown(e: React.KeyboardEvent<HTMLDivElement>): void;
    getAccessibilityHeaderProps(): AccessibilityHeaderProps;
    getAriaSortName(): string;
}