/** * What every drawing in Toranpu shares: the card's box, the suits drawn as * shapes (no font's glyph, so every browser draws the same), and the small * helpers that write SVG safely. Drawn for Toranpu; MIT like the rest. */ import type { CardSuitLetter } from "./svg.types.ts"; /** A card is drawn in a box 100 wide and 140 tall, the 5:7 of a poker-size card, and scales to any width. * * @example * ```ts * import { CARD_BOX } from "@johnmorrisdotca/toranpu/card-backs"; * console.log(CARD_BOX); * ``` */ export declare const CARD_BOX: { readonly width: 100; readonly height: 140; readonly radius: 7; }; /** * The four suits, each a path in a box of 100 filled in one colour. A club is * three lobes and a stem, a spade a heart turned over with a stem, so the * four are told apart by their outline alone. * * @example * ```ts * import { SUIT_PATHS } from "@johnmorrisdotca/toranpu/card-backs"; * console.log(Object.keys(SUIT_PATHS)); * ``` */ export declare const SUIT_PATHS: Readonly>; /** Text made safe inside an attribute or between tags. */ export declare const escapeXml: (text: string) => string; /** A colour a person may hand in: a hex colour, a name, or rgb()/hsl()/oklch() with plain numbers. Anything else is refused, so nothing can be written into the drawing through it. */ export declare function isColour(text: unknown): text is string; /** * A paint: the colour given when one is, and otherwise a CSS custom property * with the drawing's own colour behind it, so that a drawing put into a page * takes the page's theme, and the same drawing in an keeps its own. */ export declare function paint(kind: "fill" | "stroke", property: string, given: string | undefined, fallback: string): string; /** A suit as a path, `size` across, its middle at x, y. */ export declare function suitPath(suit: CardSuitLetter, x: number, y: number, size: number, colour: string): string; /** A number written short, for a drawing: no more places than are needed. */ export declare const round: (value: number, places?: number) => string; /** An SVG document, as a string or as a data URL an or CSS can take. */ export declare function svgDataUrl(svg: string): string; /** * What every card drawing carries on its root, so its letters and pips can never be highlighted * by a drag or a long press: a card is a picture to play with, not text to copy. */ export declare const UNSELECTABLE = " style=\"user-select:none;-webkit-user-select:none\"";