Skip to content

API Reference / @gtkx/react / @gtkx/react / SettingsSchema

Type Alias: SettingsSchema<K, V> ​

SettingsSchema<K, V> = object

Defined in: packages/react/src/utils/settings.ts:30

A GSettings schema object that useSetting and useBindSetting read keys through. The modules GTKX generates from a project's .gschema.xml imports match it, and an as const object written by hand can describe a schema installed on the system, such as org.gnome.desktop.interface.

Type Parameters ​

K ​

K extends SettingsSchemaKeys = SettingsSchemaKeys

V ​

V extends SettingsSchemaValues = SettingsSchemaValues

Properties ​

id ​

id: string

Defined in: packages/react/src/utils/settings.ts:35

Schema id it is looked up by, such as org.gtkx.Example.


keys ​

keys: K

Defined in: packages/react/src/utils/settings.ts:39

Kind of every key the schema declares, which types reads and writes of that key.


path ​

path: string | null

Defined in: packages/react/src/utils/settings.ts:37

Path a relocatable schema is instantiated at, or null to use the schema's own path.


values? ​

optional values?: V

Defined in: packages/react/src/utils/settings.ts:41

Value of each nick of an enum key, or the allowed strings of a key with <choices>.