lazy-widgets
Version:
Typescript retained mode GUI for the HTML canvas API
38 lines (37 loc) • 1.75 kB
TypeScript
import { CanvasViewport } from './CanvasViewport.js';
import type { Rect } from '../helpers/Rect.js';
import type { Widget } from '../widgets/Widget.js';
import { type BackingCanvasContext, type BackingCanvas } from '../helpers/BackingCanvas.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: BackingCanvas;
/** The overlay canvas's context */
readonly overlayContext: BackingCanvasContext;
/** The internal canvas with the overlay applied on top of it (output) */
readonly outputCanvas: BackingCanvas;
/** The output canvas's context */
readonly outputContext: BackingCanvasContext;
/** 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 {};