nativescript-vibrate
Advanced tools
Comparing version 3.1.0 to 4.0.0
# Change Log | ||
# [v4.0.0](https://github.com/juliomrqz/nativescript-vibrate/compare/v3.1.0...v4.0.0) (2020-09-02) | ||
- Support NativeScript 7 ([#126](https://github.com/juliomrqz/nativescript-vibrate/pull/126)), (thanks to [EddyVerbruggen](https://github.com/EddyVerbruggen)) | ||
### BREAKING CHANGES | ||
* **minimum required NativeScript version is 7** | ||
# [v3.1.0](https://github.com/juliomrqz/nativescript-vibrate/compare/v3.0.0...v3.1.0) (2020-07-19) | ||
@@ -4,0 +14,0 @@ |
{ | ||
"name": "nativescript-vibrate", | ||
"version": "3.1.0", | ||
"version": "4.0.0", | ||
"description": "A vibrate NativeScript plugin for Android and iOS", | ||
@@ -47,9 +47,9 @@ "main": "vibrate", | ||
"devDependencies": { | ||
"tns-core-modules": "~6.3.2", | ||
"tns-platform-declarations": "~6.3.2", | ||
"typescript": "~3.7.5", | ||
"@nativescript/core": "^7.0.0", | ||
"@nativescript/types": "^7.0.1", | ||
"prompt": "^1.0.0", | ||
"rimraf": "^3.0.0", | ||
"tslint": "^5.20.1", | ||
"semver": "^7.1.1" | ||
"rimraf": "3.0.2", | ||
"semver": "^7.3.2", | ||
"tslint": "6.1.3", | ||
"typescript": "~3.9.0" | ||
}, | ||
@@ -56,0 +56,0 @@ "dependencies": {}, |
@@ -1,2 +0,2 @@ | ||
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" /> | ||
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" /> | ||
/// <reference path="./node_modules/@nativescript/types/ios.d.ts" /> | ||
/// <reference path="./node_modules/@nativescript/types/android.d.ts" /> |
@@ -1,16 +0,8 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var vibrate_common_1 = require("./vibrate.common"); | ||
var app = require("tns-core-modules/application"); | ||
var Vibrate = (function (_super) { | ||
__extends(Vibrate, _super); | ||
function Vibrate() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
import { Common } from './vibrate.common'; | ||
import { Application } from '@nativescript/core'; | ||
export class Vibrate extends Common { | ||
hasVibrator() { | ||
return this.getVibratorService().hasVibrator(); | ||
} | ||
Vibrate.prototype.hasVibrator = function () { | ||
return this.getVibratorService().hasVibrator(); | ||
}; | ||
Vibrate.prototype.vibrate = function (param, repeat) { | ||
if (param === void 0) { param = 300; } | ||
if (repeat === void 0) { repeat = -1; } | ||
vibrate(param = 300, repeat = -1) { | ||
if (this.hasVibrator()) { | ||
@@ -21,21 +13,19 @@ if (typeof param === "number") { | ||
else { | ||
var patternLength = param.length; | ||
var pattern_1 = Array.create('long', patternLength); | ||
param.forEach(function (value, index) { pattern_1[index] = value; }); | ||
this.getVibratorService().vibrate(pattern_1, repeat); | ||
const patternLength = param.length; | ||
let pattern = Array.create('long', patternLength); | ||
param.forEach((value, index) => { pattern[index] = value; }); | ||
this.getVibratorService().vibrate(pattern, repeat); | ||
} | ||
} | ||
}; | ||
Vibrate.prototype.cancel = function () { | ||
} | ||
cancel() { | ||
this.getVibratorService().cancel(); | ||
}; | ||
Vibrate.prototype.getVibratorService = function () { | ||
} | ||
getVibratorService() { | ||
if (!this.vibratorService) { | ||
this.vibratorService = app.android.context.getSystemService(android.content.Context.VIBRATOR_SERVICE); | ||
this.vibratorService = Application.android.context.getSystemService(android.content.Context.VIBRATOR_SERVICE); | ||
} | ||
return this.vibratorService; | ||
}; | ||
return Vibrate; | ||
}(vibrate_common_1.Common)); | ||
exports.Vibrate = Vibrate; | ||
} | ||
} | ||
//# sourceMappingURL=vibrate.android.js.map |
@@ -1,2 +0,2 @@ | ||
import { Observable } from 'tns-core-modules/data/observable'; | ||
import { Observable } from '@nativescript/core'; | ||
export declare class Common extends Observable { | ||
@@ -3,0 +3,0 @@ service: any; |
@@ -1,17 +0,12 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var observable_1 = require("tns-core-modules/data/observable"); | ||
var Common = (function (_super) { | ||
__extends(Common, _super); | ||
function Common() { | ||
return _super.call(this) || this; | ||
import { Observable } from '@nativescript/core'; | ||
export class Common extends Observable { | ||
constructor() { | ||
super(); | ||
} | ||
Common.prototype.vibrate = function (time, repeat) { }; | ||
Common.prototype.cancel = function () { }; | ||
Common.prototype.hasVibrator = function () { | ||
vibrate(time, repeat) { } | ||
cancel() { } | ||
hasVibrator() { | ||
return true; | ||
}; | ||
return Common; | ||
}(observable_1.Observable)); | ||
exports.Common = Common; | ||
} | ||
} | ||
//# sourceMappingURL=vibrate.common.js.map |
@@ -1,21 +0,13 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var vibrate_common_1 = require("./vibrate.common"); | ||
var Vibrate = (function (_super) { | ||
__extends(Vibrate, _super); | ||
function Vibrate() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
import { Common } from './vibrate.common'; | ||
export class Vibrate extends Common { | ||
hasVibrator() { | ||
return true; | ||
} | ||
Vibrate.prototype.hasVibrator = function () { | ||
return true; | ||
}; | ||
Vibrate.prototype.vibrate = function (time, repeat) { | ||
vibrate(time, repeat) { | ||
AudioServicesPlaySystemSoundWithCompletion(1352, null); | ||
}; | ||
Vibrate.prototype.cancel = function () { | ||
} | ||
cancel() { | ||
return; | ||
}; | ||
return Vibrate; | ||
}(vibrate_common_1.Common)); | ||
exports.Vibrate = Vibrate; | ||
} | ||
} | ||
//# sourceMappingURL=vibrate.ios.js.map |
17834
82