UNPKG

lazy-widgets

Version:

Typescript retained mode GUI for the HTML canvas API

37 lines (36 loc) 1.67 kB
import { CanvasViewport } from './CanvasViewport.js'; import type { Rect } from '../helpers/Rect.js'; import type { Widget } from '../widgets/Widget.js'; type DebugEvent = [rect: Rect, timestamp: number, isMerged: boolean]; export declare class DebuggableCanvasViewport extends CanvasViewport { /** The overlay canvas. Dirty rects are painted to this */ readonly overlayCanvas: HTMLCanvasElement; /** The overlay canvas's context */ readonly overlayContext: CanvasRenderingContext2D; /** The internal canvas with the overlay applied on top of it (output) */ readonly outputCanvas: HTMLCanvasElement; /** The output canvas's context */ readonly outputContext: CanvasRenderingContext2D; /** The list of recently pushed dirty rects, with their timestamps */ readonly events: Set<DebugEvent>; /** Is the overlay enabled? Disabled by default */ private _overlayEnabled; /** Does the overlay need to be updated? */ private _overlayDirty; /** When was the last time the PPS was measured? */ private _lastPPSMeasurement; /** Current PPS text value */ private _ppsText; /** Paints since last measurement */ private _paintCounter; constructor(child: Widget, resolution?: number, preventBleeding?: boolean, preventAtlasBleeding?: boolean, startingWidth?: number, startingHeight?: number); get overlayEnabled(): boolean; set overlayEnabled(overlayEnabled: boolean); updateOutputCanvas(): void; private addDebugEvent; pushDirtyRects(rects: Array<Rect>): void; pushDirtyRect(rect: Rect): void; resolveLayout(): boolean; paintToInternal(): null | Array<Rect>; } export {};