TsunagiMountOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The puzzle, native display choices, controls and event callbacks for mounting a board.
インポート
import type { TsunagiMountOptions } from "@johnmorrisdotca/tsunagi/play";
定義
type TsunagiMountOptions = TsunagiLook & {
size: number;
givens: string;
answer?: string;
level?: number;
set?: TsunagiSet;
lines?: Lines;
explosions?: TsunagiExplosionChoice;
cheats?: boolean;
controls?: boolean;
chips?: boolean;
zoom?: "auto" | "on" | "off";
language?: TsunagiLanguage;
onChange?: (detail: TsunagiEventDetail) => void;
onStroke?: (detail: TsunagiEventDetail) => void;
onExplosion?: (detail: TsunagiEventDetail) => void;
onSolve?: (detail: TsunagiEventDetail) => void;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
marks (省略可) | TsunagiMarks | undefined | |
fill (省略可) | TsunagiFill | undefined | |
colours (省略可) | "marble" | "bright" | "colour-blind" | "soft" | readonly TsunagiColour[] | undefined | |
board (省略可) | "paper" | "wood" | "green" | "blue" | "red" | "black" | TsunagiBoardLook | undefined | |
coordinates (省略可) | boolean | undefined | |
size | number | The board's size: how many cells across. |
givens | string | The level's layout code. |
answer (省略可) | string | undefined | The level's one answer, as a code. With it a solve must be that answer, and Cheat can be offered. |
level (省略可) | number | undefined | Which level of its size this is, to show its difficulty and its place in its block. |
set (省略可) | TsunagiSet | undefined | Which set of levels |
lines (省略可) | Lines | undefined | Lines to start from, to carry on a game kept half played. |
explosions (省略可) | TsunagiExplosionChoice | undefined | Explosions as made (the default), softened or off. |
cheats (省略可) | boolean | undefined | Offer Cheat, which draws one unfinished line. Needs |
controls (省略可) | boolean | undefined | The buttons and the lines of words under the board. Default true. |
chips (省略可) | boolean | undefined | A row of chips under the board: the level's difficulty and each challenge on it, each with the line that explains it when pressed. Default false. |
zoom (省略可) | "on" | "off" | "auto" | undefined |
|
language (省略可) | TsunagiLanguage | undefined | The language the words are in. Left out, the host's own |
onChange (省略可) | ((detail: TsunagiEventDetail) => void) | undefined | |
onStroke (省略可) | ((detail: TsunagiEventDetail) => void) | undefined | |
onExplosion (省略可) | ((detail: TsunagiEventDetail) => void) | undefined | |
onSolve (省略可) | ((detail: TsunagiEventDetail) => void) | undefined |
例
import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import type { TsunagiMountOptions } from "@johnmorrisdotca/tsunagi/play";
const givens = TSUNAGI_4[0][0];
const answer = TSUNAGI_4[0][1];
const value: TsunagiMountOptions = {size:4,givens,answer,controls:true};
console.log(value);{
size: 4,
givens: 'A..AB..BC..CD..D',
answer: 'AAAABBBBCCCCDDDD',
controls: true
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。