mwg API
    Preparing search index...

    Function exportReplayFile

    • 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.

      Parameters

      Returns string

      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(),
      });