UNPKG

discord-card-canvas

Version:

👾 Simple creating cards using canvas. Welcome, Rank, Info and so on.

23 lines (22 loc) • 907 B
import { Canvas, CanvasRenderingContext2D } from 'canvas'; import { BackgroundBaseColor, TextCard } from '../../interface/card.interface'; export interface InfoCardParams { backgroundColor?: BackgroundBaseColor; backgroundImgURL?: string; mainText?: TextCard; } type OptionsDraw = { objectFit?: 'fill' | 'cover'; }; export declare class InfoCardBuilder { backgroundColor: BackgroundBaseColor; backgroundImgURL?: string; mainText?: TextCard; constructor({ backgroundImgURL, backgroundColor, mainText, }?: InfoCardParams); setBackgroundColor(backgroundColor: BackgroundBaseColor): this; setBackgroundImgURL(backgroundImgURL: string): this; setMainText(mainText: TextCard): this; draw(ctx: CanvasRenderingContext2D, canvasWidth: number, canvasHeight: number, options?: OptionsDraw): Promise<void>; build(options?: OptionsDraw): Promise<Canvas>; } export {};