material-motion-js icon indicating copy to clipboard operation
material-motion-js copied to clipboard

Explore inferring getEventStreamFromElement's generic with overrides

Open appsforartists opened this issue 7 years ago • 1 comments

It probably looks something like this:

export function getEventStreamFromElement<U extends Event = Event>(type: string, element: Element, eventListenerOptions?: AddEventListenerOptions): ObservableWithMotionOperators<U>;
export function getEventStreamFromElement<K extends keyof GlobalEventHandlersEventMap>(type: K, element: Element, eventListenerOptions?: AddEventListenerOptions): ObservableWithMotionOperators<GlobalEventHandlersEventMap[K]>;

appsforartists avatar Jul 19 '18 01:07 appsforartists

It's alive!

davidkpiano avatar Jul 19 '18 13:07 davidkpiano