UNPKG

@etsoo/react

Version:

TypeScript ReactJs UI Independent Framework

36 lines (35 loc) 646 B
import React from "react"; /** * Event watcher action */ export interface EventWatcherAction { /** * Event type */ type?: string | string[]; /** * Once action or not */ once?: boolean; /** * Action */ action: (event: React.BaseSyntheticEvent | string) => any; } /** * Event watcher */ export declare class EventWatcher { private actions; /** * Add action * @param action Action */ add(action: EventWatcherAction): void; /** * Do the event * @param event Event */ do(event: React.BaseSyntheticEvent | string): void; private isMatch; }