import { SdNestedKeyOf } from '@sd-angular/core/utilities';
import { SdTableFilterRequest } from '../services/table-filter/table-filter.model';
export type SdTableOptionExport<T = any> = SdTableOptionExportDefault<T> | SdTableOptionExportCustom;
export interface SdTableOptionExportDefault<T = any> {
    type?: 'default';
    key?: string;
    visible?: 'ALL' | 'EXCEL' | 'CSV';
    enableUpload?: boolean;
    fileName?: string;
    max?: number;
    maxItemsPerRequest?: number;
    batch?: number;
    items?: (filterRequest: SdTableFilterRequest) => T[] | Promise<T[]> | Promise<{
        items: any[];
        total: number;
    }>;
    mapping?: (items: T[], fileName?: string) => T[] | Promise<T[]>;
    columns?: SdTableOptionExportColumn<T>[];
    sheets?: SdTableOptionExportSheet[];
}
export interface SdTableOptionExportCustom {
    type: 'custom';
    onExport: (filterRequest: SdTableFilterRequest) => Promise<void>;
}
export interface SdTableOptionExportColumn<T = any> {
    field: SdNestedKeyOf<T>;
    title: string;
    description?: string;
    width?: string;
    transform?: (value: any, rowData: T) => string;
    export?: {
        disabled: boolean;
    };
}
export interface SdTableOptionExportSheet<T = any> {
    name: string;
    items: T[] | (() => T[] | Promise<T[]>);
    headers: {
        value: SdNestedKeyOf<T>;
        display: string;
    }[];
}
