Home Reference Source Test
public class | source

RawSensorWatcher

You can directly use an instance of this class. rawSensorWatcher

Sensors should be continuous events. Therefor each should be setup in similar way using an event listener. Objects of events, arguments and implementations may differ.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

sensorHandles: {"watchPosition": *, "getUserMedia": *, "deviceOrientation": *, "deviceLight": *, "deviceProximity": *, "deviceMotion": *, "test": *}

All sensor handles must return promise and take no arguments.

Method Summary

Public Methods
public

SensorListener(): {"start": *, "stop": *, "check": *}

Common object for handling sensors start: Starts watching sensor stop: Stops watching sensor check: Checks for support

Private Methods
private

Gets test SensorListener that can be used without access to sensors.

private

Public Constructors

public constructor() source

Public Members

public sensorHandles: {"watchPosition": *, "getUserMedia": *, "deviceOrientation": *, "deviceLight": *, "deviceProximity": *, "deviceMotion": *, "test": *} source

All sensor handles must return promise and take no arguments. start: required. args: (optional options object) should resolve an array with arguments to be passed to stop. stop: required. args: (returnedData from start) check: optional.

Public Methods

public SensorListener(): {"start": *, "stop": *, "check": *} source

Common object for handling sensors start: Starts watching sensor stop: Stops watching sensor check: Checks for support

Return:

{"start": *, "stop": *, "check": *}

Private Methods

private _getTestEventListenerObject(): SensorListener source

Gets test SensorListener that can be used without access to sensors. Used for testing on displaying when sensors not available.

Return:

SensorListener

private _getWindowEventListenerObject(eventName: String): SensorListener source

Params:

NameTypeAttributeDescription
eventName String

Return:

SensorListener