API > wxt/storage > WxtStorageItemOptions
Interface: WxtStorageItemOptions<T>
Contents
Type parameters
▪ T
Properties
defaultValue
defaultValue?:
T
Deprecated
Renamed to fallback
, use it instead.
Source
packages/wxt/src/storage.ts:675
fallback
fallback?:
T
Default value returned when getValue
would otherwise return null
.
Source
packages/wxt/src/storage.ts:679
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/wxt/src/storage.ts:686
migrations
migrations?:
Record
<number
, (oldValue
) =>any
>
A map of version numbers to the functions used to migrate the data to that version.
Source
packages/wxt/src/storage.ts:695
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/wxt/src/storage.ts:691
Generated using typedoc-plugin-markdown and TypeDoc