Skip to content

ui/ui-kit/settings-client

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.

new SettingsClient(bridge, onChange): SettingsClient

Defined in: app/src/ui/ui-kit/settings-client.ts:69

PageBridge

The page bridge; the page needs the channels of the settings page.

() => void

Called after values were loaded or changed.

SettingsClient

get accents(): readonly AccentSwatch[]

Defined in: app/src/ui/ui-kit/settings-client.ts:78

The accent presets with their colors.

readonly AccentSwatch[]

dispose(): void

Defined in: app/src/ui/ui-kit/settings-client.ts:109

Stops following changes.

void

get(key): SettingView | undefined

Defined in: app/src/ui/ui-kit/settings-client.ts:93

A setting, once loaded.

string

Its key, such as appearance.accent.

SettingView | undefined

load(): Promise<void>

Defined in: app/src/ui/ui-kit/settings-client.ts:83

Loads every setting that the settings page shows.

Promise<void>

set(key, value): Promise<boolean>

Defined in: app/src/ui/ui-kit/settings-client.ts:103

Writes a setting.

string

Its key.

unknown

The new value.

Promise<boolean>

Whether the browser accepted the value.

Defined in: app/src/ui/ui-kit/settings-client.ts:16

An accent preset with its color in each mode.

readonly dark: string

Defined in: app/src/ui/ui-kit/settings-client.ts:19

readonly id: string

Defined in: app/src/ui/ui-kit/settings-client.ts:17

readonly light: string

Defined in: app/src/ui/ui-kit/settings-client.ts:18


Defined in: app/src/ui/ui-kit/settings-client.ts:23

The part of the page bridge that settings need.

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.

string

unknown

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.

string

(payload) => void

() => void


Defined in: app/src/ui/ui-kit/settings-client.ts:2

A setting as the browser process reports it.

readonly optional changed?: boolean

Defined in: app/src/ui/ui-kit/settings-client.ts:8

Whether the user set a value other than the default.

readonly key: string

Defined in: app/src/ui/ui-kit/settings-client.ts:3

readonly locked: boolean

Defined in: app/src/ui/ui-kit/settings-client.ts:6

Whether a mandatory policy sets the value.

readonly optional recommended?: boolean

Defined in: app/src/ui/ui-kit/settings-client.ts:10

Whether the value is the one that a recommended policy suggests.

readonly optional restart?: 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.

readonly value: unknown

Defined in: app/src/ui/ui-kit/settings-client.ts:4

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.

ParentNode

The page’s render root.

readonly AccentSwatch[]

The swatches.

void