From 191233143fda8695220d91c25759b470650d27c9 Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Mon, 13 Mar 2023 20:04:14 +0900 Subject: refactor(frontend): 引数の型を強くし、関数内部のas anyを除去 (#10315) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/scripts/sound.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/scripts/sound.ts b/packages/frontend/src/scripts/sound.ts index b08982facb..35fd007e64 100644 --- a/packages/frontend/src/scripts/sound.ts +++ b/packages/frontend/src/scripts/sound.ts @@ -72,8 +72,8 @@ export function setVolume(audio: HTMLAudioElement, volume: number): HTMLAudioEle return audio; } -export function play(type: string) { - const sound = ColdDeviceStorage.get('sound_' + type as any); +export function play(type: 'noteMy' | 'note' | 'antenna' | 'channel' | 'notification') { + const sound = ColdDeviceStorage.get(`sound_${type}`); if (sound.type == null) return; playFile(sound.type, sound.volume); } -- cgit v1.2.3-freya