import { Entity, type Bounds, type BatchRect } from '../tree/Entity'; import type { IRenderer } from '../renderer/IRenderer'; /** Construction options for {@link Rect}. */ export interface RectOptions { /** Width in local units. Default `0`. */ width?: number; /** Height in local units. Default `0`. */ height?: number; /** CSS fill color, or `null` for no fill. Default `'#38bdf8'`. */ fill?: string | null; /** CSS stroke color, or `null` for no stroke. Default `null`. */ stroke?: string | null; /** Stroke width in local units. Default `1`. */ strokeWidth?: number; /** Corner radius in local units (uniform). Default `0` (sharp corners). */ radius?: number; } /** * A concrete axis-aligned rectangle primitive drawn from its local origin * `(0, 0)` to `(width, height)`. Instantiate directly — no subclassing: * * @example * const box = new Rect({ width: 120, height: 64, fill: '#38bdf8', radius: 8 }); * box.set({ x: 40, y: 40 }); * scene.add(box); * * The box matches the entity's `width`/`height`, so its accessibility shadow * node lines up with what's drawn. A solid-fill, non-rounded, unstroked Rect * opts into the WebGL instanced-rectangle fast path via {@link getBatchRect}; * rounded or stroked rectangles render through the normal Canvas path. */ export declare class Rect extends Entity { fill: string | null; stroke: string | null; strokeWidth: number; radius: number; constructor(opts?: RectOptions); getBounds(): Bounds; /** * Solid-fill, square-cornered, unstroked rectangles opt into the GPU * instanced-rect batch (WebGL `pointBackend` only). Any stroke or corner * radius needs the exact Canvas path, so return `null` to fall back to * {@link render}. Read each frame, so an animated `fill` still batches. */ getBatchRect(): BatchRect | null; isPointInside(globalX: number, globalY: number): boolean; render(renderer: IRenderer): void; }