import type { Rect } from '../types';
export declare class ScalerContext {
    static canvas: HTMLCanvasElement | OffscreenCanvas;
    static context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
    static setCanvas(canvas: HTMLCanvasElement | OffscreenCanvas): void;
    static setContext(context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D): void;
    static isEmoji(text: string): boolean;
    private readonly fontName;
    private readonly fontStyle;
    private readonly size;
    private readonly fauxBold;
    private readonly fauxItalic;
    private fontBoundingBoxMap;
    constructor(fontName: string, fontStyle: string, size: number, fauxBold?: boolean, fauxItalic?: boolean);
    fontString(): string;
    getTextAdvance(text: string): number;
    getTextBounds(text: string): Rect;
    generateFontMetrics(): {
        ascent: number;
        descent: number;
        xHeight: number;
        capHeight: number;
    };
    generateImage(text: string, bounds: Rect): HTMLCanvasElement | OffscreenCanvas;
    protected loadCanvas(): void;
    private measureText;
}
