UNPKG

573 BTypeScriptView Raw
1/// <reference types="offscreencanvas" />
2/**
3 * used in following scenes:
4 * - g `ctx.measureText`
5 * - g-plugin-canvas-picker `ctx.isPointInPath`
6 * - g-plugin-device-renderer `ctx.createLinearGradient` and generate texture
7 */
8export declare class OffscreenCanvasCreator {
9 private canvas;
10 private context;
11 getOrCreateCanvas(offscreenCanvas: HTMLCanvasElement | OffscreenCanvas): HTMLCanvasElement | OffscreenCanvas;
12 getOrCreateContext(offscreenCanvas: HTMLCanvasElement | OffscreenCanvas): CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
13}