PositionReadablePort
Interface
Section titled “Interface”export interface PositionReadablePort extends SnapshotPort { position(): Readonly<[number, number]>;}PURPOSE
Section titled “PURPOSE”A port providing 2D coordinates (x, y). Used when expressing coordinates as a pair value, such as pointer position or DOM element position.
| Method | Description |
|---|---|
position() | Returns the [x, y] coordinates at the time of snapshot |
Must inherit from SnapshotPort.
When snapshot() is called, the port must capture the coordinate tuple at that moment and maintain it internally.
Within a single tick, position() must return the same array object (equivalent by ===).
If coordinates don’t change, the same reference may be returned across multiple snapshots.