本文へ移動

Hitotsu一つ

色か数字をそろえて出し、手札が1枚になったら声をかけます。クラシックやパーティーのルールで、コンピューターや共有のテーブルで遊べます。

「ヒトツ」は「一つ」。手札が1枚になったときに言う言葉です。 名前について(英語)

目次

リファレンス · カードの音

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.

mutedboolean

Whether it is muted.

setMuted(muted: boolean): void

Mute or unmute. Muting stops nothing already playing; it only keeps anything new from starting.

volumenumber

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/hitotsu 1.4.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。