Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "gesture-stream"

Index

Variables

Const baseEvents

baseEvents: ["mousemove", "mousedown", "touchstart", "wheel"] = <const>["mousemove", "mousedown", "touchstart", "wheel"]

Const endEvents

endEvents: Set<string> = new Set(["mouseup", "touchend", "touchcancel"])

Const startEvents

startEvents: Set<string> = new Set(["mousedown","touchmove","touchstart","mousemove",])

Functions

Const eventSource

Const gestureStream

  • Attaches mouse & touch event listeners to given DOM element and returns a stream of GestureEvents and their GestureInfo details.

    In multi-touch environments, a GestureEvent can contain multiple such GestureInfo objects (one per active touch). In general, the click and delta values are only present if the abstracted event type == GestureType.DRAG. Both (and pos too) are 2-element arrays of [x,y] coordinates.

    The zoom value is always present, but is only updated with wheel events. The value will be constrained to minZoom ... maxZoom interval (provided via options object).

    Note: If using preventDefault and attaching the event stream to document.body, the following event listener options SHOULD be used:

    example
    eventOpts: { passive: false }

    Parameters

    Returns GestureStream

Object literals

Const eventGestureTypeMap

eventGestureTypeMap: object

mousedown

mousedown: START = GestureType.START

mouseup

mouseup: END = GestureType.END

touchcancel

touchcancel: END = GestureType.END

touchend

touchend: END = GestureType.END

touchmove

touchmove: DRAG = GestureType.DRAG

touchstart

touchstart: START = GestureType.START

wheel

wheel: ZOOM = GestureType.ZOOM

Generated using TypeDoc