import { Observable } from 'rxjs';
import { SdFilterOperator, SdTableColumn } from '../../models/table-column.model';
import { SdTableFilterDefDirective } from '../../directives/sd-table-filter-def.directive';
import { TemplateRef } from '@angular/core';
export declare class SdTableQuickFilter {
    code: string;
    columnFilter: {
        [field: string]: any;
    };
    externalFilter: {
        [field: string]: any;
    };
    filterDef: {
        [field: string]: any;
    };
}
export interface SdTableFilterConfiguration {
    inlineColumn: Record<string, boolean>;
    inlineExternal: Record<string, boolean>;
    inlineFilterDef: Record<string, boolean>;
}
export interface SdTableFilterValue {
    columnOperator?: Record<string, SdFilterOperator>;
    columnFilter?: Record<string, any>;
    externalFilter?: Record<string, any>;
    filterDef?: Record<string, any>;
    notReload?: boolean;
}
export interface SdTableFilterRequest<T = any> {
    columnOperator: Record<string, SdFilterOperator>;
    rawColumnFilter: Record<keyof T, any>;
    rawExternalFilter: Record<string, any>;
    rawFilterDef: Record<string, any>;
    pageNumber: number;
    pageSize: number;
    orderBy: string;
    orderDirection: 'asc' | 'desc' | '';
    isExported?: boolean;
}
export interface SdTableOptionFilter {
    key?: string;
    cacheFilter?: boolean;
    disabled?: boolean;
    hideInlineFilter?: boolean;
    externalFilters?: SdTableExternalFilter[];
    sorts?: string[];
    enableCollapse?: boolean;
    operatorChange?: (column?: SdTableColumn, operator?: SdFilterOperator) => void;
}
export declare type SdTableExternalFilter = TextFilter | DateFilter | DateTimeFilter | DateRangeFilter | NumberFilter | ValuesFilter | LazyValuesFilter | BoolFilter | CustomFilter;
interface BaseFilter {
    field: string;
    title: string;
    defaultShowing?: boolean;
    disabled?: boolean;
}
interface TextFilter extends BaseFilter {
    type: 'string';
    default?: string;
}
interface DateFilter extends BaseFilter {
    type: 'date';
    default?: Date | string;
    minDate?: string | Date;
    maxDate?: string | Date;
}
interface DateTimeFilter extends BaseFilter {
    type: 'datetime';
    default?: Date | string;
    minDate?: string | Date;
    maxDate?: string | Date;
}
interface DateRangeFilter extends BaseFilter {
    type: 'daterange';
    enableTime?: boolean;
    minDate?: string | Date;
    maxDate?: string | Date;
    default?: {
        from?: Date | string;
        to?: Date | string;
    };
}
interface NumberFilter extends BaseFilter {
    type: 'number';
    default?: number;
}
interface ValuesFilter extends BaseFilter {
    type: 'values';
    option: {
        valueField: string;
        displayField: string;
        items: any[] | (() => Promise<any[]>);
        selection?: 'AUTOCOMPLETE' | 'MULTIPLE' | 'MULTIPLEAUTOCOMPLETE';
    };
    default?: string | string[];
}
interface LazyValuesFilter extends BaseFilter {
    type: 'lazy-values';
    option: {
        valueField: string;
        displayField: string;
        items: (searchText: string) => Promise<any[]>;
        selection?: 'MULTIPLE';
    };
    default?: string | string[];
}
interface BoolFilter extends BaseFilter {
    type: 'bool';
    option?: {
        displayOnTrue?: string;
        displayOnFalse?: string;
    };
    default?: boolean;
}
interface CustomFilter extends BaseFilter {
    type: 'custom';
    filterDef?: TemplateRef<SdTableFilterDefDirective>;
    default?: any;
}
export interface SdTableFilterRegister {
    configuration: {
        get: () => SdTableFilterConfiguration;
        set: (configuration: Partial<SdTableFilterConfiguration>) => SdTableFilterConfiguration;
        remove: () => void;
        observer: Observable<SdTableFilterConfiguration>;
    };
    value: {
        get: () => SdTableFilterValue;
        set: (value: Partial<SdTableFilterValue>) => SdTableFilterValue;
        remove: () => void;
        observer: Observable<SdTableFilterValue>;
    };
}
export {};
