import { IRowColEvent } from '../abstract-row-col-model'; export declare const EVENTS: Array; export declare const GRID_EVENTS: string[]; export interface IAnnotatedEvent { realRow: number; realCol: number; virtualRow: number; virtualCol: number; row: number; col: number; } export interface IAnnotatedMouseEvent extends IAnnotatedEvent { gridX: number; gridY: number; } export interface IGridCustomMouseEvent extends CustomEvent, IAnnotatedMouseEvent { clientX: number; clientY: number; layerX: number; layerY: number; originalEvent: AnnotatedMouseEventUnion; } export interface IGridDragStartEvent extends IGridCustomMouseEvent { enableAutoScroll(): void; } export declare type GridCustomMouseEventMap = { 'grid-drag': IGridCustomMouseEvent; 'grid-cell-drag': IGridCustomMouseEvent; 'grid-drag-start': IGridDragStartEvent; 'grid-drag-end': IGridCustomMouseEvent; 'grid-cell-mouse-move': IGridCustomMouseEvent; }; export declare type GridCustomMouseEventTypes = keyof GridCustomMouseEventMap; export declare type GridCustomEventMap = GridCustomMouseEventMap & { 'grid-row-change': IRowColEvent; 'grid-col-change': IRowColEvent; }; export declare const isAnnotatedGridCustomMouseEvent: (e: EventUnion) => e is AnnotatedGridCustomMouseEventUnion; export declare const ANNOTATED_MOUSE_EVENTS: { click: boolean; dblclick: boolean; mousedown: boolean; mousemove: boolean; mouseup: boolean; }; export declare const ANNOTATED_MOUSE_EVENTS_MAP: { readonly [key: string]: boolean | undefined; }; export declare const isAnnotatedMouseEvent: (e: EventUnion) => e is IAnnotatedMouseEvent & MouseEvent; export declare const isAnnotatedMouseEventOfType: (e: EventUnion, type: T) => e is AnnotatedHTMLElementMouseEventMap[T]; export declare const ANNOTATED_KEY_EVENTS: { keydown: boolean; keypress: boolean; keyup: boolean; }; export declare const ANNOTATED_KEY_EVENTS_MAP: { readonly [key: string]: boolean | undefined; }; export declare const isAnnotatedKeyEvent: (e: EventUnion) => e is IAnnotatedEvent & KeyboardEvent; export declare const isAnnotatedMouseOrKeyEvent: (e: EventUnion) => e is AnnotatedMouseOrKeyEventUnion; export declare const isAnnotatedEvent: (e: EventUnion) => e is AnnotatedEventUnion; export declare type AnnotatedHTMLElementKeyEventMap = { [K in keyof typeof ANNOTATED_KEY_EVENTS]: IAnnotatedEvent & HTMLElementEventMap[K]; }; export declare type AnnotatedHTMLElementMouseEventMap = { [K in keyof typeof ANNOTATED_MOUSE_EVENTS]: IAnnotatedMouseEvent & HTMLElementEventMap[K]; }; export declare type AnnotatedHTMLElementEventMap = AnnotatedHTMLElementKeyEventMap & AnnotatedHTMLElementMouseEventMap; export declare type AnnotatedGridCustomMouseEventUnion = GridCustomMouseEventMap[keyof GridCustomMouseEventMap]; export declare type AnnotatedMouseEventUnion = AnnotatedHTMLElementMouseEventMap[keyof AnnotatedHTMLElementMouseEventMap]; export declare type AnnotatedKeyEventUnion = AnnotatedHTMLElementKeyEventMap[keyof AnnotatedHTMLElementKeyEventMap]; export declare type AnnotatedMouseOrKeyEventUnion = AnnotatedMouseEventUnion | AnnotatedKeyEventUnion; export declare type AnnotatedEventUnion = AnnotatedMouseOrKeyEventUnion | AnnotatedGridCustomMouseEventUnion; export declare type AnnotatedWindowKeyEventMap = { [K in keyof typeof ANNOTATED_KEY_EVENTS]: IAnnotatedEvent & WindowEventMap[K]; }; export declare type AnnotatedWindowMouseEventMap = { [K in keyof typeof ANNOTATED_MOUSE_EVENTS]: IAnnotatedMouseEvent & WindowEventMap[K]; }; export declare type AnnotatedWindowEventMap = AnnotatedWindowKeyEventMap & AnnotatedWindowMouseEventMap; export declare type AnnotatedDocumentKeyEventMap = { [K in keyof typeof ANNOTATED_KEY_EVENTS]: IAnnotatedEvent & DocumentEventMap[K]; }; export declare type AnnotatedDocumentMouseEventMap = { [K in keyof typeof ANNOTATED_MOUSE_EVENTS]: IAnnotatedMouseEvent & DocumentEventMap[K]; }; export declare type AnnotatedDocumentEventMap = AnnotatedDocumentKeyEventMap & AnnotatedDocumentMouseEventMap; export declare type AllEventMap = AnnotatedHTMLElementEventMap & HTMLElementEventMap & WindowEventMap & DocumentEventMap & GridCustomEventMap; export declare type EventUnion = AllEventMap[keyof AllEventMap] | (ILoopEvent & { target?: undefined; }); export declare type WindowEventHandler = (ev: WindowEventMap[K]) => any; export declare type DocumentEventHandler = (ev: DocumentEventMap[K]) => any; export declare type HTMLElementEventHandler = (ev: HTMLElementEventMap[K]) => any; export declare type AnnotatedWindowEventHandler = (ev: AnnotatedWindowEventMap[K]) => any; export declare type AnnotatedDocumentEventHandler = (ev: AnnotatedDocumentEventMap[K]) => any; export declare type AnnotatedHTMLElementEventHandler = (ev: AnnotatedHTMLElementEventMap[K]) => any; export declare type GridCustomEventHandler = (ev: GridCustomEventMap[K]) => any; export declare type LoopEventHandler = (ev: ILoopEvent) => any; export declare type EventUnionHandler = (ev: EventUnion) => any; export interface ILoopEvent { type: string; gridStopBubbling?: boolean; } export interface IEventHandler extends LoopEventHandler { _eventLoopIdx?: number; _eventLoopUnbound?: boolean; } export declare type EventHandlerUnbinder = () => void; export declare type BindTarget = HTMLElement | Window | Document; export interface IBind { bind(elem: Window, name: K, handler: AnnotatedWindowEventHandler): EventHandlerUnbinder; bind(elem: Document, name: K, handler: AnnotatedDocumentEventHandler): EventHandlerUnbinder; bind(elem: HTMLElement, name: K, handler: AnnotatedHTMLElementEventHandler): EventHandlerUnbinder; bind(name: K, handler: AnnotatedHTMLElementEventHandler): EventHandlerUnbinder; bind(elem: BindTarget, name: K, handler: GridCustomEventHandler): EventHandlerUnbinder; bind(name: K, handler: GridCustomEventHandler): EventHandlerUnbinder; bind(elem: Window, name: K, handler: WindowEventHandler): EventHandlerUnbinder; bind(elem: Document, name: K, handler: DocumentEventHandler): EventHandlerUnbinder; bind(elem: HTMLElement, name: K, handler: HTMLElementEventHandler): EventHandlerUnbinder; bind(name: K, handler: HTMLElementEventHandler): EventHandlerUnbinder; bind(name: string, handler: IEventHandler): EventHandlerUnbinder; } export declare type BindOnce = { bindOnce: T[keyof T]; }; export interface IEventLoop extends IBind { isRunning: boolean; destroyed: boolean; logTargets?: boolean; setContainer(c: HTMLElement): void; fire(event: string | ILoopEvent): void; addInterceptor(h: EventUnionHandler): EventHandlerUnbinder; addExitListener(h: EventUnionHandler): EventHandlerUnbinder; stopBubbling(e: ILoopEvent): ILoopEvent; } export declare type EventLoop = IEventLoop & BindOnce; export declare function create(): EventLoop; export default create;