/** The styles an emblem is drawn in: full colour with metallic gradients, one outline in the page's ink, or flat fills. */ export type EmblemStyleName = "metal" | "line" | "color"; /** What kyogijo asks of a renderer. It is a subset of dougu-sports' `EmblemOptions`. */ export interface EmblemDrawOptions { style?: EmblemStyleName; /** The colour of the emblem's main part: a crest takes the team's colour. */ tint?: string; /** A second colour: a crest's band. */ accent?: string; /** The letters of a crest, up to three. */ initials?: string; /** `inherit`, `auto` (by the device's setting), `light` or `dark`. */ theme?: "inherit" | "auto" | "light" | "dark"; size?: number; } /** * A function that draws an emblem from its id as a document of SVG, and throws for an id it does not know: `renderEmblem` of `@johnmorrisdotca/dougu-sports/emblems` is one. * The id may end in `/metal`, `/line` or `/color`, and the renderer reads that suffix. */ export type EmblemRenderer = (id: string, options?: EmblemDrawOptions) => string; type Known = 0 extends 1 & T ? string : T; /** @ts-ignore optional: resolves only where @johnmorrisdotca/dougu-sports is installed; elsewhere it is `any`, which `Known` turns into `string`. */ type DouguId = import("@johnmorrisdotca/dougu-sports/emblems").EmblemId; /** * The ids of dougu-sports' emblems (`"trophy:cup"`, `"crest:shield"`), when that package is installed, so that an editor completes them; any other string otherwise. An id may end in `/metal`, `/line` or `/color`, * and a trophy or an award may be written without its group (`"cup"`). Nothing is imported at run time. */ export type EmblemId = Known; /** An emblem as a logo, a mark or a pageant's emblem is given: its id, with or without a style, or any string (an address, a data address or an SVG document). */ export type EmblemRef = EmblemId | `${EmblemId}/${EmblemStyleName}` | (string & {}); /** * Plug a renderer of ready-made emblems into kyogijo, for every drawing on the page: after this `logo: "crest:shield"` and `emblem: "trophy:hockey-cup"` are drawn. Call it once, at start-up. Without one, an id is * an address and is refused. `useEmblems(undefined)` unplugs it. * @example * ```ts * import { useEmblems } from "@johnmorrisdotca/kyogijo-stadiums"; * import { renderEmblem } from "@johnmorrisdotca/dougu-sports/emblems"; * useEmblems(renderEmblem); * ``` */ export declare function useEmblems(render: EmblemRenderer | undefined): void; /** Run a drawing with a renderer for that drawing alone (the `emblems` option), putting back whatever was there. Without a renderer it runs as it is. */ export declare function withEmblems(render: EmblemRenderer | undefined, draw: () => T): T; /** The renderer in use: the drawing's own, else the page's, else none. */ export declare function emblemRenderer(): EmblemRenderer | undefined; /** An id with its group, which no address has in practice: what a missing renderer is told about. */ export declare const GROUPED_ID: RegExp; /** The SVG document for a value that names an emblem, drawn by the renderer in use, or `undefined` (no renderer, not the look of an id, or an id the renderer does not know). */ export declare function renderedEmblem(value: unknown, options?: EmblemDrawOptions): string | undefined; export {};