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
CanvasRuntimePrismNativeErrortype CanvasDiagnosticstype CanvasSurfacetype CanvasBackendKindtype CanvasBackendPreferencetype CanvasRuntimeOptionstype SurfaceOptionstype SurfaceBoundsInputtype PaintHandlertype UpdateHandlertype CanvasPoint
CanvasRuntime is the only constructible public runtime class. PrismNativeError is the diagnostic error class for native paint failures.
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 an element already owned by an active surface throws, within one runtime or across runtimes. Dispose or unregister the existing surface before transferring ownership.
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