UNPKG

html-to-react-events

Version:

Convert HTML event names to React event handler names.

26 lines (25 loc) 1.21 kB
import { ClipboardEvent } from './clipboard'; import { CompositionEvent } from './composition'; import { KeyboardEvent } from './keyboard'; import { FocusEvent } from './focus'; import { FormEvent } from './form'; import { MouseEvent } from './mouse'; import { SelectionEvent } from './selection'; import { AnimationEvent } from './animation'; import { MediaEvent } from './media'; import { ImageEvent } from './image'; import { TransitionEvent } from './transition'; import { UIEvent } from './ui'; import { TouchEvent } from './touch'; import { WheelEvent } from './wheel'; import { OtherEvent } from './other'; declare type EventType = ClipboardEvent | CompositionEvent | KeyboardEvent | FocusEvent | FormEvent | MouseEvent | SelectionEvent | AnimationEvent | MediaEvent | ImageEvent | TransitionEvent | UIEvent | TouchEvent | WheelEvent | OtherEvent; export interface Events { [propName: string]: (...args: any[]) => any; } export declare const convertEvent: (eventName: EventType) => string; export declare const bindEvent: (eventName: EventType, callback: (...args: any[]) => any) => { [x: string]: (...args: any[]) => any; }; export declare const bindEvents: (events: Events) => Events; export {};