Skip to content

SnapshotPort

export interface SnapshotPort {
snapshot(now: number): void;
dependencies?(): SnapshotPort[];
}

A port to capture and confirm state at the beginning of each frame (snapshot). The Simulator updates all SnapshotPort instances at once per frame via FrameSnapshotRegistry.

MemberDescription
snapshot(now)Receives the current timestamp now and captures the current value as internal snapshot state
dependencies?()Returns a list of other SnapshotPort instances this port depends on

When snapshot(now) is called, the port is expected to capture the current value and maintain it as internal state. Subsequent reads (such as gate or vector()) must return the captured value until the next snapshot() is called. Implementing dependencies() ensures that dependent ports are snapshotted first.