import { CurriedFunction2 , curry2 } from '@most/prelude' ; import { DomSource , StandardEvents } from '../types' ; import { Stream } from 'most' ; export const events = curry2 < StandardEvents , DomSource , Stream < Event > > ( function ( eventType , domSource ) : Stream < Event > { return domSource . events ( eventType ) ; } ) ; export interface EventsFn { ( ) : EventsFn ; < T extends Event > ( eventType ) : ( domSource : DomSource ) => Stream < T > ; < T extends Event > ( eventType , domSource ) : Stream < T > ; < T extends Event > ( eventType ) : ( domSource : DomSource ) => Stream < T > ; < T extends Event > ( eventType , domSource ) : Stream < T > ; } export const abortEvent = events < UIEvent | ProgressEvent | Event > ( 'abort' ) ; export const afterPrintEvent = events < Event > ( 'afterprint' ) ; export const animationEndEvent = events < AnimationEvent > ( 'animationend' ) ; export const animationIterationEvent = events < AnimationEvent > ( 'animationiteration' ) ; export const animationStartEvent = events < AnimationEvent > ( 'animationstart' ) ; export const audioProcessEvent = events < AudioProcessingEvent > ( 'audioprocess' ) ; export const audioEndEvent = events < Event > ( 'audioend' ) ; export const audioStartEvent = events < Event > ( 'audiostart' ) ; export const beforePrintEvent = events < Event > ( 'beforeprint' ) ; export const beforeUnloadEvent = events < BeforeUnloadEvent > ( 'beforeunload' ) ; export const beginEvent = events < Event > ( 'beginEvent' ) ; export const blockedEvent = events < Event > ( 'blocked' ) ; export const blurEvent = events < FocusEvent > ( 'blur' ) ; export const boundaryEvent = events < SpeechSynthesisEvent > ( 'boundary' ) ; export const cachedEvent = events < Event > ( 'cached' ) ; export const canPlayEvent = events < Event > ( 'canPlay' ) ; export const canPlayThroughEvent = events < Event > ( 'canplaythrough' ) ; export const changeEvent = events < Event > ( 'change' ) ; export const chargingChangeEvent = events < Event > ( 'chargingchange' ) ; export const chargingTimeChangeEvent = events < Event > ( 'chargingtimechange' ) ; export const checkingEvent = events < Event > ( 'checking' ) ; export const clickEvent = events < MouseEvent > ( 'click' ) ; export const closeEvent = events < Event > ( 'close' ) ; export const completeEvent = events < OfflineAudioCompletionEvent | Event > ( 'complete' ) ; export const compositionEndEvent = events < CompositionEvent > ( 'compositionend' ) ; export const compositionStartEvent = events < CompositionEvent > ( 'compositionstart' ) ; export const compositionUpdateEvent = events < CompositionEvent > ( 'compositionupdate' ) ; export const contextMenuEvent = events < MouseEvent > ( 'contextmenu' ) ; export const copyEvent = events < ClipboardEvent > ( 'copy' ) ; export const cutEvent = events < ClipboardEvent > ( 'cut' ) ; export const dblclickEvent = events < MouseEvent > ( 'dblclick' ) ; export const deviceChangeEvent = events < Event > ( 'devicechange' ) ; export const deviceLightEvent = events < DeviceLightEvent > ( 'devicelight' ) ; export const deviceMotionEvent = events < DeviceMotionEvent > ( 'devicemotion' ) ; export const deviceOrientationEvent = events < DeviceOrientationEvent > ( 'deviceorientation' ) ; export const deviceProximityEvent = events < DeviceMotionEvent > ( 'deviceproximit' ) ; export const dischargingTimeChangeEvent = events < Event > ( 'dischargingtimechange' ) ; export const downloadedEvent = events < Event > ( 'downloaded' ) ; export const dragEvent = events < DragEvent > ( 'drag' ) ; export const dragEndEvent = events < DragEvent > ( 'dragend' ) ; export const dragEnterEvent = events < DragEvent > ( 'dragenter' ) ; export const dragLeaveEvent = events < DragEvent > ( 'dragleave' ) ; export const dragOverEvent = events < DragEvent > ( 'dragover' ) ; export const dragstartEvent = events < DragEvent > ( 'dragstart' ) ; export const dropEvent = events < DragEvent > ( 'drop' ) ; export const durationChangeEvent = events < Event > ( 'durationchange' ) ; export const emptiedEvent = events < Event > ( 'emptied' ) ; export const endEvent = events < Event | SpeechSynthesisEvent > ( 'end' ) ; export const endedEvent = events < Event > ( 'ended' ) ; export const focusEvent = events < FocusEvent > ( 'focus' ) ; export const fullScreenChangeEvent = events < Event > ( 'fullscreenchange' ) ; export const fullScreenErrorEvent = events < Event > ( 'fullscreenerror' ) ; export const gamepadConnectedEvent = events < GamepadEvent > ( 'gamepadconnected' ) ; export const gamepadDisconnectedEvent = events < GamepadEvent > ( 'gamepaddisconnected' ) ; export const gotPointerCaptureEvent = events < PointerEvent > ( 'gotpointerevent' ) ; export const hashChangeEvent = events < HashChangeEvent > ( 'hashchange' ) ; export const lostPointerCaptureEvent = events < PointerEvent > ( 'lostpointercapture' ) ; export const inputEvent = events < Event > ( 'input' ) ; export const invalidEvent = events < Event > ( 'invalid' ) ; export const keyDownEvent = events < KeyboardEvent > ( 'keydown' ) ; export const keyPressEvent = events < KeyboardEvent > ( 'keypress' ) ; export const keyUpEvent = events < KeyboardEvent > ( 'keyup' ) ; export const languageChangeEvent = events < Event > ( 'languagechange' ) ; export const levelChangeEvent = events < Event > ( 'levelchange' ) ; export const loadEvent = events < UIEvent | ProgressEvent > ( 'load' ) ; export const loadedDataEvent = events < Event > ( 'loadeddata' ) ; export const loadedMetadataEvent = events < Event > ( 'loadedmetadata' ) ; export const loadEndEvent = events < ProgressEvent > ( 'loadend' ) ; export const loadStartEvent = events < ProgressEvent > ( 'loadstart' ) ; export const markEvent = events < SpeechSynthesisEvent > ( 'mark' ) ; export const messageEvent = events < MessageEvent | ServiceWorkerMessageEvent > ( 'message' ) ; export const mouseDownEvent = events < MouseEvent > ( 'mousedown' ) ; export const mouseEnterEvent = events < MouseEvent > ( 'mouseenter' ) ; export const mouseLeaveEvent = events < MouseEvent > ( 'mouseleave' ) ; export const mouseMoveEvent = events < MouseEvent > ( 'mousemove' ) ; export const mouseOutEvent = events < MouseEvent > ( 'mouseout' ) ; export const mouseOverEvent = events < MouseEvent > ( 'mouseover' ) ; export const noMatchEvent = events < SpeechSynthesisEvent > ( 'nomatch' ) ; export const notificationClickEvent = events < Event > ( 'notificationclick' ) ; export const noUpdateEvent = events < Event > ( 'noupdate' ) ; export const obsoleteEvent = events < Event > ( 'obsolete' ) ; export const offlineEvent = events < Event > ( 'offline' ) ; export const onlineEvent = events < Event > ( 'online' ) ; export const openEvent = events < Event > ( 'open' ) ; export const orientationChangeEvent = events < Event > ( 'orientationchange' ) ; export const pageHideEvent = events < PageTransitionEvent > ( 'pageHide' ) ; export const pageShowEvent = events < PageTransitionEvent > ( 'pageshow' ) ; export const pasteEvent = events < ClipboardEvent > ( 'paste' ) ; export const pauseEvent = events < Event | SpeechSynthesisEvent > ( 'pause' ) ; export const pointerCancelEvent = events < PointerEvent > ( 'pointercancel' ) ; export const pointerDownEvent = events < PointerEvent > ( 'pointerdown' ) ; export const pointerLockChangeEvent = events < Event > ( 'pointerlockchange' ) ; export const pointerLockErrorEvent = events < Event > ( 'pointerlockerror' ) ; export const pointerMoveEvent = events < PointerEvent > ( 'pointermove' ) ; export const pointerOutEvent = events < PointerEvent > ( 'pointerout' ) ; export const pointerOverEvent = events < PointerEvent > ( 'pointerover' ) ; export const pointerUpEvent = events < PointerEvent > ( 'pointerup' ) ; export const playEvent = events < Event > ( 'play' ) ; export const playingEvent = events < Event > ( 'playing' ) ; export const popStateEvent = events < PopStateEvent > ( 'popstate' ) ; export const progressEvent = events < ProgressEvent > ( 'progress' ) ; export const pushEvent = events < Event > ( 'push' ) ; export const pushSubscriptionChangeEvent = events < Event > ( 'pushsubscriptionchange' ) ; export const rateChangeEvent = events < Event > ( 'ratechange' ) ; export const readyStateChangeEvent = events < Event > ( 'readystatechange' ) ; export const repeatEventEvent = events < Event > ( 'repeatevent' ) ; export const resetEvent = events < Event > ( 'reset' ) ; export const resizeEvent = events < UIEvent > ( 'resize' ) ; export const resourceTimingBufferFullEvent = events < Event > ( 'resourcetimingbufferfull' ) ; export const resultEvent = events < Event > ( 'result' ) ; export const resumeEvent = events < SpeechSynthesisEvent > ( 'resume' ) ; export const scrollEvent = events < UIEvent > ( 'scroll' ) ; export const seekedEvent = events < Event > ( 'seeked' ) ; export const seekingEvent = events < Event > ( 'seeking' ) ; export const selectEvent = events < UIEvent > ( 'select' ) ; export const selectStartEvent = events < UIEvent > ( 'selectstart' ) ; export const selectionChangeEvent = events < Event > ( 'selectionchange' ) ; export const showEvent = events < MouseEvent > ( 'show' ) ; export const soundEndEvent = events < Event > ( 'soundend' ) ; export const soundStartEvent = events < Event > ( 'soundstart' ) ; export const speechEndEvent = events < Event > ( 'speechend' ) ; export const speedStartEvent = events < Event > ( 'speedstart' ) ; export const stalledEvent = events < Event > ( 'stalled' ) ; export const startEvent = events < SpeechSynthesisEvent > ( 'start' ) ; export const storageEvent = events < StorageEvent > ( 'storage' ) ; export const submitEvent = events < Event > ( 'submit' ) ; export const successEvent = events < Event > ( 'success' ) ; export const suspendEvent = events < Event > ( 'suspend' ) ; export const timeoutEvent = events < ProgressEvent > ( 'timeout' ) ; export const timeUpdateEvent = events < Event > ( 'timeupdate' ) ; export const touchCancelEvent = events < TouchEvent > ( 'touchcancel' ) ; export const touchEndEvent = events < TouchEvent > ( 'touchend' ) ; export const touchEnterEvent = events < TouchEvent > ( 'touchenter' ) ; export const touchLeaveEvent = events < TouchEvent > ( 'touchleave' ) ; export const touchMoveEvent = events < TouchEvent > ( 'touchmove' ) ; export const touchStartEvent = events < TouchEvent > ( 'touchStart' ) ; export const transitionEndEvent = events < TransitionEvent > ( 'transitionend' ) ; export const unloadEvent = events < UIEvent > ( 'unload' ) ; export const updateReadyEvent = events < Event > ( 'updateready' ) ; export const upgradeNeededEvent = events < Event > ( 'upgradeneeded' ) ; export const userProximityEvent = events < Event > ( 'useproximity' ) ; export const voicesChangedEvent = events < Event > ( 'voiceschanged' ) ; export const versionChangeEvent = events < Event > ( 'versionchange' ) ; export const visibilityChangeEvent = events < Event > ( 'visibilitychange' ) ; export const volumeChangeEvent = events < Event > ( 'volumechange' ) ; export const vrDisplayConnectedEvent = events < Event > ( 'vrdisplayconnected' ) ; export const vrDisplayDisconnectedEvent = events < Event > ( 'vrdisplaydisconnected' ) ; export const waitingEvent = events < Event > ( 'waiting' ) ; export const wheelEvent = events < WheelEvent > ( 'wheel' ) ;