Construct a new device shake handler.
Optional
options: Partial<ShakeOptions>The options for the handler.
Add a new shake event listener.
The type of the event to handle.
The event handler to call.
Optional
options: boolean | AddEventListenerOptionsThe options for this handler.
Requests approval to handle device motion events.
true if we got approval, false otherwise.
Dispatch a shake event.
The event to dispatch.
true if the event was cancelled, false otherwise.
Removes a previously added event listener.
The type of the event to remove.
The event handler to remove.
Optional
options: boolean | EventListenerOptionsThe options the event handler was added with.
Start handling device shake.
true if we were able to register our handler, false otherwise.
Stop handling device shake.
A device motion handler that dispatches a
"shake"
event as appropriate.Original author: Jesse Jackson - https://github.com/jsejcksn This part of the code is licensed under CC BY-SA 4.0