import { SdBadgeColor } from '@sd-angular/core/badge';
import { SdTabelCellDefDirective } from '../directives/sd-table-cell-def.directive';
import { TemplateRef } from '@angular/core';
export declare type SdTableColumn<T = any> = SdTableColumnText<T> | SdTableColumnNumber<T> | SdTableColumnBool<T> | SdTableColumnDate<T> | SdTableColumnValues<T> | SdTableColumnLazyValues<T> | SdTableColumnChildren<T>;
export declare type SdFilterOperator = 'EQUAL' | 'NOT_EQUAL' | 'CONTAIN' | 'NOT_CONTAIN' | 'IN' | 'NOT_IN' | 'START_WITH' | 'END_WITH' | 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_OR_EQUAL' | 'LESS_OR_EQUAL' | 'NULL' | 'NOT_NULL';
export declare const SdFilterOperators: {
    value: SdFilterOperator;
    symbol?: string;
    display: string;
}[];
export declare type SdTableColumnTransformFunc<T = any> = (value: any, rowData: T, args?: {
    isExport?: boolean;
}) => string | Promise<string>;
interface SdTableColumnBase<T = any> {
    field: Extract<keyof T, string>;
    title: string;
    titleHtml?: string;
    description?: string;
    width?: string;
    hidden?: boolean;
    invisible?: boolean;
    fixed?: boolean;
    cellStyle?: (value: any, rowData: T) => Record<string, string>;
    htmlTemplate?: (value: any, rowData: T) => string;
    transform?: SdTableColumnTransformFunc<T>;
    tooltip?: (value: any, rowData: T) => string;
    click?: (value: any, rowData: T) => void;
    sortable?: boolean;
    filter?: {
        disabled?: boolean;
        defaultShowing?: boolean;
        default?: any;
        operator?: {
            default?: SdFilterOperator;
            enable?: boolean;
            list?: SdFilterOperator[];
        };
    };
    export?: {
        disabled?: boolean;
    };
    cellDef?: TemplateRef<SdTabelCellDefDirective>;
}
interface SdTableColumnText<T = any> extends SdTableColumnBase<T> {
    type: 'string';
    badge?: (value: any, rowData: T) => SdBadgeColor;
    badgeIcon?: (value: any, rowData: T) => string;
    badgeType?: 'circle' | 'icon';
}
interface SdTableColumnNumber<T = any> extends SdTableColumnBase<T> {
    type: 'number';
    badge?: (value: any, rowData: T) => SdBadgeColor;
    badgeIcon?: (value: any, rowData: T) => string;
    badgeType?: 'circle' | 'icon';
}
interface SdTableColumnBool<T = any> extends SdTableColumnBase<T> {
    type: 'bool';
    option?: {
        displayOnTrue?: string;
        displayOnFalse?: string;
    };
}
interface SdTableColumnDate<T = any> extends SdTableColumnBase<T> {
    type: 'date' | 'datetime' | 'time';
    filter?: SdTableColumnBase['filter'] & {
        useFilterDate?: boolean;
    };
}
export interface SdTableColumnValues<T = any> extends SdTableColumnBase<T> {
    type: 'values';
    badge?: (value: any, rowData: T) => SdBadgeColor;
    badgeIcon?: (value: any, rowData: T) => string;
    badgeType?: 'icon' | 'circle' | 'round';
    option: {
        valueField: string;
        displayField: string;
        items: any[] | (() => Promise<any[]>);
        selection?: 'AUTOCOMPLETE' | 'MULTIPLE' | 'MULTIPLEAUTOCOMPLETE';
    };
}
export interface SdTableColumnLazyValues<T = any> extends SdTableColumnBase<T> {
    type: 'lazy-values';
    option: {
        valueField: string;
        displayField: string;
        items: (searchText: string) => Promise<any[]>;
        views?: (values: string[]) => Promise<any[]>;
        mapValue?: (value: any, rowData?: T) => string | string[];
        selection?: 'MULTIPLE';
    };
}
declare type SdTableColumnNormal<T> = Exclude<SdTableColumn<T>, SdTableColumnChildren<T>>;
export interface SdTableColumnChildren<T = any> extends SdTableColumnBase<T> {
    type: 'children';
    children: SdTableColumnNormal<T>[];
}
export {};
