Home > @activeviam/activeui-sdk > SettingsManager
SettingsManager interface
Settings Manager
Signature:
export interface SettingsManager
Properties
Property | Type | Description |
---|---|---|
addListener | (key: SettingKey, callback: Listener<SettingValue>, callImmediately?: boolean) => RemoveListener | Listen to the value of the given setting. If callImmediately is set to true, the callback will be called immediately with the current value. |
authenticationHolder | AuthenticationHolderProxy | |
canEdit | (key: SettingKey) => boolean | Check the origin of the given setting. If it is a permissions file, then editing the setting is not allowed. In other words, return true if the setting key provided is a user setting, and false otherwise. |
contentServerInitialization | ContentServerInitialization | null | undefined | |
context | Context | |
flatBinding | SettingsMapBinding | |
get | (key: SettingKey, logIfUnexisting?: boolean) => SettingValue | Return the setting value corresponding to the given key if found, undefined otherwise. Example: settingsManager.get('component.canEdit') |
getAll | (filteringFunction: (key: SettingKey) => boolean) => SettingValue[] | Return all the setting values for which the filtering function, taking as input a setting key, has returned true. |
getAndLogIfUnexisting | (key: SettingKey) => SettingValue | Similar to get, but logs if the setting key does not exist. |
getContentServerUrl | () => string | null | undefined | |
getDefault | (key: SettingKey) => SettingValue | Return the initial default value of a setting. |
getKeysMatching | (filteringFunction: (key: SettingKey) => boolean) => SettingKey[] | Return an array of setting keys, for which the filtering function on settings keys has return true. |
getOrigins | () => SettingsOrigins | Get SettingsOrigins. |
getSettingsBinding | () => BindingWrapper | |
has | (key: SettingKey) => boolean | Return true if the setting key provided exist in the settings map, false otherwise. |
initialSettings | SettingsMap | |
isUserOwnPreference | (key: SettingKey) => boolean | |
listenTo | (contentServer: ContentServer) => ContentServerInitialization | |
onSync | () => Promise<any> | Return a promise that will be resolved when the settings are synchronized with the Content Server. If the SettingsManager doesn't listen to any Content Server, the promise will be resolved immediately. |
origins | SettingsOrigins | |
remove | (key: SettingKey) => Promise<any> | Remove the setting corresponding to the given setting key. |
set | (key: SettingKey, newValue: SettingValue) => Promise<any> | Set the value of a setting if allowed to. A setting cannot be overridden if it is defined in a permissions file. If editing is allowed, the new value will be written synchronously in the settings binding. If attached to a repository, a request will also be made to change the setting by writing into its preferences file. |
settingsRepository | SettingsRepository | null | undefined | |
writeInKey | (key: SettingKey, newValue: SettingValue) => void |