F
define
Binds a settings schema to a Bucket: reads apply defaults and writes are validated against the schema.
Plugins reach it through @unbound-app/settings, which the build generates from their settings.ts.
function define(schema: SettingsSchema, name?: string): DefinedSettingsParameters
| Name | Type | Description |
|---|---|---|
| schema | SettingsSchema | The settings schema. |
| name? | string | The Bucket name. A plugin may omit it to use its own Bucket. |
Returns
DefinedSettingsThe settings, their hook and their reset.
Throws
When name is omitted outside a plugin.