TsunagiPiece型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
ONE GROUP OF A DRAWING: what tsunagiDrawing hands a page instead of one long string, so that a page keeping its
drawing in a framework's own tree writes only the groups whose text changed. A piece is a <g> with these
attributes, holding either its SVG text or more pieces (a pair's washes, its line and its little marbles are a piece
each, so a finger moving through a cell changes one or two pairs and not the thousands of elements of a 30×30 board).
インポート
import type { TsunagiPiece } from "@johnmorrisdotca/tsunagi/draw";
定義
type TsunagiPiece = {
key: string;
attributes: Readonly<Record<string, string>>;
html?: string;
pieces?: readonly TsunagiPiece[];
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
key | string | Stable from one drawing of a board to the next. |
attributes | Readonly<Record<string, string>> | |
html (省略可) | string | undefined | Its SVG text, unless it holds |
pieces (省略可) | readonly TsunagiPiece[] | undefined |
例
import type { TsunagiPiece } from "@johnmorrisdotca/tsunagi/draw";
const value: TsunagiPiece = {key:"ground",attributes:{class:"tsu-ground"},html:""};
console.log(value);{ key: 'ground', attributes: { class: 'tsu-ground' }, html: '' }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。