API Reference
Everything below is a named export of @veyrajs/core (ESM-only, fully typed). This page is the
map; follow a link for each module’s signatures. For the how and why, see
Core Concepts.
import { Stage, Layer, Rect, History, SelectionController } from '@veyrajs/core'Modules
Section titled “Modules”| Module | Exports | Reference |
|---|---|---|
| Math | Vec2, Matrix, Bounds, MatrixComponents, pointInPolygon, distanceToSegment, distanceToPolyline |
Math → |
| Scene graph | Node, Container, Group, Layer, Stage, NodeConfig, StageOptions, Overlay |
Scene → |
| Camera | Camera, CameraOptions |
Camera → |
| Shapes | Shape, Rect, Circle, Ellipse, Line, Polygon, Image, Text (+ each *Config) |
Shapes → |
| Rendering | Renderer, Renderable, FrameInfo, Canvas2DRenderer, DrawOp (+ each *Op), FillStrokeStyle |
Rendering → |
| Events | SceneEvent, SceneEventType, SceneEventPhase, SceneEventListener, EventManager, dispatchEvent |
Events → |
| Hit testing | GeometricHitTester, HitTester, HitResult, HitType, HitTestOptions |
Hit-Testing → |
| Selection & controls | SelectionManager, SelectionController, DEFAULT_CONTROLS, ControlDef, HandleKind, computeResize, computeRotation, pointerAngle |
Selection & Controls → |
| Serialization | SceneSerializer, ClassRegistry, createDefaultRegistry, MigrationRunner, CURRENT_SCHEMA_VERSION, SceneDocument, SerializedNode |
Serialization → |
| Commands & history | History, SetPropsCommand, AddNodeCommand, RemoveNodeCommand, CompositeCommand, Command, NodeProps |
Commands → |
| Utilities | FrameScheduler, nextId, VERSION |
Utilities → |
Conventions across the API
Section titled “Conventions across the API”- Coordinates: top-left origin, y-down, rotation in degrees clockwise.
- Config objects: constructors take a single typed config (
new Rect({ x, y, width, height })). - Guarded setters: assigning an unchanged value is a no-op (the basis of adapter loop-safety).
- Immutability where it counts:
MatrixandVec2operations return new instances. - No default export, no globals — every symbol is a named export.