UNPKG

@enact/core

Version:

Enact is an open source JavaScript framework containing everything you need to create a fast, scalable mobile or web application.

22 lines (19 loc) 642 B
// Type definitions for core/dispatcher type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N; /** * Adds a new global event listener. Duplicate event handlers will be discarded. */ export function on(name: string, fn: Function, target: React.ReactNode): void; /** * Removes a global event listener. */ export function off(name: string, fn: Function, target: React.ReactNode): void; /** * Adds a new global event listener that removes itself after handling one event. */ export function once( name: string, fn: Function, target?: React.ReactNode, ): Function;