/** The backs, by name. * * @example * ```ts * import { CARD_BACKS } from "@johnmorrisdotca/toranpu/card-backs"; * console.log(CARD_BACKS); * ``` */ export declare const CARD_BACKS: readonly ["classic-red", "classic-blue", "ink-dots"]; /** One back's name. * * @example * ```ts * import type { CardBackName } from "@johnmorrisdotca/toranpu/card-backs"; * * const value: CardBackName = "classic-blue"; * console.log(value); * ``` */ export type CardBackName = (typeof CARD_BACKS)[number]; /** Each back's own colours: its field, the lines and dots drawn on the field, and the paper round it. * * @example * ```ts * import { CARD_BACK_LOOK } from "@johnmorrisdotca/toranpu/card-backs"; * console.log(CARD_BACK_LOOK); * ``` */ export declare const CARD_BACK_LOOK: Readonly>; /** How a back is drawn. Every field may be left out. * * @example * ```ts * import type { CardBackOptions } from "@johnmorrisdotca/toranpu/card-backs"; * * const value: CardBackOptions = { width: 80, colour: "#2f5d4a", mark: "D" }; * console.log(value.mark); * ``` */ export type CardBackOptions = { /** The field's colour, in place of the back's own: `#8f2826`, `rebeccapurple`, `rgb(…)`. Anything else is ignored. */ colour?: string; /** The colour of the lines and dots on the field. */ ink?: string; /** The colour of the paper round the field. */ paper?: string; /** Words in the middle, such as a site's name or mark ("五つ", "一つ"), in place of the back's own ornament. */ mark?: string; /** The width to draw at, in pixels; the height is 1.4 times it. Unless said, the drawing has no size and fills what holds it. */ width?: number; /** What a screen reader says for it. Unless said (or said as ""), the back is decoration and says nothing. */ title?: string; /** * Your own artwork for the whole back: SVG markup drawn in the 100 by 140 box, over the paper, in place of the lattice and * the ornament. It is the page's own markup: scripts, handlers and foreign objects are taken out of it. */ art?: string; /** * Your own picture for the whole back, in place of the lattice and the ornament: a `data:image/` address, an `https:` * address, or an address on your own site. It fills the card inside its rounded edge. Drawn into a page it loads like any * image; as an image of its own (`cardBackUrl`) only a `data:image/` address can load, which is how browsers treat a * picture inside a picture. */ image?: string; /** * Your logo, in the middle of the back: SVG markup drawn in a 100 by 100 box, or a picture's address as for `image`. * Over the lattice it sits on a plate of the paper's colour; over your own `art` or `image` it sits as it is. */ logo?: string; /** How wide the logo is drawn, in units of the 100 wide card. Unless said, 34; at most 80. */ logoSize?: number; }; /** The CSS custom properties a back drawn into a page takes its colours from, when no colour is given. * * @example * ```ts * import { CARD_BACK_PROPERTIES } from "@johnmorrisdotca/toranpu/card-backs"; * console.log(CARD_BACK_PROPERTIES); * ``` */ export declare const CARD_BACK_PROPERTIES: { readonly field: "--toranpu-back"; readonly ink: "--toranpu-back-ink"; readonly paper: "--toranpu-back-paper"; }; /** The backs a page may ask for by name: the package's own, and any the page registered (`registerCardBack`). * * @returns The backs a page may ask for by name: the package's own, and any the page registered (`registerCardBack`). * * @example * ```ts * import { cardBackNames } from "@johnmorrisdotca/toranpu/card-backs"; * * console.log(cardBackNames()); * ``` */ export declare function cardBackNames(): string[]; /** * A back as a whole SVG document, 100 by 140. `name` is one of `CARD_BACKS` * (an unknown name draws the classic red); the options recolour it, put words * in its middle, size it and name it. * * Drawn into a page, a back takes its colours from the CSS custom properties * `--toranpu-back`, `--toranpu-back-ink` and `--toranpu-back-paper` where they * are set and no colour is given here; as an image, it keeps its own. * * @param name - The registered card design or card-back name. * @param given - Explicit card-back settings to override the defaults. * @returns A back as a whole SVG document, 100 by 140. `name` is one of `CARD_BACKS` (an unknown name draws the classic red); the options recolour it, put words in its middle, size it and name it. Drawn into a page, a back takes its colours from the CSS custom properties `--toranpu-back`, `--toranpu-back-ink` and `--toranpu-back-paper` where they are set and no colour is given here; as an image, it keeps its own. * * @example * ```ts * import { cardBackSvg } from "@johnmorrisdotca/toranpu/card-backs"; * * console.log(cardBackSvg("classic-red", { width: 80 }).slice(0, 160)); * ``` */ export declare function cardBackSvg(name?: CardBackName | string, given?: CardBackOptions): string; /** A back as a data URL, for an , a CSS background or a canvas: the same drawing as `cardBackSvg`, with its own colours. * * @param name - The registered card design or card-back name. * @param options - Options for this call; omitted fields retain their documented defaults. * @returns A back as a data URL, for an , a CSS background or a canvas: the same drawing as `cardBackSvg`, with its own colours. * * @example * ```ts * import { cardBackUrl } from "@johnmorrisdotca/toranpu/card-backs"; * * console.log(cardBackUrl("ink-dots").slice(0, 40)); * ``` */ export declare function cardBackUrl(name?: CardBackName | string, options?: CardBackOptions): string;