CalendarLayout型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Where a theme puts the day and the year; a theme's layout says it once and the drawing and the tests both read it.
インポート
import type { CalendarLayout } from "@johnmorrisdotca/koyomi-calendars";
定義
interface CalendarLayout {
page: Rect;
yearZone: Rect | null;
split?: {
saturday: readonly [
number,
number
];
sunday: readonly [
number,
number
];
height: number;
line: readonly [
number,
number,
number,
number
];
};
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
page | Rect | The page the day is centred in, across and (as one block with the month word and the year, when the page shares them) down. |
yearZone | Rect | null | The room the year chip sits in: it keeps the minimum size and the margin from the bottom of this. |
split (省略可) | { saturday: readonly [number, number]; sunday: readonly [number, number]; height: number; line: readonly [number, number, number, number]; } | undefined | Only on a weekend page: where the two numerals sit (their centres), how tall they are, and the diagonal that cuts the page (from top right to bottom left). |
例
import { calendarLayout, type CalendarLayout } from "@johnmorrisdotca/koyomi-calendars";
const layout: CalendarLayout = calendarLayout("pins", false);
console.log(layout.page.join(" "));35 105 243 180出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。