import { ZUICheckboxStatus } from '../checkbox.type';
import { ZUIColumnCommand } from './command.type';
import { ZuiColumnCommon, ZuiFunction } from './common.type';
import { ZuiTableExportDetail } from './export.type';
export interface ZUITable<T = any> {
    columns: ZUIColumn<T>[];
    items?: T[] | (() => T[] | Promise<T[]>);
    type?: 'local' | 'server';
    config?: ZUIConfig<T>;
}
export interface ZUIConfig<T> {
    height?: string;
    style?: 'normal' | 'card';
    hoverHighlight?: {
        /** default: true */
        visible?: boolean;
        color?: string;
    };
    scrollbar?: {
        /** default: true */
        hoverToHide?: boolean;
        /** default: true */
        custom?: boolean;
    };
    paginator?: {
        pageSizeOptions?: number[];
        pageSize?: number;
        pageIndex?: number;
        disabled?: boolean;
        showFirstLastButtons?: boolean;
        /** default: false */
        visible?: boolean;
    };
    empty?: {
        visible?: boolean;
        icon?: string;
        text?: string;
        color?: string;
    };
    reload?: {
        /** default: false */
        visible: boolean;
    };
    filter?: {
        /** default: false */
        visible: boolean;
    };
    option?: {
        /** default: false */
        visible: boolean;
    };
    export?: {
        /** default: false */
        visible: boolean;
        excel?: ZuiTableExportDetail<T>;
        csv?: ZuiTableExportDetail<T>;
        custom?: ZuiTableExportDetail<T>;
    };
    import?: {
        /** default: false */
        visible: boolean;
        custom?: any;
    };
}
declare type ZUIColumn<T> = ZUIColumnString<T> | ZUIColumnNumber<T> | ZUIColumnBoolean<T> | ZUIColumnImage<T> | ZUIColumnLink<T> | ZUIColumnDateTime<T> | ZUIColumnDate<T> | ZUIColumnTime<T> | ZUIColumnOptions<T> | ZUIColumnCommand<T> | ZUIColumnNO<T> | ZUIColumnCheckbox<T> | ZUIColumnExpanded<T>;
interface ZUIColumnString<T> extends ZuiColumnCommon<T, string> {
    type: 'string';
    lowercase?: boolean;
    uppercase?: boolean;
    capital?: boolean;
}
interface ZUIColumnNumber<T> extends ZuiColumnCommon<T, number> {
    type: 'number';
    prefix?: string;
    surfix?: string;
    /** default: true */
    formatNumber?: boolean;
}
interface ZUIColumnBoolean<T> extends ZuiColumnCommon<T, boolean> {
    type: 'boolean';
    trueDisplay?: any;
    falseDisplay?: any;
}
interface ZUIColumnImage<T> extends ZuiColumnCommon<T, string> {
    type: 'image';
    clickToOpen?: boolean;
    width?: string;
    height?: string;
    objectFit?: 'contain' | 'cover' | 'fill';
}
export interface ZUIColumnLink<T> extends ZuiColumnCommon<T, string> {
    type: 'link';
    target?: '_blank' | '_self';
    text?: ZuiFunction<T, any, string>;
}
interface ZUIColumnDateTime<T> extends ZuiColumnCommon<T, Date> {
    type: 'datetime';
    /** https://angular.io/api/common/DatePipe#custom-format-options */
    format?: string;
    /** default: false */
    showSecond?: boolean;
}
interface ZUIColumnDate<T> extends ZuiColumnCommon<T, Date> {
    type: 'date';
    /** https://angular.io/api/common/DatePipe#custom-format-options */
    format?: string;
}
interface ZUIColumnTime<T> extends ZuiColumnCommon<T, Date> {
    type: 'time';
    /** https://angular.io/api/common/DatePipe#custom-format-options */
    format?: string;
    /** default: false */
    showSecond?: boolean;
}
interface ZUIColumnOptions<T> extends ZuiColumnCommon<T> {
    type: 'options';
    options: [];
    key: string;
    value: string;
}
interface ZUIColumnNO<T> extends Omit<ZuiColumnCommon<T>, 'field'> {
    type: 'no';
    field: string;
}
interface ZUIColumnCheckbox<T> extends Omit<ZuiColumnCommon<T>, 'field' | 'title'> {
    type: 'checkbox';
    field?: string;
    title?: string;
    checkAll?: boolean;
    status?: ZUICheckboxStatus;
    color?: string;
    lineCheckedColor?: string;
    rippleColor?: string;
    /**
     * @row raw item data
     * @index table paging index, start from 0
     */
    show?: (row?: T, index?: number) => boolean;
}
export interface ZUIColumnExpanded<T> extends Omit<ZuiColumnCommon<T>, 'field' | 'title'> {
    type: 'expanded';
    field: string;
    title?: string;
    multiple?: boolean;
    click?: (row?: T) => void | Promise<void>;
}
export interface ZUITableSpecialColumn {
    expandedDetail: string;
    checkAll: string;
    index: string;
    expanded: string;
    expandLoading: string;
    check: string;
    empty: string;
    displayValue: string;
}
export {};
