UNPKG

@canvacord/beta

Version:

Simple & easy to use image manipulation module for beginners.

30 lines (29 loc) 1 kB
/// <reference types="node" /> import { SKRSContext2D as CanvasRenderingContext2D } from '@napi-rs/canvas'; /** * Canvacord Utils */ export declare class Util { constructor(); static loadImage(source: string | Buffer): Promise<import("@napi-rs/canvas").Image>; static createImage(src: Buffer): void; /** * Renders emoji in canvas * @param ctx Canvas rendering context * @param message message to render * @param x x co-ordinate * @param y y co-ordinate */ static renderEmoji(ctx: CanvasRenderingContext2D, message: string, x: number, y: number): Promise<void>; /** * Abbreviate the given number * @param num The number to abbreviate */ static toAbbrev(num: number): string; static get assets(): { font(name: string): Promise<string>; image(name: string): Promise<string>; }; static cleanText(text: string): string; static is(prop: any, propType: string): boolean; }