Value type stored under PersistedInputOptions.key.
ReadonlykeyStorage key under which the envelope is written.
Optional ReadonlymigrateMigrate an older-versioned stored value to current T. If absent
and the stored version differs, the in-memory value falls back to
initial; on-disk envelope is preserved when preserveOnError
is true (default).
Optional ReadonlyonCallback invoked on every PersistenceError. Default is a
single console.warn per failure so behaviour remains audible
during the rollout window.
Optional ReadonlyonLegacy migration-failure callback retained for backwards
compatibility. New code should use onError instead. When
supplied, it is invoked alongside onError for migrate-shaped
failures so existing consumers keep receiving notifications.
Optional ReadonlypreserveIf true (default), parse / migrate / serialise / quota failures
leave the existing on-disk envelope untouched. Issue #138 mandates
this behaviour; flip to false only when callers explicitly want
the old "drop on failure" semantics.
ReadonlystorageBacking store.
ReadonlyversionSchema version of T.
Configuration for persistedInput.
Remarks
The shape captures the four moving parts of write-through persistence — where (
key+storage), what version (version+migrate), what to do on failure (preserveOnError+onError), and a deprecated migration-only callback retained for adopter compatibility. The defaults (preserveOnError: true,onError: console.warn) mirror the issue #138 contract: persistence failures are observable but never fatal, and the on-disk envelope is never silently discarded.