Skip to content

API > @wxt-dev/storage > WxtStorageItemOptions

Interface: WxtStorageItemOptions<T>

Contents

Type parameters

T

Properties

defaultValue

defaultValue?: T

Deprecated

Renamed to fallback, use it instead.

Source

packages/storage/dist/index.d.mts:222


fallback

fallback?: T

Default value returned when getValue would otherwise return null.

Source

packages/storage/dist/index.d.mts:226


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:233


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:242


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:238


Generated using typedoc-plugin-markdown and TypeDoc