Skip to content

API > wxt/storage > WxtStorageItem

Interface: WxtStorageItem<TValue, TMetadata>

Contents

Type parameters

TValue

TMetadata extends Record<string, unknown>

Methods

getMeta()

getMeta(): Promise<NullablePartial<TMetadata>>

Get metadata.

Source

src/storage.ts:516


getValue()

getValue(): Promise<TValue>

Get the latest value from storage.

Source

src/storage.ts:512


removeMeta()

removeMeta(properties?): Promise<void>

Remove all metadata or certain properties from metadata.

Parameters

properties?: string[]

Source

src/storage.ts:532


removeValue()

removeValue(opts?): Promise<void>

Remove the value from storage.

Parameters

opts?: RemoveItemOptions

Source

src/storage.ts:528


setMeta()

setMeta(properties): Promise<void>

Set metadata properties.

Parameters

properties: NullablePartial<TMetadata>

Source

src/storage.ts:524


setValue()

setValue(value): Promise<void>

Set the value in storage.

Parameters

value: null | TValue

Source

src/storage.ts:520


watch()

watch(cb): Unwatch

Listen for changes to the value in storage.

Parameters

cb: WatchCallback<TValue>

Source

src/storage.ts:536


Generated using typedoc-plugin-markdown and TypeDoc