API > wxt/utils/storage > WxtStorageItemOptions
Interface: WxtStorageItemOptions<T> 
Contents 
Type parameters 
▪ T
Properties 
debug 
debug?:
boolean
Print debug logs, such as migration process.
Default 
falseSource 
packages/storage/dist/index.d.mts:259
defaultValue 
defaultValue?:
T
Deprecated 
Renamed to fallback, use it instead.
Source 
packages/storage/dist/index.d.mts:234
fallback 
fallback?:
T
Default value returned when getValue would otherwise return null.
Source 
packages/storage/dist/index.d.mts:238
init 
init?: () =>
T|Promise<T>
If passed, a value in storage will be initialized immediately after defining the storage item. This function returns the value that will be saved to storage during the initialization process if a value doesn't already exist.
Source 
packages/storage/dist/index.d.mts:245
migrations 
migrations?:
Record<number, (oldValue) =>any>
A map of version numbers to the functions used to migrate the data to that version.
Source 
packages/storage/dist/index.d.mts:254
onMigrationComplete 
onMigrationComplete?: (
migratedValue,targetVersion) =>void
A callback function that runs on migration complete.
Parameters 
▪ migratedValue: T
▪ targetVersion: number
Source 
packages/storage/dist/index.d.mts:263
version 
version?:
number
Provide a version number for the storage item to enable migrations. When changing the version in the future, migration functions will be ran on application startup.
Source 
packages/storage/dist/index.d.mts:250
Generated using typedoc-plugin-markdown and TypeDoc