UNPKG

2.15 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var plugin_1 = require('./plugin');
9/**
10 * @name Vibration
11 * @description Vibrates the device
12 * @usage
13 * ```typescript
14 * import { Vibration } from 'ionic-native';
15 *
16 *
17 * // Vibrate the device for a second
18 * // Duration is ignored on iOS.
19 * Vibration.vibrate(1000);
20 *
21 * // Vibrate 2 seconds
22 * // Pause for 1 second
23 * // Vibrate for 2 seconds
24 * // Patterns work on Android and Windows only
25 * Vibration.vibrate([2000,1000,2000]);
26 *
27 * // Stop any current vibrations immediately
28 * // Works on Android and Windows only
29 * Vibration.vibrate(0);
30 * ```
31 */
32var Vibration = (function () {
33 function Vibration() {
34 }
35 /**
36 * Vibrates the device for given amount of time.
37 * @param time {number|Array<number>} Milliseconds to vibrate the device. If passed an array of numbers, it will define a vibration pattern. Pass 0 to stop any vibration immediately.
38 */
39 Vibration.vibrate = function (time) { };
40 __decorate([
41 plugin_1.Cordova({
42 sync: true
43 })
44 ], Vibration, "vibrate", null);
45 Vibration = __decorate([
46 plugin_1.Plugin({
47 pluginName: 'Vibration',
48 plugin: 'cordova-plugin-vibration',
49 pluginRef: 'navigator',
50 repo: 'https://github.com/apache/cordova-plugin-vibration',
51 platforms: ['Android', 'iOS', 'Windows 8.1 Phone', 'Windows 8.1', 'Windows 10']
52 })
53 ], Vibration);
54 return Vibration;
55}());
56exports.Vibration = Vibration;
57//# sourceMappingURL=vibration.js.map
\No newline at end of file