Skip to content

ElectronSystemPreferences.setUserDefault method

ElectronSystemPreferences › setUserDefault

Unofficial

Sets the value of key in NSUserDefaults. Note that type should match the actual type of value. An exception is thrown if they don't.

Signature:

setUserDefault(key: string, type: Type, value: ElectronUserDefaultTypes[Type]): void

Parameters:

Parameter Type Description
key string The NSUserDefaults key to write.
type Type The type of the value being stored.
value ElectronUserDefaultTypes[Type] The value to store.

Platform: darwin.

Returns: void