CardSounds型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A table's sounds: play one, mute and unmute, change the volume, close when the table goes.
インポート
import type { CardSounds } from "@johnmorrisdotca/hitotsu/card-sounds";
定義
type CardSounds = {
play(kind: CardSoundKind, options?: PlayCardSoundOptions): void;
load(): Promise<boolean>;
readonly muted: boolean;
setMuted(muted: boolean): void;
volume: number;
close(): void;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
play | (kind: CardSoundKind, options?: PlayCardSoundOptions): void | Play a sound, or several of one kind in a row; nothing while muted or closed. |
load | (): Promise<boolean> | Fetch and decode the recordings now, rather than at the first sound. True once they are ready; false where they cannot be had. |
muted | boolean | Whether it is muted. |
setMuted | (muted: boolean): void | Mute or unmute. Muting stops nothing already playing; it only keeps anything new from starting. |
volume | number | How loud, from 0 to 1. |
close | (): void | Stop for good, and let the audio context go. |
例
import type { CardSounds } from "@johnmorrisdotca/hitotsu/card-sounds";
import { createCardSounds } from "@johnmorrisdotca/hitotsu/card-sounds";
const value: CardSounds = createCardSounds({ muted: true, window: null });
console.log(value.muted);true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。