From fad050f550bc13e6e4009f12feaf1b557cb7cb4a Mon Sep 17 00:00:00 2001 From: Eugene Serb <46799701+eugene-serb@users.noreply.github.com> Date: Sun, 28 Aug 2022 13:05:42 +0300 Subject: [PATCH] - added return type to Vibrator.loop and IVibrator.loop. - updated version. --- package.json | 2 +- src/models/IVibrator.ts | 2 +- src/models/Vibrator.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c078b7a..fb6d376 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "wavelovers", "description": "Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.", "keywords": [ "wavelovers", "gamepad-vibrator", "gamepad-test-tool", "gamepad-vibration-test-tool" ], - "version": "1.0.2", + "version": "1.0.3", "license": "GNU GPL v3", "homepage": "https://wavelovers.ru/", "author": { diff --git a/src/models/IVibrator.ts b/src/models/IVibrator.ts index 20cd871..cdff81c 100644 --- a/src/models/IVibrator.ts +++ b/src/models/IVibrator.ts @@ -8,7 +8,7 @@ interface IVibrator { isVibrating: boolean; interval: number; update(): void; - loop(pattern: TPatternUnit[]): void; + loop(pattern: TPatternUnit[]): Promise; vibrate(pattern: TPatternUnit): void; reset(): void; sleep(ms: number): Promise; diff --git a/src/models/Vibrator.ts b/src/models/Vibrator.ts index 0e5b59c..bbfd16e 100644 --- a/src/models/Vibrator.ts +++ b/src/models/Vibrator.ts @@ -24,7 +24,7 @@ class Vibrator implements IVibrator { this.unit = gamepads[this.unit.index] as unknown as IGamepad; } - async loop(pattern: TPatternUnit[]) { + async loop(pattern: TPatternUnit[]): Promise { this.isVibrating = true; const offsetTime = 10; while (this.isVibrating === true) {