import { Filter as FilterType, FilterParams, FilterType as FilterTypeName, IColumn, IFilter } from '../../../../../../types/src/table';
import { default as Column } from '../../core/column/Column';
import { default as Module } from '../../core/Module';
import { default as Row } from '../../core/row/Row';

type FilterFunc = (filterVal: any, rowVal: any, rowData: any, filterParams: FilterParams) => boolean;
type FilterItem = FilterType & {
    func?: (data: any) => boolean;
    params?: FilterParams;
};
type HeaderFilterConfig = {
    func: (data: any) => boolean;
    type: FilterTypeName | ((data: any) => boolean);
    value: any;
};
export default class Filter extends Module implements IFilter {
    static moduleName: string;
    static filters: Record<string, FilterFunc>;
    filterList: FilterItem[];
    headerFilters: Record<string, HeaderFilterConfig>;
    headerFilterColumns: IColumn[];
    prevHeaderFilterChangeCheck: string;
    changed: boolean;
    tableInitialized: boolean;
    constructor(table: any);
    initialize(): void;
    tableBuilt(): void;
    /**
     * This function is called when the data is fetched from the remote source.
     * @param data - The data object containing the filter parameters.
     * @param config - The configuration object containing the filter configuration.
     * @param silent - Whether to suppress the filter parameters.
     * @param params - The parameters object containing the filter parameters.
     * @returns The filter parameters.
     */
    remoteFilterParams(data: any, config: any, silent: any, params: any): any;
    generatePlaceholder(_text: string): string | undefined;
    userSetFilter(filter: FilterType | FilterType[]): void;
    userRefreshFilter(): void;
    userAddFilter(filter: FilterType | FilterType[]): void;
    userSetHeaderFilterFocus(field: string): void;
    userGetHeaderFilterValue(field: string): any;
    userSetHeaderFilterValue(field: string, value: any): void;
    userRemoveFilter(field: string | FilterType[], type?: FilterTypeName, value?: any): void;
    userClearFilter(all?: boolean): void;
    userClearHeaderFilter(): void;
    searchRows(filter: FilterType | FilterType[]): any[];
    searchData(filter: FilterType | FilterType[]): any[];
    initializeColumnHeaderFilter(column: Column): void;
    initializeColumn(column: Column, _initialValue?: any): void;
    generateHeaderFilterElement(column: IColumn, initialValue?: any, reinitialize?: boolean): void;
    hideHeaderFilterElements(): void;
    showHeaderFilterElements(): void;
    setHeaderFilterFocus(column: IColumn): void;
    getHeaderFilterValue(column: IColumn): any;
    setHeaderFilterValue(column: IColumn, value: any): void;
    reloadHeaderFilter(column: IColumn): void;
    refreshFilter(): void;
    trackChanges(): void;
    hasChanged(): boolean;
    /**
     * Normally, filter operates on a single field. To create a filter that operates on multiple
     * or all registered columns, first pass the field names (or none to default to every
     * registered column's field) to this method, then use this method as the filter's field.
     *
     * When `fields` is omitted, the search iterates only over fields that have a registered
     * column. Data keys without a column (e.g. hidden payload fields) are skipped so the search
     * matches what the user actually sees on screen. If the column manager has no columns yet
     * (table not yet initialized), falls back to iterating all data keys.
     *
     * @param fields - The fields to match against. If not provided, all fields with a registered column will be matched.
     * @returns A function that can be used to match against the data.
     */
    createFilterFieldFunction(fields?: string[]): (data: any, filter: FilterType) => boolean;
    /**
     * This function is used to set a new filter on the table data.
     * By default, there are 12 built-in filter operations (see FilterTypeName enum).
     * Out of the box, tabulator-tables has no distinction between search and filter.
     * To support the distinction, we reserve Like and Keywords for search, and all other filters for filtering.
     * @param field - The field to set the filter for.
     * @param type - The type of filter to set.
     * @param value - The value to set the filter for.
     * @param params - The parameters to configure the filter.
     */
    setFilter(filterParams: FilterType | FilterType[]): void;
    addFilter(filter: FilterType | FilterType[]): void;
    findFilter(filter: FilterType | FilterType[]): FilterItem | false;
    findSubFilters(filters: FilterType[]): FilterItem[] | false;
    getFilters(all?: boolean, ajax?: boolean): FilterType[];
    filtersToArray(filterList: FilterItem[], ajax?: boolean): FilterType[];
    getHeaderFilters(): FilterType[];
    removeFilter(field: string | FilterType[], type?: FilterTypeName, value?: any): void;
    clearFilter(all?: boolean): void;
    clearHeaderFilter(): void;
    search(searchType: 'rows' | 'data', filters: FilterType | FilterType[]): any[];
    filter(rowList: Row[], _filters?: any): Row[];
    filterRow(row: Row, _filters?: any): boolean;
    filterRecurse(filter: FilterItem | FilterItem[], data: any): boolean;
}
export {};
