import type { CardColors } from "./color.js"; /** * Builds the card CSS for one color scheme from that scheme's resolved colors. */ type CardCSSBuilder = (colors: CardColors) => string; declare class Card { width: number; height: number; hideBorder: boolean; hideTitle: boolean; border_radius: number; colors: { light: CardColors; dark: CardColors | null; }; title: string; css: string; darkCss: string; paddingX: number; paddingY: number; titlePrefixIcon: string | undefined; animations: boolean; a11yTitle: string; a11yDesc: string; /** * Creates a new card instance. * * The caller must ensure that the passed `titlePrefixIcon` is properly sanitized! * * @param props Card arguments. * @param props.width Card width. * @param props.height Card height. * @param props.border_radius Card border radius. * @param props.colors Card colors for light and dark mode. * @param props.colors.light Card colors for light mode. * @param props.colors.dark Card colors for dark mode, or `null` when no dark-mode override is needed. * @param props.customTitle Card custom title. * @param props.defaultTitle Card default title. * @param props.titlePrefixIcon Sanitized card title prefix icon. */ constructor({ width, height, border_radius, colors, customTitle, defaultTitle, titlePrefixIcon, }: { width?: number; height?: number; border_radius?: number | undefined; colors?: { light: CardColors; dark: CardColors | null; }; customTitle?: string | undefined; defaultTitle?: string; titlePrefixIcon?: string; }); disableAnimations(): void; /** * @param props The props object. * @param props.title Accessibility title. * @param props.desc Accessibility description. */ setAccessibilityLabel({ title, desc, }: { title: string; desc: string; }): void; /** * Sets the card CSS for light and dark mode. * * Each builder receives the colors of its own color scheme, * so a card never handles a missing dark palette itself: * `dark` runs only when the card has dark colors, and always with non-null ones. * * @warning The caller must ensure that the returned CSS strings are properly sanitized! * * @param props The props object. * @param props.light Builds the CSS applied unconditionally (light/default mode). * @param props.dark Builds the CSS placed inside a `@media (prefers-color-scheme: dark)` block. */ setCSS({ light, dark, }: { light: CardCSSBuilder; dark: CardCSSBuilder; }): void; /** * @param value Whether to hide the border or not. */ setHideBorder(value: boolean): void; /** * @param value Whether to hide the title or not. */ setHideTitle(value: boolean): void; /** * @param text The title to set. */ setTitle(text: string): void; /** * @returns The rendered card title. */ renderTitle(): string; /** * @returns The rendered card gradient. */ renderGradient(): string; /** * Retrieves css animations for a card. * * @returns Animation css. */ getAnimations: () => string; /** * Builds the @media (prefers-color-scheme: dark) CSS block for the card. * Returns an empty string when no dark colors are set. */ private renderDarkMediaBlock; /** * The caller must ensure that the passed `body` string is properly sanitized! * * @param body The sanitized inner body of the card. * @returns The rendered card. */ render(body: string): string; } export { Card }; export default Card; //# sourceMappingURL=Card.d.ts.map