- added return type to Vibrator.loop and IVibrator.loop.

- updated version.
This commit is contained in:
Eugene Serb 2022-08-28 13:05:42 +03:00
parent a66df1331a
commit fad050f550
3 changed files with 3 additions and 3 deletions

View File

@ -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": {

View File

@ -8,7 +8,7 @@ interface IVibrator {
isVibrating: boolean;
interval: number;
update(): void;
loop(pattern: TPatternUnit[]): void;
loop(pattern: TPatternUnit[]): Promise<void>;
vibrate(pattern: TPatternUnit): void;
reset(): void;
sleep(ms: number): Promise<number>;

View File

@ -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<void> {
this.isVibrating = true;
const offsetTime = 10;
while (this.isVibrating === true) {