travels
    Preparing search index...

    Type Alias TravelsDeserializeOptions<S, P>

    type TravelsDeserializeOptions<S, P extends PatchesOption = {}> = {
        fallback?:
            | TravelsSerializedHistory<S, P>
            | (() => TravelsSerializedHistory<S, P>);
        migrate?: TravelsMigration<S, P>;
        onError?: (error: Error) => void;
        replayOptions?: TravelsReplayOptions;
        validation?: TravelsHistoryValidationMode;
    }

    Type Parameters

    Index

    Properties

    fallback?:
        | TravelsSerializedHistory<S, P>
        | (() => TravelsSerializedHistory<S, P>)

    Fallback snapshot used when parsing, migration, or validation fails. Function fallbacks must return synchronously.

    migrate?: TravelsMigration<S, P>

    Migrate old persisted snapshots into the current schema before validation. The callback must return synchronously; perform asynchronous I/O before calling deserialize().

    onError?: (error: Error) => void

    Receive typed persistence errors before a fallback is returned or the error is thrown.

    replayOptions?: TravelsReplayOptions

    Mutative options used while semantically replaying every history entry. Supply the same strict/mark settings that were used to record the history.

    structural validates the encoded schema and patch shapes (default). semantic additionally replays and reverses every entry and is recommended for snapshots that have not crossed a trusted verification boundary.