import { WxConfirmOptions } from '../WxConfirm';
import { Action } from 'material-table';
/**
 * 新增和插入
 */
export declare type Insertable<T extends object> = {
    /**
     * 是否允许新增
     */
    isNewable?: boolean;
    /**
     * 是否显示新增按钮
     */
    showNewButton?: boolean;
    /**
     * 该行是否可编辑
     */
    isEditable?: (rowData: T) => boolean;
    /**
     * 更新
     */
    onUpdate?: (newData: Array<T>) => Promise<any> | void;
};
/**
 * 删除
 */
export declare type Deletable<T> = (rowData: T) => {
    confirmOptions: WxConfirmOptions;
    disabled?: boolean;
};
/**
 * 上下移动
 */
export declare type Sortable<T extends object> = {
    onSort?: (rowData: T, index: number, type: 'up' | 'down', newData: Array<any>) => Promise<any> | void;
};
/**
 * 额外操作
 */
export declare type Actions<T extends object> = Array<Action<T> | ((rowData: T) => Action<T>)>;
interface MapActions<T extends object> {
    myData: T[];
    setMyData: (newValue: T[]) => void;
    onEditRow: (event: any, data: T) => void;
    insertable?: Insertable<T>;
    deletable?: Deletable<T>;
    sortable?: Sortable<T>;
    readonly?: boolean;
    actions?: Actions<T>;
    setLoading?: (loading: boolean) => void;
}
export default function mapActions<T extends object>({ myData, setMyData, onEditRow, insertable, deletable, sortable, readonly, actions, setLoading, }: MapActions<T>): Actions<T>;
export {};
