SizeReadablePort
Interface
Section titled “Interface”export interface SizeReadablePort extends SnapshotPort { size(): Readonly<[number, number]>;}PURPOSE
Section titled “PURPOSE”A port providing width and height (dimensions). Used when passing DOM element size as input to the simulation.
| Method | Description |
|---|---|
size() | Returns the [width, height] at the time of snapshot |
Must inherit from SnapshotPort.
When snapshot() is called, the port must capture the size tuple at that moment and maintain it internally.
Within a single tick, size() must return the same array object (equivalent by ===).
If size doesn’t change, the same reference may be returned across multiple snapshots.