westures-core

Namespace

westures-core

Description:
  • The global API interface for westures-core. Exposes all classes, constants, and routines used by the package. Use responsibly.
Source:

Classes

Gesture
Input
Point2D
PointerData
Region
Smoothable
State

Members

(static, constant) CANCEL :string

Description:
  • The cancel phase.
Source:
The cancel phase.
Type:
  • string

(static, constant) CANCEL_EVENTS :Array.<string>

Description:
  • List of events that trigger the cancel phase.
Source:
List of events that trigger the cancel phase.
Type:
  • Array.<string>

(static, constant) END :string

Description:
  • The end phase.
Source:
The end phase.
Type:
  • string

(static, constant) KEYBOARD_EVENTS :Array.<string>

Description:
  • List of keyboard events that trigger a restart.
Source:
List of keyboard events that trigger a restart.
Type:
  • Array.<string>

(static, constant) MOUSE_EVENTS :Array.<string>

Description:
  • List of mouse events to listen to.
Source:
List of mouse events to listen to.
Type:
  • Array.<string>

(static, constant) MOVE :string

Description:
  • The move phase.
Source:
The move phase.
Type:
  • string

(static, constant) PHASE :object

Description:
  • Object that normalizes the names of window events to be either of type start, move, end, or cancel.
Source:
Object that normalizes the names of window events to be either of type start, move, end, or cancel.
Type:
  • object

(static, constant) PHASES :list.<string>

Description:
  • The recognized phases.
Source:
The recognized phases.
Type:
  • list.<string>

(static, constant) POINTER_EVENTS :Array.<string>

Description:
  • List of pointer events to listen to.
Source:
List of pointer events to listen to.
Type:
  • Array.<string>

(static, constant) START :string

Description:
  • The start phase.
Source:
The start phase.
Type:
  • string

(static, constant) STATE_KEYS :Array.<string>

Description:
  • List of potentially state-modifying keys. Entries are: ['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].
Source:
List of potentially state-modifying keys. Entries are: ['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].
Type:
  • Array.<string>

(static, constant) STATE_KEY_STRINGS :Array.<string>

Description:
  • List of the 'key' values on KeyboardEvent objects of the potentially state-modifying keys.
Source:
List of the 'key' values on KeyboardEvent objects of the potentially state-modifying keys.
Type:
  • Array.<string>

(static, constant) TOUCH_EVENTS :Array.<string>

Description:
  • List of touch events to listen to.
Source:
List of touch events to listen to.
Type:
  • Array.<string>

Methods

(static) angularDifference(a, b) → {number}

Description:
  • Helper function to regulate angular differences, so they don't jump from 0 to 2 * PI or vice versa.
Source:
Parameters:
Name Type Description
a number Angle in radians.
b number Angle in radians.
Returns:
c, given by: c = a - b such that |c| < PI
Type
number

(static) getPropagationPath(event) → {Array.<Element>}

Description:
  • In case event.composedPath() is not available.
Source:
Parameters:
Name Type Description
event Event
Returns:
The elements along the composed path of the event.
Type
Array.<Element>

(static) setDifference(left, right) → {Set}

Description:
  • Performs a set difference operation.
Source:
Parameters:
Name Type Description
left Set Base set.
right Set Set of elements to remove from 'left'.
Returns:
Set consisting of elements in 'left' that are not in 'right'.
Type
Set

(static) setFilter(set, predicate) → {Set}

Description:
  • Performs a set filter operation.
Source:
Parameters:
Name Type Description
set Set The set to filter.
predicate function Function to test elements of 'set'. Receives one argument: the current set element.
Returns:
Set consisting of elements in 'set' for which 'predicate' is true.
Type
Set