UNPKG

637 BTypeScriptView Raw
1export declare const DEFAULT_FONT_SIZE = 12;
2export declare const DEFAULT_FONT_FAMILY = "sans-serif";
3export declare const DEFAULT_FONT: string;
4interface Platform {
5 createCanvas(): HTMLCanvasElement;
6 measureText(text: string, font?: string): {
7 width: number;
8 };
9 loadImage(src: string, onload: () => void | HTMLImageElement['onload'], onerror: () => void | HTMLImageElement['onerror']): HTMLImageElement;
10}
11export declare const DEFAULT_TEXT_WIDTH_MAP: Record<string, number>;
12export declare const platformApi: Platform;
13export declare function setPlatformAPI(newPlatformApis: Partial<Platform>): void;
14export {};