Skip to content

@statesync/core


@statesync/core / SnapshotEnvelope

Interface: SnapshotEnvelope<T> ​

Defined in: types.ts:94

A versioned wrapper around a snapshot payload.

Returned by SnapshotProvider.getSnapshot and passed to SnapshotApplier.apply. The revision field lets the engine determine whether the snapshot is newer than the locally held state.

Example ​

ts
const envelope: SnapshotEnvelope<UserProfile> = {
  revision: '42' as Revision,
  data: { name: 'Alice', email: 'alice@example.com' },
};

Type Parameters ​

Type ParameterDescription
TThe application-specific snapshot data type.

Properties ​

data ​

ts
data: T;

Defined in: types.ts:98

The application-specific snapshot payload.


revision ​

ts
revision: Revision;

Defined in: types.ts:96

The revision this snapshot corresponds to.

Released under the MIT License.