import { ImagePatternObject } from '../graphic/Pattern'; import CanvasPainter from './Painter'; import { GradientObject } from '../graphic/Gradient'; import Eventful from '../core/Eventful'; import { ElementEventCallback } from '../Element'; import Displayable from '../graphic/Displayable'; import BoundingRect from '../core/BoundingRect'; export interface LayerConfig { clearColor?: string | GradientObject | ImagePatternObject; motionBlur?: boolean; lastFrameAlpha?: number; } export default class Layer extends Eventful { id: string; dom: HTMLCanvasElement; domBack: HTMLCanvasElement; ctx: CanvasRenderingContext2D; ctxBack: CanvasRenderingContext2D; painter: CanvasPainter; clearColor: string | GradientObject | ImagePatternObject; motionBlur: boolean; lastFrameAlpha: number; dpr: number; virtual: boolean; config: {}; incremental: boolean; zlevel: number; maxRepaintRectCount: number; private _paintRects; __painter: CanvasPainter; __dirty: boolean; __firstTimePaint: boolean; __used: boolean; __drawIndex: number; __startIndex: number; __endIndex: number; __prevStartIndex: number; __prevEndIndex: number; __builtin__: boolean; constructor(id: string | HTMLCanvasElement, painter: CanvasPainter, dpr?: number); getElementCount(): number; afterBrush(): void; initContext(): void; setUnpainted(): void; createBackBuffer(): void; createRepaintRects(displayList: Displayable[], prevList: Displayable[], viewWidth: number, viewHeight: number): BoundingRect[]; debugGetPaintRects(): BoundingRect[]; resize(width: number, height: number): void; clear(clearAll?: boolean, clearColor?: string | GradientObject | ImagePatternObject, repaintRects?: BoundingRect[]): void; refresh: (clearColor?: string | GradientObject | ImagePatternObject) => void; renderToCanvas: (ctx: CanvasRenderingContext2D) => void; onclick: ElementEventCallback; ondblclick: ElementEventCallback; onmouseover: ElementEventCallback; onmouseout: ElementEventCallback; onmousemove: ElementEventCallback; onmousewheel: ElementEventCallback; onmousedown: ElementEventCallback; onmouseup: ElementEventCallback; oncontextmenu: ElementEventCallback; ondrag: ElementEventCallback; ondragstart: ElementEventCallback; ondragend: ElementEventCallback; ondragenter: ElementEventCallback; ondragleave: ElementEventCallback; ondragover: ElementEventCallback; ondrop: ElementEventCallback; }