UNPKG

625 BTypeScriptView Raw
1import { BaseImageResource } from './BaseImageResource';
2import type { ICanvas } from '@pixi/settings';
3/**
4 * Resource type for HTMLCanvasElement and OffscreenCanvas.
5 * @memberof PIXI
6 */
7export declare class CanvasResource extends BaseImageResource {
8 /**
9 * @param source - Canvas element to use
10 */
11 constructor(source: ICanvas);
12 /**
13 * Used to auto-detect the type of resource.
14 * @param {*} source - The source object
15 * @returns {boolean} `true` if source is HTMLCanvasElement or OffscreenCanvas
16 */
17 static test(source: unknown): source is OffscreenCanvas | HTMLCanvasElement;
18}