Skip to content

domain/settings/setting

Defined in: app/src/domain/settings/setting.ts:49

Thrown for an invalid setting definition.

  • Error

new SettingDefinitionError(message?): SettingDefinitionError

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1080

string

SettingDefinitionError

Error.constructor

new SettingDefinitionError(message?, options?): SettingDefinitionError

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1080

string

ErrorOptions

SettingDefinitionError

Error.constructor

readonly name: "SettingDefinitionError" = 'SettingDefinitionError'

Defined in: app/src/domain/settings/setting.ts:50

Error.name

Defined in: app/src/domain/settings/setting.ts:34

Declares one setting. It is the single source for the settings page, the policy templates, the JSON schema and the documentation.

T

readonly default: T

Defined in: app/src/domain/settings/setting.ts:40

Value used when nothing else is set.

readonly key: string

Defined in: app/src/domain/settings/setting.ts:36

Dotted key, such as tabs.position. Never renamed without a migration.

readonly optional policy?: SettingPolicy

Defined in: app/src/domain/settings/setting.ts:42

readonly optional restartRequired?: boolean

Defined in: app/src/domain/settings/setting.ts:45

Whether a change only takes effect after a restart.

readonly schema: GenericSchema<unknown, T>

Defined in: app/src/domain/settings/setting.ts:38

Valibot schema that every value must satisfy.

readonly scope: SettingScope

Defined in: app/src/domain/settings/setting.ts:41

readonly optional ui?: SettingUi

Defined in: app/src/domain/settings/setting.ts:43


Defined in: app/src/domain/settings/setting.ts:8

Links a setting to the policy that administrators use to set or lock it.

readonly name: string

Defined in: app/src/domain/settings/setting.ts:10

Policy name in PascalCase, such as TabStripPosition. Never renamed once released.

readonly optional recommended?: boolean

Defined in: app/src/domain/settings/setting.ts:12

Whether the policy may also be set as a recommended (user-changeable) default.

readonly optional sensitive?: boolean

Defined in: app/src/domain/settings/setting.ts:17

Sensitive policies (update source, proxy, search engine) are only accepted from machine-wide, mandatory sources.


Defined in: app/src/domain/settings/setting.ts:21

How the settings page presents a setting. Texts come from the module’s locale catalog.

readonly control: "number" | "text" | "toggle" | "select" | "color" | "list" | "shortcut"

Defined in: app/src/domain/settings/setting.ts:25

Control used to edit the value.

readonly optional order?: number

Defined in: app/src/domain/settings/setting.ts:27

Sort order inside the section; lower comes first.

readonly section: string

Defined in: app/src/domain/settings/setting.ts:23

Section id on the settings page, such as appearance.

SettingScope = "global" | "workspace"

Defined in: app/src/domain/settings/setting.ts:5

Where a setting can be overridden: globally only, or also per workspace.

defineSetting<T>(definition): SettingDefinition<T>

Defined in: app/src/domain/settings/setting.ts:63

Declares a setting and checks that its key, policy name and default are valid.

T

SettingDefinition<T>

The setting.

SettingDefinition<T>

The frozen definition, which also serves as a typed handle for settings.get(definition).

SettingDefinitionError for an invalid key, policy name or default.


validateSetting<T>(definition, value): Result<T, string>

Defined in: app/src/domain/settings/setting.ts:89

Validates a value against a setting’s schema.

T

SettingDefinition<T>

The setting.

unknown

Any value, for example from a file or a policy.

Result<T, string>

The parsed value, or the first validation message as the error.