import { SortType } from '../../utils/data-source/data-source.types';
export interface ActionDefinition {
    caption: string;
    disabled?: boolean;
    disabledFn?: ActionCallback;
    hidden?: boolean;
    hiddenFn?: ActionCallback;
    icon?: string;
    iconFn?: ActionCallback;
    name?: string;
    payload?: any;
    scope?: 'table' | undefined;
}
export interface ActionSelectionEvent {
    action: ActionDefinition;
    row?: RowData;
}
export interface ColumnConfiguration {
    caption?: string | undefined;
    cellFormatter?: CellFormatter;
    cellRenderer?: CellRenderer;
    cellTemplate?: string;
    dataType?: DataType;
    defaultValue?: any;
    editFormatter?: CellFormatter;
    editRenderer?: CellRenderer;
    editTemplate?: string;
    editable?: boolean;
    field: string | undefined;
    filter?: ColumnFilter;
    filterable?: boolean;
    filterTypes?: FilterType[];
    groupIndex?: number;
    groupKey?: string;
    groupKeys?: string[];
    headerFormatter?: ColumnHeaderFormatter;
    pinnable?: boolean;
    pinned?: PinnedType;
    orderable?: boolean;
    options?: OptionsProvider;
    overflow?: TableOverflow;
    rules?: ValidationDefinition[];
    selectable?: boolean;
    sizable?: boolean;
    sortable?: boolean;
    sortIndex?: number;
    sortOrder?: SortType;
    span?: number;
    width?: string;
    visible?: boolean;
}
export interface ColumnDefinition extends ColumnConfiguration {
    cellRenderer: CellRenderer;
    editRenderer: CellRenderer;
    headerRenderer: ColumnHeaderRenderer;
    index: number;
    internal: boolean;
    name: string;
    table: HTMLAnjTableElement;
    contextMenu: () => Promise<HTMLAnjContextMenuItemElement[] | undefined>;
    initCell: (cell: HTMLElement, offset?: string) => Promise<void>;
    setOffset: (offset: string) => Promise<void>;
    setWidth: (width: string) => Promise<void>;
}
export interface ColumnFilter {
    field: string;
    type: FilterType;
    query: any;
}
export interface ColumnMenuItem {
    label: string;
    value: PinnedType;
}
export interface CellProps {
    classList: string;
    column: ColumnDefinition;
    columnIndex: number;
    offset: string;
    renderer: TableRenderer;
    row: RowData;
    rowIndex: number;
}
export interface CellRenderControl {
    when: CellRenderTest;
    cell: CellRenderFn;
}
export interface CellSelectionChange {
    cell: HTMLElement;
    columnField: string;
    rowKey: number | string;
}
export interface ColumnSelectionChange {
    field: string;
    selectedColumnFields?: string[];
}
export interface FilterPanel {
    types: FilterType[];
    field: string;
    filter: ColumnFilter;
    reset: () => Promise<void>;
    anjFilterChange: any;
}
export interface EditData {
    key: any;
    data?: any;
    mode?: EditType;
    index?: number;
}
export interface OffsetsByIndex {
    [index: string]: string;
}
export interface OptionsProvider {
    displayKey: string;
    valueKey: string;
    options: any[];
}
export interface PinBoundaries {
    lastLeftPinned: number | undefined;
    firstRightPinned: number | undefined;
}
export interface PinChange {
    index: number;
    pin: PinnedType;
}
export interface ReorderData {
    currentIndex: number;
    targetIndex?: number;
}
export interface RowData {
    [field: string]: any;
}
export interface RowProps {
    cellRenderers: CellRenderControl[];
    columns: ColumnDefinition[];
    offsets: OffsetsByIndex;
    pinBoundaries: PinBoundaries;
    renderer: TableRenderer;
    row: RowData;
    rowIndex: number;
}
export interface RowRenderControl {
    when: RowRenderTest;
    row: RowRenderFn;
}
export interface RowSelectionChange {
    key: number | string;
    selectedRowKeys?: (number | string)[];
}
export interface SortData {
    field: string;
    order: SortType;
}
export interface TableRenderer {
    cellTemplate: (cell: HTMLElement, offset: string, col: ColumnDefinition, row: RowData, rowIndex: number, template: string) => void;
    fromTemplate: (template: string, targetEl: HTMLElement, row: RowData, rowIndex: number) => void;
    rowTemplate: (template: string, targetEl: HTMLElement, row: RowData, rowIndex: number) => void;
}
export interface ValidationDefinition {
    type: ColumnValidationType;
    value?: string;
}
export declare type ActionCallback = (action: ActionDefinition, data?: RowData) => string | boolean | void;
export declare type CellRenderTest = (column: ColumnDefinition, rowIndex: number, columnIndex: number) => boolean;
export declare type CellFormatter = (row: RowData, field: ColumnDefinition, rowIndex?: number) => string;
export declare type CellRenderer = (row: RowData, field: ColumnDefinition, rowIndex?: number) => any;
export declare type CellRenderFn = (props: CellProps) => any;
export declare type ColumnHeaderFormatter = (field: string, caption?: string) => string;
export declare type ColumnHeaderRenderer = (field: string, caption?: string) => any;
export declare type ColumnValidationType = 'required' | 'pattern' | 'email' | 'min' | 'max' | 'min-length' | 'max-length' | 'step';
export declare type DataType = 'boolean' | 'date' | 'datetime' | 'number' | 'string';
export declare type DetailFormatter = (row: RowData, index?: number, colspan?: number) => string;
export declare type DetailRenderer = (row: RowData, index?: number, colspan?: number) => any;
export declare type EditingMode = 'batch' | 'noop' | 'row';
export declare type EditType = 'create' | 'update' | undefined;
export declare type FilterType = 'contains' | 'ends-with' | 'equals' | 'starts-with';
export declare type RowFormatter = (row: RowData) => string;
export declare type RowRenderer = (row: RowData) => any;
export declare type RowSelectionMode = 'batch' | 'single';
export declare type RowRenderFn = (props: RowProps) => any;
export declare type RowRenderTest = (row: RowData) => boolean;
export declare type PinnedType = 'left' | 'right' | undefined;
export declare type TableOverflow = 'all' | 'cell' | 'header' | undefined;
