CalendarLayouttype
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 it
import type { CalendarLayout } from "@johnmorrisdotca/koyomi-calendars";
Definition
interface CalendarLayout {
page: Rect;
yearZone: Rect | null;
split?: {
saturday: readonly [
number,
number
];
sunday: readonly [
number,
number
];
height: number;
line: readonly [
number,
number,
number,
number
];
};
}
Members
| Name | Type | Description |
|---|---|---|
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 (optional) | { 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). |
Examples
import { calendarLayout, type CalendarLayout } from "@johnmorrisdotca/koyomi-calendars";
const layout: CalendarLayout = calendarLayout("pins", false);
console.log(layout.page.join(" "));35 105 243 180What it prints (run when this page was built)