mirror of
https://github.com/eugene-serb/wavelovers.git
synced 2023-09-09 23:41:16 +03:00
- added return type to Vibrator.loop and IVibrator.loop.
- updated version.
This commit is contained in:
parent
a66df1331a
commit
fad050f550
@ -2,7 +2,7 @@
|
|||||||
"name": "wavelovers",
|
"name": "wavelovers",
|
||||||
"description": "Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.",
|
"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" ],
|
"keywords": [ "wavelovers", "gamepad-vibrator", "gamepad-test-tool", "gamepad-vibration-test-tool" ],
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"license": "GNU GPL v3",
|
"license": "GNU GPL v3",
|
||||||
"homepage": "https://wavelovers.ru/",
|
"homepage": "https://wavelovers.ru/",
|
||||||
"author": {
|
"author": {
|
||||||
|
@ -8,7 +8,7 @@ interface IVibrator {
|
|||||||
isVibrating: boolean;
|
isVibrating: boolean;
|
||||||
interval: number;
|
interval: number;
|
||||||
update(): void;
|
update(): void;
|
||||||
loop(pattern: TPatternUnit[]): void;
|
loop(pattern: TPatternUnit[]): Promise<void>;
|
||||||
vibrate(pattern: TPatternUnit): void;
|
vibrate(pattern: TPatternUnit): void;
|
||||||
reset(): void;
|
reset(): void;
|
||||||
sleep(ms: number): Promise<number>;
|
sleep(ms: number): Promise<number>;
|
||||||
|
@ -24,7 +24,7 @@ class Vibrator implements IVibrator {
|
|||||||
this.unit = gamepads[this.unit.index] as unknown as IGamepad;
|
this.unit = gamepads[this.unit.index] as unknown as IGamepad;
|
||||||
}
|
}
|
||||||
|
|
||||||
async loop(pattern: TPatternUnit[]) {
|
async loop(pattern: TPatternUnit[]): Promise<void> {
|
||||||
this.isVibrating = true;
|
this.isVibrating = true;
|
||||||
const offsetTime = 10;
|
const offsetTime = 10;
|
||||||
while (this.isVibrating === true) {
|
while (this.isVibrating === true) {
|
||||||
|
Loading…
Reference in New Issue
Block a user