SystemPreferences

external interface SystemPreferences : <ERROR CLASS> ERROR CLASS: Symbol not found for node.events.EventEmitter(source)

Properties

Link copied to clipboard
abstract val accentColorChangedEvent: ERROR CLASS: Symbol not found for node.events.EventInstance<ERROR CLASS: Symbol not found for js.array.Tuple2<electron/core/Event<*>, kotlin/String>>

A boolean property which determines whether the app avoids using semitransparent backgrounds. This maps to NSWorkspace.accessibilityDisplayShouldReduceTransparency

Link copied to clipboard
abstract val colorChangedEvent: ERROR CLASS: Symbol not found for node.events.EventInstance<ERROR CLASS: Symbol not found for js.array.Tuple1<electron/core/Event<*>>>
Link copied to clipboard

A string property that can be dark, light or unknown.

Functions

Link copied to clipboard
abstract fun askForMediaAccess(mediaType: SystemPreferencesAskForMediaAccessMediaType): ERROR CLASS: Symbol not found for Promise<kotlin/Boolean>

A promise that resolves with true if consent was granted and false if it was denied. If an invalid mediaType is passed, the promise will be rejected. If an access request was denied and later is changed through the System Preferences pane, a restart of the app will be required for the new permissions to take effect. If access has already been requested and denied, it must be changed through the preference pane; an alert will not pop up and the promise will resolve with the existing access status.

Link copied to clipboard
abstract fun canPromptTouchID(): Boolean

whether or not this device has the ability to use Touch ID.

Link copied to clipboard
abstract fun getAccentColor(): String

The users current system wide accent color preference in RGBA hexadecimal form.

Link copied to clipboard

Returns an object with system animation settings.

Link copied to clipboard

The system color setting in RGBA hexadecimal form (#RRGGBBAA). See the Windows docs and the macOS docs for more details.

Link copied to clipboard

Can be dark, light or unknown.

Link copied to clipboard

Can be not-determined, granted, denied, restricted or unknown.

Link copied to clipboard

The standard system color formatted as #RRGGBBAA.

Link copied to clipboard
abstract fun getUserDefault(key: String, type: String): Any?

The value of key in NSUserDefaults.

Link copied to clipboard
abstract fun isAeroGlassEnabled(): Boolean

true if DWM composition (Aero Glass) is enabled, and false otherwise.

Link copied to clipboard

Whether the Swipe between pages setting is on.

Link copied to clipboard

true if the current process is a trusted accessibility client and false if it is not.

Link copied to clipboard
abstract fun postLocalNotification(event: String, userInfo: ERROR CLASS: Symbol not found for js.objects.ReadonlyRecord<kotlin/String, kotlin/Any?>)

Posts event as native notifications of macOS. The userInfo is an Object that contains the user information dictionary sent along with the notification.

Link copied to clipboard
abstract fun postNotification(event: String, userInfo: ERROR CLASS: Symbol not found for js.objects.ReadonlyRecord<kotlin/String, kotlin/Any?>, deliverImmediately: Boolean = definedExternally)

Posts event as native notifications of macOS. The userInfo is an Object that contains the user information dictionary sent along with the notification.

Link copied to clipboard
abstract fun postWorkspaceNotification(event: String, userInfo: ERROR CLASS: Symbol not found for js.objects.ReadonlyRecord<kotlin/String, kotlin/Any?>)

Posts event as native notifications of macOS. The userInfo is an Object that contains the user information dictionary sent along with the notification.

Link copied to clipboard
abstract fun promptTouchID(reason: String): ERROR CLASS: Symbol not found for Promise<ERROR CLASS: Symbol not found for js.core.Void>

resolves if the user has successfully authenticated with Touch ID.

Link copied to clipboard
abstract fun registerDefaults(defaults: ERROR CLASS: Symbol not found for js.objects.ReadonlyRecord<kotlin/String, kotlin/Any>)

Add the specified defaults to your application's NSUserDefaults.

Link copied to clipboard
abstract fun removeUserDefault(key: String)

Removes the key in NSUserDefaults. This can be used to restore the default or global value of a key previously set with setUserDefault.

Link copied to clipboard
abstract fun setUserDefault(key: String, type: String, value: Any?)

Set the value of key in NSUserDefaults.

Link copied to clipboard
abstract fun subscribeLocalNotification(event: String?, callback: (event: String, @R|kotlin/ParameterName|(name = String(userInfo)) ERROR CLASS: Symbol not found for js.objects.ReadonlyRecord<kotlin/String, kotlin/Any?>, object: String) -> Unit): Double

The ID of this subscription

Link copied to clipboard
abstract fun subscribeNotification(event: String?, callback: (event: String, @R|kotlin/ParameterName|(name = String(userInfo)) ERROR CLASS: Symbol not found for js.objects.ReadonlyRecord<kotlin/String, kotlin/Any?>, object: String) -> Unit): Double

The ID of this subscription

Link copied to clipboard
abstract fun subscribeWorkspaceNotification(event: String?, callback: (event: String, @R|kotlin/ParameterName|(name = String(userInfo)) ERROR CLASS: Symbol not found for js.objects.ReadonlyRecord<kotlin/String, kotlin/Any?>, object: String) -> Unit): Double

The ID of this subscription

Link copied to clipboard

Same as unsubscribeNotification, but removes the subscriber from NSNotificationCenter.

Link copied to clipboard

Removes the subscriber with id.

Link copied to clipboard

Same as unsubscribeNotification, but removes the subscriber from NSWorkspace.sharedWorkspace.notificationCenter.