import { IFilter, IScalarFilterParams, ISimpleFilterParams } from 'ag-grid-community';
import { ColumnDefinition, DateFilterSelectionType, LocationFilterOpt } from '../types';
import { NumberFilterModel } from './NumberFilterRenderer';
export { ClientSideFilter, ServerSideFilter } from './DataTableFilter';
export { useFilterStorage } from './useServerSideFilterStorage';
export interface IFilterProps<Opt = any, Val = number | string | null> {
    getId?: (option: Opt) => Val extends string ? string : Val extends number ? number : unknown;
    getLabel?: (option: Opt) => string;
    getFilterHeadingText?: (columnDefinition: ColumnDefinition) => React.FunctionComponent | string;
    getFilterTokenText?: ({ headerName, value, }: {
        headerName: string;
        value: Val extends string ? string[] : Val extends number ? number[] : unknown[];
    }) => React.FunctionComponent | string;
    getFilterOptions?: () => Promise<Opt[]>;
    placeholder?: string;
    index?: number;
}
export interface IDateFilterProps<Opt = {
    date: Date;
}, Val = string> extends IFilterProps<Opt, Val> {
    /** Controls the type of filtering: single, range,
     * or up to user choice (either) */
    selectionType?: DateFilterSelectionType;
}
export interface ILocationFilterProps<Opt = LocationFilterOpt, Val = string> extends IFilterProps<Opt, Val> {
    onSearch?: (event: React.ChangeEvent<HTMLInputElement>) => void;
}
export interface INumberFilterProps<Opt = {
    id: NumberFilterModel['type'];
    label: string;
}, Val = any> extends Omit<IFilterProps<Opt, Val>, 'getFilterOptions'>, Pick<IScalarFilterParams, 'inRangeInclusive' | 'includeBlanksInEquals' | 'includeBlanksInEquals' | 'includeBlanksInLessThan' | 'includeBlanksInGreaterThan' | 'includeBlanksInRange'> {
    getFilterOptions?: () => ISimpleFilterParams['filterOptions'];
}
export interface FilterComponentProps<Opt = any, Val = Opt[]> {
    columnDefinition: ColumnDefinition;
    filterDef: IFilter;
    getOptions?: () => Promise<boolean>;
    loading: boolean;
    onChange: (value: Opt[] | NumberFilterModel | undefined) => void;
    options: Opt[];
    value: Val;
}
export interface IClientSideFilter {
    active: boolean;
    field: string;
    name: string;
    readonly type: 'list' | 'number';
}
export interface IServerSideFilter {
    field: string;
    name: string;
}
export interface DataTableFilterProps {
    Component: any;
    columnDefinition: ColumnDefinition;
}
export interface IFilterMeta<Opt = any, Val = number | string> {
    headerName?: string;
    filterRenderer?: string;
    field: string;
    filterProps?: IFilterProps<Opt, Val>;
}
export interface IServerFilter<Opt = any, Val = number | string> extends IFilterState<Opt, Val>, IFilterMeta<Opt, Val> {
}
export interface IFilterState<Opt = any, Val = number | string> {
    /**
     * The full selected option shape
     */
    selected: Opt[];
    /**
     * The result of getId from each option
     */
    value: Val[];
    field: string;
}
export interface IServerFiltersState {
    [field: string]: IFilterState;
}
export interface IFilterStorageConfig {
    columnDefinitions: ColumnDefinition[];
    initialSelectedFilters?: IServerFilter[];
    getColumnDefinition: (field: string) => ColumnDefinition | undefined;
}
export interface IFilterStorage<UniversalOpt = any, UniversalVal = number | string> {
    hasDefinedFilters: boolean;
    hasSelectedFilters: boolean;
    getOptions: (field: string) => UniversalOpt[];
    getSelected: (field: string) => IFilterState<UniversalOpt, UniversalVal>;
    getListFilter: (field: string) => IFilterState<UniversalOpt, UniversalVal>;
    selectedFilters: IServerFiltersState;
    onChangeFilterValue: ({ field, value, }: {
        field: string;
        value: any;
    }) => void;
    onClearFilter: (field: string) => void;
    onClearAllFilters: React.MouseEventHandler<HTMLButtonElement>;
    possibleFilters: string[];
    waitForStoredOptions: (field: string) => Promise<void>;
    filtersState: IServerFilter[];
}
declare const _default: {
    dateFilterRenderer: (props: FilterComponentProps<{
        date: Date;
    }, {
        date: Date;
    }[]>) => JSX.Element | null;
    locationFilterRenderer: (props: FilterComponentProps<import("./LocationFilterRenderer").LocationOption, import("./LocationFilterRenderer").LocationOption[]>) => JSX.Element | null;
    numberFilterRenderer: import("react").NamedExoticComponent<FilterComponentProps<unknown, import("./NumberFilterRenderer").NumberFilterValue>>;
    multiSelectFilterRenderer: (props: FilterComponentProps<string, string[]>) => JSX.Element;
};
export default _default;
