import { ChangeValueOptions, Filter, FilterEvents, FilterItem, FilterStateBaseParams } from '../../model';
export interface CustomFilterStateParams<T> extends FilterStateBaseParams<T> {
    /**
     * The value to set the value to, when clearing the filter.
     * @external
     */
    defaultValue: T;
    /**
     * Indicates whether nothing is selected.<br>
     * For example, when implementing a range filter, when both minimum and maximum inputs are empty
     * @external
     */
    isEmpty: (value: T) => boolean;
    /**
     * Indicates the number of effective filters.<br>
     * For example, when implementing a range filter, 1 when only minimum/maximum are entered, 2 - when both entered.
     * @default A function that 0 when `isEmpty` returns true, and 1 otherwise.
     * @external
     */
    size?: (value: T) => number;
    /**
     * Convert the filter value to a string, to be stored in a URL.
     * @external
     */
    toQueryString?: (value: T) => string;
    /**
     * Convert the a string value to the filter value, to be retrieved from a URL.
     * @external
     */
    fromQueryString?: (str: string) => T;
    /**
     * Convert a unknown object to a T.<br>
     * If the function returns null, the item will be skipped when we try to deserializate it from an array.
     * @param value
     * @external
     */
    readonly decode: (value: unknown) => T;
    /**
     * Return a simplified form of an item for serialization.
     * @param value
     * @external
     */
    readonly encode: (value: T) => unknown;
    /**
     * Flatten the correct selection to an array, to be shown in the table sub-toolbar in a tag list.
     * Usually this will return an array with a single item, but it gives control when we want to show more than a 1 tag in the tag list.
     * @external
     */
    toArray: (value: T) => FilterItem<T>[];
    /**
     * Remove a tag from the tag list.
     * @default A function that returns `defaultValue`.
     * @external
     */
    remove?: (item: FilterItem<T>[], value: T) => T;
    /**
     * Indicates whether current filter value is different than `data`
     * @external
     */
    hasDiff?: (data: T) => boolean;
    /**
     * Indicates whether an item matches the current value of the filter
     * @external
     */
    matches?: (item: FilterItem<T>, value: T) => boolean;
    equals?: (item1: FilterItem<T>, item2: FilterItem<T>) => boolean;
}
export declare class CustomFilterState<T> implements Filter<T> {
    name: string;
    persistent: boolean | undefined;
    defaultValue: T;
    _value: T;
    private readonly _isEmpty;
    private readonly _size;
    private readonly _toQueryString?;
    private readonly _fromQueryString?;
    readonly _toArray: (value: T) => FilterItem<T>[];
    private readonly _remove;
    private readonly _hasDiff;
    readonly decode: (value: unknown) => T;
    readonly encode: (value: T) => unknown;
    readonly itemKey: (item: FilterItem<T>) => string;
    readonly itemName: (item: FilterItem<T>) => string;
    readonly matches: (item: FilterItem<T>, value: T) => boolean;
    readonly equals?: (item1: FilterItem<T>, item2: FilterItem<T>) => boolean;
    readonly events: FilterEvents;
    constructor(params: Readonly<CustomFilterStateParams<T>>);
    get value(): T;
    get toArray(): FilterItem<T>[];
    get isEmpty(): boolean;
    get size(): number;
    setValue(value: T, { emitEvents, ...options }?: ChangeValueOptions): void;
    changeValue(value: T, { emitEvents, ...options }?: ChangeValueOptions): void;
    refresh(value: T, options?: ChangeValueOptions): void;
    scheduleRefresh(value: T): void;
    get toQueryString(): string;
    applyFromQueryString(str: string): void;
    reset(options?: ChangeValueOptions): void;
    remove(items: FilterItem<T>[], options?: ChangeValueOptions): void;
    hasDiff(data: T): boolean;
    clone(params: Partial<CustomFilterStateParams<T>>): CustomFilterState<T>;
}
export declare const customFilter: <T>(params: CustomFilterStateParams<T>) => CustomFilterState<T>;
//# sourceMappingURL=CustomFilterState.d.ts.map