ElectronSystemPreferences.once method
ElectronSystemPreferences › once
Unofficial
Registers a one-time listener for theaccent-color-changed event. The listener is removed after it is invoked once. Signature:
once(event: "accent-color-changed", listener: (event: ElectronEvent, newColor: string) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "accent-color-changed" | The event name. |
| listener | (event: ElectronEvent, newColor: string) => void | The event handler. |
Returns: this — This ElectronSystemPreferences instance.
Unofficial
Registers a one-time listener for thecolor-changed event. The listener is removed after it is invoked once. Signature:
once(event: "color-changed", listener: (event: ElectronEvent) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "color-changed" | The event name. |
| listener | (event: ElectronEvent) => void | The event handler. |
Returns: this — This ElectronSystemPreferences instance.
Unofficial
Registers a one-time listener for thehigh-contrast-color-scheme-changed event. The listener is removed after it is invoked once. Signature:
once(event: "high-contrast-color-scheme-changed", listener: (event: ElectronEvent, highContrastColorScheme: boolean) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "high-contrast-color-scheme-changed" | The event name. |
| listener | (event: ElectronEvent, highContrastColorScheme: boolean) => void | The event handler. |
Returns: this — This ElectronSystemPreferences instance.
Unofficial
Registers a one-time listener for theinverted-color-scheme-changed event. The listener is removed after it is invoked once. Signature:
once(event: "inverted-color-scheme-changed", listener: (event: ElectronEvent, invertedColorScheme: boolean) => void): thisParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "inverted-color-scheme-changed" | The event name. |
| listener | (event: ElectronEvent, invertedColorScheme: boolean) => void | The event handler. |
Returns: this — This ElectronSystemPreferences instance.