ui/ui-kit/settings-client
Classes
Section titled “Classes”SettingsClient
Section titled “SettingsClient”Defined in: app/src/ui/ui-kit/settings-client.ts:58
The settings of an internal page: loads them, follows every change, wherever it comes from, and writes new values, which the browser process validates.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SettingsClient(
bridge,onChange):SettingsClient
Defined in: app/src/ui/ui-kit/settings-client.ts:69
Parameters
Section titled “Parameters”bridge
Section titled “bridge”The page bridge; the page needs the channels of the settings page.
onChange
Section titled “onChange”() => void
Called after values were loaded or changed.
Returns
Section titled “Returns”Accessors
Section titled “Accessors”accents
Section titled “accents”Get Signature
Section titled “Get Signature”get accents(): readonly
AccentSwatch[]
Defined in: app/src/ui/ui-kit/settings-client.ts:78
The accent presets with their colors.
Returns
Section titled “Returns”readonly AccentSwatch[]
Methods
Section titled “Methods”dispose()
Section titled “dispose()”dispose():
void
Defined in: app/src/ui/ui-kit/settings-client.ts:109
Stops following changes.
Returns
Section titled “Returns”void
get(
key):SettingView|undefined
Defined in: app/src/ui/ui-kit/settings-client.ts:93
A setting, once loaded.
Parameters
Section titled “Parameters”string
Its key, such as appearance.accent.
Returns
Section titled “Returns”SettingView | undefined
load()
Section titled “load()”load():
Promise<void>
Defined in: app/src/ui/ui-kit/settings-client.ts:83
Loads every setting that the settings page shows.
Returns
Section titled “Returns”Promise<void>
set(
key,value):Promise<boolean>
Defined in: app/src/ui/ui-kit/settings-client.ts:103
Writes a setting.
Parameters
Section titled “Parameters”string
Its key.
unknown
The new value.
Returns
Section titled “Returns”Promise<boolean>
Whether the browser accepted the value.
Interfaces
Section titled “Interfaces”AccentSwatch
Section titled “AccentSwatch”Defined in: app/src/ui/ui-kit/settings-client.ts:16
An accent preset with its color in each mode.
Properties
Section titled “Properties”
readonlydark:string
Defined in: app/src/ui/ui-kit/settings-client.ts:19
readonlyid:string
Defined in: app/src/ui/ui-kit/settings-client.ts:17
readonlylight:string
Defined in: app/src/ui/ui-kit/settings-client.ts:18
PageBridge
Section titled “PageBridge”Defined in: app/src/ui/ui-kit/settings-client.ts:23
The part of the page bridge that settings need.
Methods
Section titled “Methods”invoke()
Section titled “invoke()”invoke(
channel,payload):Promise<unknown>
Defined in: app/src/ui/ui-kit/settings-client.ts:25
Calls a request channel of the page’s scopes.
Parameters
Section titled “Parameters”channel
Section titled “channel”string
payload
Section titled “payload”unknown
Returns
Section titled “Returns”Promise<unknown>
on(
channel,listener): () =>void
Defined in: app/src/ui/ui-kit/settings-client.ts:27
Listens to an event channel of the page’s scopes; returns a function that stops.
Parameters
Section titled “Parameters”channel
Section titled “channel”string
listener
Section titled “listener”(payload) => void
Returns
Section titled “Returns”() => void
SettingView
Section titled “SettingView”Defined in: app/src/ui/ui-kit/settings-client.ts:2
A setting as the browser process reports it.
Properties
Section titled “Properties”changed?
Section titled “changed?”
readonlyoptionalchanged?:boolean
Defined in: app/src/ui/ui-kit/settings-client.ts:8
Whether the user set a value other than the default.
readonlykey:string
Defined in: app/src/ui/ui-kit/settings-client.ts:3
locked
Section titled “locked”
readonlylocked:boolean
Defined in: app/src/ui/ui-kit/settings-client.ts:6
Whether a mandatory policy sets the value.
recommended?
Section titled “recommended?”
readonlyoptionalrecommended?:boolean
Defined in: app/src/ui/ui-kit/settings-client.ts:10
Whether the value is the one that a recommended policy suggests.
restart?
Section titled “restart?”
readonlyoptionalrestart?:boolean
Defined in: app/src/ui/ui-kit/settings-client.ts:12
Whether the value differs from the one the browser started with, until a restart.
readonlyvalue:unknown
Defined in: app/src/ui/ui-kit/settings-client.ts:4
Functions
Section titled “Functions”paintSwatches()
Section titled “paintSwatches()”paintSwatches(
root,accents):void
Defined in: app/src/ui/ui-kit/settings-client.ts:127
Paints the accent swatches of a page. Colors go through the CSS object model, because the pages’ content security policy forbids style attributes.
Parameters
Section titled “Parameters”ParentNode
The page’s render root.
accents
Section titled “accents”readonly AccentSwatch[]
The swatches.
Returns
Section titled “Returns”void