Wraps a recording in the versioned, self-describing envelope, as a JSON string ready to save as a file. The events are validated and copied, so the exported file cannot drift with a recording that keeps running.
import { exportReplayFile, Recorder, Signal, version } from '@datamoc/mwg';declare const recorder: Recorder;const file = exportReplayFile(recorder.toJSON(), { framework: version, game: 'my-game', recordedAt: Date.now(),}); Copy
import { exportReplayFile, Recorder, Signal, version } from '@datamoc/mwg';declare const recorder: Recorder;const file = exportReplayFile(recorder.toJSON(), { framework: version, game: 'my-game', recordedAt: Date.now(),});
Wraps a recording in the versioned, self-describing envelope, as a JSON string ready to save as a file. The events are validated and copied, so the exported file cannot drift with a recording that keeps running.