import type { Ref } from "vue";
import type { IItem } from '../../ui-package';
import { SORT_ORDER, type IFilter, type ISort } from '../../../types/query';
import type { FILTER_TYPES } from "../filters";
import type { SORTER_TYPES } from "../sorters";
/**
 * Interface for filter renderer component
 * @interface
 * @property {Column} column - Current column instance
 * @property {string} filterable - Renderer component
 */
export interface ICustomFilter extends IFilter {
    column: Column;
    filterable: boolean | FILTER_TYPES | IItem[];
    filterListValues: IItem[];
}
/**
 * Callback for calculating cell values
 * @template T
 * @param {T} dataRow - Original row object from Table.options.data
 * @returns {any} Calculated cell value
 */
export type IAccessorFunction = <T extends object = object>(dataRow: T) => any;
/**
 * Options for column generation
 * @interface
 * @property {string} id - Uniq ID for column
 * @property {string|IAccessorFunction} [accessor=id] - Path or function to get column value
 * @property {boolean} [isVisible] - Initial column visibility
 * @property {string} [visibilityField] - Property name with visibility value
 * @property {string} [header=id] - Text for column header
 * @property {number} [width] - Column width
 * @property {boolean} [sortable] - Allow to apply sort for this column
 */
export interface IColumnOption<P extends Record<string, any> = Record<string, any>> {
    /** Uniq ID for column */
    id: string;
    /** Path or function to get column value */
    accessor?: string | IAccessorFunction;
    /** Initial column visibility */
    isVisible?: boolean;
    /** Property name with visibility value */
    visibilityField?: string;
    /** Text for column header */
    header?: string;
    /** Column width */
    width?: number;
    minWidth?: number;
    cellProps?: Record<string, any>;
    properties?: P;
    /**
     * Allow to apply filter to this column
     * @example { filterable: true } - use default TextFilterComponent
     * @example { filterable: "CellContent" } - use predefined component
     * @example { filterable: "../components/ActindoDataTable/components/renderers/CellTitle.vue" } - use defineAsyncComponent
     * */
    filterable?: boolean | FILTER_TYPES | IItem[];
    filterListValues?: IItem[];
    /** Allow to apply sort for this column */
    sortable?: boolean | SORTER_TYPES;
    /** Default sort order */
    sortedBy?: SORT_ORDER;
    /**
     * Component name or import path for custom renderer
     * @example { renderer: "CellContent" } - use predefined component
     * @example { renderer: "../components/ActindoDataTable/components/renderers/CellTitle.vue" } - use defineAsyncComponent
     * */
    renderer?: string;
}
/**
 * Creates a new column instance
 * @class
 * @property {string} id - Uniq ID for column
 * @property {boolean} isVisible - Initial column visibility
 * @property {string} [visibilityField] - Property name with visibility value
 * @property {IAccessorFunction} accessorFn - Function to get column value
 * @property {string} header - Text for column header
 * @property {number} width - Column width
 * @property {boolean} sortable - Allow to apply sort for this column
 * @property {SORT_ORDER} sortedBy - Actual sort direction for this column
 */
export declare class Column<P extends Record<string, any> = Record<string, any>> implements IColumnOption<P> {
    /** Uniq ID for column */
    id: string;
    /** Initial column visibility */
    isVisible: boolean;
    /** Property name with visibility value */
    visibilityField?: string;
    /** Path or function to get column value */
    accessorFn: IAccessorFunction;
    /** Text for column header */
    header: string;
    /**
     * Allow to apply filter to this column
     * @example { filterable: true } - use default component, defined with DEFAULT_FILTER_COMPONENT
     * @example { filterable: "CellContent" } - use predefined component
     * @example { filterable: "../components/ActindoDataTable/components/renderers/CellTitle.vue" } - use defineAsyncComponent
     * */
    filterable: boolean | FILTER_TYPES | IItem[];
    filterListValues: IItem[];
    /** Allow to apply sort for this column */
    sortable: boolean | SORTER_TYPES;
    /** Actual sort direction for this column */
    sortedBy: SORT_ORDER;
    /** Column position for sort applying  */
    sortIndex: number;
    /** Column width */
    width?: number;
    minWidth?: number;
    cellProps: Record<string, any>;
    properties: P;
    constructor(column: Partial<Column> & IColumnOption);
    /**
     * Returns value for column on specified row
     * @method
     * @param {Record<string, unknown>} row - current row
     * */
    render(row: Record<string, unknown>): any;
    /**
     * Creates column instance
     * @static
     * @param {IColumnOption} options - Options for column creation
     * @param {Partial<IColumnOption>} userDefaultColumn - Additional common options
     * @return {Column} New column instance
     * */
    static getColumnInstance(options: IColumnOption, userDefaultColumn: Partial<IColumnOption>): Column;
    /**
     * Checks if column should be visible
     * @static
     * @param {Column} column - Column instance
     * @return {boolean} Column visibility flag
     * */
    static isColumnVisible(column: Column): boolean;
    /**
     * Places the columns in the specified order
     * @static
     * @param {Column[]} columns - Columns list
     * @param {string[]} [columnsOrder=[]] - Requested columns order
     * @return {Column[]} List of columns placed in the given order
     * */
    static reorderColumns(columns: Column[], columnsOrder?: string[]): Column[];
    /**
     * Change sort order to next step
     * @static
     * @param {Column} column - Column instance
     * @param {boolean} shouldBeSorted - Column can't be unsorted (for multi sort)
     * @return {Column} Column instance with changed sort order
     * */
    static toggleSortOrder(column: Column, shouldBeSorted: boolean): Column;
    /**
     * Update sort order for all columns (depend on multi sort availability)
     * @static
     * @param {object} options
     * @param {Ref<Column[]>} options.allColumns - All columns list
     * @param {Ref<ISort[]>} options.sorters - Actual sorters list
     * @param {Column} options.column - Current column to be sorted
     * @param {boolean} options.shouldUseMultiSort - Column can't be unsorted (for multi sort)
     * */
    static resortColumns({ allColumns, sorters, column, shouldUseMultiSort, }: {
        allColumns: Ref<Column[]>;
        sorters: Ref<ISort[]>;
        column: Column;
        shouldUseMultiSort: boolean;
    }): void;
}
