import Async from "typescene-async"; import { CustomDragEvent } from "../Drag"; /** Interface definition for EventHandler and other handler wrappers */ export interface ActionHandler { /** Call the handler as a function */ (data?: DataT): void; /** Add this EventHandler as a handler for given event signal */ connectTo(signal: SignalT): Async.SignalConnection; /** Always true, to identify EventHandler instances */ _isEventHandler: boolean; } /** [implementation] type definition of constructor for ActionHandler and others */ export interface EventHandlerCtor { /** Wrap given function for handling UI events (with value or DOM event) */ new (handler: (data: EventDataT) => void): HandlerT; } /** Base signal type for all DOM events */ export interface DOMEventSignal extends Async.CustomSignalClass> { } /** [implementation] */ export interface EventHandler extends ActionHandler { } /** Signal that is emitted when a keyboard DOM event occurs */ export interface KeyEventSignal extends Async.CustomSignalClass> { } /** [implementation] */ export interface KeyHandler extends ActionHandler { } /** Signal that is emitted when a mouse DOM event occurs */ export interface MouseEventSignal extends Async.CustomSignalClass> { } /** [implementation] */ export interface MouseHandler extends ActionHandler { } /** Signal that is emitted when a custom drag event occurs */ export interface DragEventSignal extends Async.CustomSignalClass> { } /** [implementation] */ export interface DragHandler extends ActionHandler { } /** Signal that is emitted when a focus/blur DOM event occurs */ export interface FocusEventSignal extends Async.CustomSignalClass> { } /** [implementation] */ export interface FocusHandler extends ActionHandler { } /** Constructor for an event handler (any argument) */ export declare var ActionHandler: EventHandlerCtor>; /** Constructor for a DOM event handler (plain Event argument) */ export declare var EventHandler: EventHandlerCtor; /** Constructor for a keyboard event handler */ export declare var KeyHandler: EventHandlerCtor; /** Constructor for a mouse event handler */ export declare var MouseHandler: EventHandlerCtor; /** Constructor for a drag event handler */ export declare var DragHandler: EventHandlerCtor; /** Constructor for a focus/blur event handler */ export declare var FocusHandler: EventHandlerCtor;