import type { CellValue } from './base';
export declare enum WorkSheetEventType {
    CELL_CLICK = "cell-click",
    CELL_VALUE_CHANGED = "cell-value-changed",
    SELECTION_CHANGED = "selection-changed",
    SELECTION_END = "selection-end"
}
export type EventHandler = (...args: any[]) => void;
export interface CellClickEvent {
    row: number;
    col: number;
    value?: CellValue;
    cellElement?: HTMLElement;
    originalEvent?: MouseEvent | KeyboardEvent;
}
export interface CellValueChangedEvent {
    row: number;
    col: number;
    newValue: CellValue;
    oldValue: CellValue;
    cellElement?: HTMLElement;
    isUserAction?: boolean;
    isFormulaCalculation?: boolean;
}
export interface SelectionChangedEvent {
    row: number;
    col: number;
    ranges?: Array<{
        start: {
            row: number;
            col: number;
        };
        end: {
            row: number;
            col: number;
        };
    }>;
    cells?: Array<Array<{
        row: number;
        col: number;
        value?: CellValue;
    }>>;
    originalEvent?: MouseEvent | KeyboardEvent;
}
export interface EditStartEvent {
    row: number;
    col: number;
    value: CellValue;
    editorElement?: HTMLElement;
}
export interface EditEndEvent {
    row: number;
    col: number;
    oldValue: CellValue;
    newValue: CellValue;
    isCancelled?: boolean;
}
export interface SheetResizedEvent {
    width: number;
    height: number;
    oldWidth?: number;
    oldHeight?: number;
}
export interface DataChangedEvent {
    changes: Array<{
        row: number;
        col: number;
        oldValue: CellValue;
        newValue: CellValue;
    }>;
    isUserAction?: boolean;
}
export interface DataSortedEvent {
    field: string;
    order: 'asc' | 'desc' | null;
    orderFn?: Function;
}
export interface IEventMap {
    [WorkSheetEventType.CELL_CLICK]: CellClickEvent;
    [WorkSheetEventType.CELL_VALUE_CHANGED]: CellValueChangedEvent;
    [WorkSheetEventType.SELECTION_CHANGED]: SelectionChangedEvent;
    [WorkSheetEventType.SELECTION_END]: SelectionChangedEvent;
}
export interface IEventManager {
    on: <K extends keyof IEventMap>(event: K, handler: (payload: IEventMap[K]) => void) => void;
    off: <K extends keyof IEventMap>(event: K, handler: (payload: IEventMap[K]) => void) => void;
    emit: <K extends keyof IEventMap>(event: K, payload: IEventMap[K]) => void;
    once: <K extends keyof IEventMap>(event: K, handler: (payload: IEventMap[K]) => void) => void;
    removeAllListeners: () => void;
}
