KeepScramblingOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
How it is run.
インポート
import type { KeepScramblingOptions } from "@johnmorrisdotca/kyuubu";
定義
type KeepScramblingOptions = {
pace?: number | ScramblePace;
faces?: boolean;
random?: () => number;
autoplay?: boolean;
page?: ScramblePage;
reducedMotion?: boolean;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
pace (省略可) | number | "fast" | "normal" | "slow" | undefined | Seconds between turns, or a pace's name: one when left out, never under 0.2. |
faces (省略可) | boolean | undefined | Turn only the six outer faces, never an inner layer. |
random (省略可) | (() => number) | undefined | A number in [0, 1), like |
autoplay (省略可) | boolean | undefined | Start by itself: true when left out. |
page (省略可) | ScramblePage | undefined | The page, to ask whether it is hidden and to hear it change: the browser's own when left out. |
reducedMotion (省略可) | boolean | undefined | Whether the device asks for reduced motion, which keeps the cube still: read from the browser when left out. |
例
import type { KeepScramblingOptions } from "@johnmorrisdotca/kyuubu";
const value: KeepScramblingOptions = { pace: "slow", autoplay: false, reducedMotion: true };
console.log(value.pace);slow出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。