T

DefinedSettings

What storage.define returns: a schema's settings, bound to one Bucket.

type DefinedSettings = { … }

Members

get(key: string) => SettingValue

Reads a setting by its dot-separated key; a stored value the schema rejects is logged, removed and read as the default.

reset() => void

Puts every setting back to its default, leaving other keys of the Bucket alone.

The schema the settings were defined with.

set(key: string, value: SettingValue) => void

Saves a setting by its dot-separated key; throws when the schema rejects the value.

React hook that reads a setting, or a section as an object, and re-renders when it changes.

useVersion(enabled?: boolean) => number

React hook that re-renders on any change to the settings while enabled, and returns a number that changes with them.

The settings as an object; assign a property, a section's too, to save it.