Reference
API
Supported public API exported from the package root.
Import Prism from the package root:
import { CanvasRuntime } from "@synthesisengineering/prism";Everything outside the package root is not public API. Runtime internals, backend classes, and raw HTML-in-Canvas wrappers are internal.
Public exports
CanvasRuntimetype CanvasSurfacetype CanvasBackendKindtype CanvasBackendPreferencetype CanvasRuntimeOptionstype SurfaceOptionstype SurfaceBoundsInputtype PaintHandlertype UpdateHandlertype CanvasPoint
CanvasRuntime is the only constructible public runtime class.
CanvasSurface is a public TypeScript type. Surface instances are returned by
registerSurface() and should not be constructed by apps.
Runtime semantics
onPaint()andonUpdate()are additive. They register another handler and do not replace existing handlers.invalidate()schedules another Prism-owned paint pass; it does not store app state.- Registering the same element with the same runtime returns the existing
CanvasSurface; new options are not reapplied. paintOnce()works withoutstart(). PendingpaintOnce()waiters reject if a paint handler throws or the runtime is destroyed.destroy()disposes registered surfaces. Disposed surfaces reportisDisposed === true;getBounds()andsetBounds()throw.- Prism does not expose a general event system or unsubscribe API today.
Prism