Skip to content

Documentation / @debuffjp/core / StorageOptions

Interface: StorageOptions<T> ​

Defined in: core/src/storage.ts:1

Type Parameters ​

T ​

T

Properties ​

migrate? ​

optional migrate?: (old, from) => Partial<T>

Defined in: core/src/storage.ts:8

Turns a save written by an older version into the current shape. Runs once, when that save loads.

Parameters ​

old ​

Record<string, unknown>

from ​

number

Returns ​

Partial<T>


version? ​

optional version?: number

Defined in: core/src/storage.ts:6

Version of this save's shape, stored next to it. Bump it when you change the shape, and give migrate. Saves from before you set a version count as version 0.