/** Where a board goes. `top` and `bottom` are centred on the drawing's top and bottom edge, `side` is at the right edge, centred, `left` the same at the left, `corner` is the top right corner, and the four corners by their names. */ export type BoardPosition = "top" | "bottom" | "side" | "left" | "corner" | "top-left" | "top-right" | "bottom-left" | "bottom-right"; /** A place of your own: the board's top left corner (or, with `anchor: "center"`, its middle) at this share of the drawing's width (`x`) and height (`y`), 0 to 1. The board may then cover the middle of the surface: you asked for it. */ export interface BoardPoint { x: number; y: number; anchor?: "start" | "center"; } /** A board over a drawing. */ export interface BoardOptions { /** The board, as SVG text (`…`): the string `resultsBoard`, `boutBoard` or `broadcastMedalTable` of Taisen Brackets gives. It is written as an image, so nothing in it can run and its styles stay in it. Anything else is ignored. */ svg: string; /** The board's own width and height, the numbers its maker gives (`resultsBoardSize`, `boutBoardSize`, `broadcastMedalSize`): they give its shape. Left out, the `viewBox` of the SVG is read. A board with no size is ignored. */ width?: number; height?: number; /** Where it goes: a name (`BOARD_POSITIONS`) or a point of your own. `top` by default. */ position?: BoardPosition | BoardPoint; /** How opaque it is, 0 to 1. 1 by default. */ opacity?: number; /** Its width as a share of the drawing's width, 0.1 to 1. By default 0.5 at the top and the bottom, 0.3 at a side and 0.36 in a corner, and 0.4 at a point; a board is never made larger than the room that keeps the middle of the surface clear. */ share?: number; /** The gap between the board and the edge of the drawing, as a share of the drawing's width, 0 to 0.2. 0.02 by default. */ margin?: number; /** Let a named position cover the middle of the surface, so that the board may be as large as `share` says (it is still kept inside the drawing). Off by default. */ cover?: boolean; /** What the board says, in a sentence, for a reader who cannot see it: its title and who leads, say. Without it the board is hidden from assistive technology (it is a picture of what the page says elsewhere). */ label?: string; } /** A board that has been read: sizes and places that can be used, and the picture as an address. */ export interface ResolvedBoard { href: string; width: number; height: number; position: BoardPosition | { x: number; y: number; anchor: "start" | "center"; }; opacity: number; share: number; margin: number; cover: boolean; label: string | undefined; } /** A box: a drawing's viewBox, or the place a board takes in it. */ export interface BoardBox { x: number; y: number; w: number; h: number; } /** The positions, in the order a menu lists them. */ export declare const BOARD_POSITIONS: readonly BoardPosition[]; /** The share of a drawing's width and of its height that is kept clear round its middle: a board placed by name does not reach into it, so the middle of the playing area, where the score's panel stands, is never covered. */ export declare const BOARD_CLEAR = 0.34; /** The shape of the box a 3D view is placed for (16 by 10, the view's own) and the units of it: a board in 3D is placed for this box and keeps its place, as a share of the box, when the box is another shape. */ export declare const BOARD_TURN_BOX: BoardBox; /** The board an option asks for, read: a bad one is `undefined` and the drawing is as it was without it, as a bad `background` image is. */ export declare function resolveBoard(value: unknown): ResolvedBoard | undefined; /** * The place a board takes in a box. A named position keeps to its edge and takes the share asked for, unless that would reach into the middle (`BOARD_CLEAR` of the box's width and height, centred): then the board is made smaller, down * to nothing in a box too small to hold one, and never moved. `cover` lifts that, and a point of your own is never held to it. The board keeps its own shape, and stays inside the box. */ export declare function placeBoard(board: ResolvedBoard, view: BoardBox): BoardBox; /** The board as markup in a drawing: an image in the box `placeBoard` gave, in the drawing's own units, over everything else. Nothing for a box with no room. */ export declare function overlayMarkup(board: ResolvedBoard, box: BoardBox): string; /** * The 3D view's board: a layer over the whole view (not in the scene, so it never turns, tips or zooms with it), and in it the picture at its size as a share of the view's width, its own shape kept (`height:auto`, `object-fit:contain`), * placed by flex alignment on the view's edges. Its largest height is what the box `BOARD_TURN_BOX` gives it, so that on a wider view than that it still does not reach into the middle. It never takes the pointer: a drag on it turns the view. */ export declare function turnBoardMarkup(board: ResolvedBoard): string; /** The rules of the 3D view's board layer, written into `KYOGIJO_TURN_STYLE`. */ export declare const KYOGIJO_TURN_BOARD_STYLE: string;