Skip to main content
Version: 1.2.1-beta1.0

Interface: MnemonicKeyDescriptor<T, K>

Defined in: src/Mnemonic/types.ts:1130

Reusable, importable contract for a single persisted key.

Descriptors package the key name and its useMnemonicKey(...) options into a stable object that can be defined once at module scope and reused across components. This helps keep persistence behavior explicit and consistent, especially when the same key appears in multiple parts of an application.

Example

const themeKey = defineMnemonicKey("theme", {
defaultValue: "light" as "light" | "dark",
listenCrossTab: true,
});

const { value, set } = useMnemonicKey(themeKey);

See

Type Parameters

Type ParameterDefault typeDescription
T-The decoded value type for the key
K extends stringstringThe literal key name

Properties

key

readonly key: K

Defined in: src/Mnemonic/types.ts:1134

Unprefixed storage key name.


options

readonly options: UseMnemonicKeyOptions<T>

Defined in: src/Mnemonic/types.ts:1139

Canonical options for this key.