/************************************************************************* * Copyright 2020 Adobe * All Rights Reserved. * * NOTICE: Adobe permits you to use, modify, and distribute this file in * accordance with the terms of the Adobe license agreement accompanying * it. If you have received this file from a source other than Adobe, * then your use, modification, or distribution of it requires the prior * written permission of Adobe. **************************************************************************/ import { SettingsLevel } from './settings/SettingsLevel'; /** * A map of settings in the settings service. */ export interface Settings { [key: string]: any; } /** * The response from the settings service. */ export interface SettingsResponse { /** * The map of settings being worked upon. */ settings: T; } /** * The input parameters for the settings API. */ export interface Parameters { /** * A unique identifier. */ groupId: string; /** * A map of the settings key-value pairs. In case of `set` API, the value is saved and for the * `get` API, the value is the fallback in case the key isn't present in the settings store. */ settings: T; /** * The type of store to get/set the settings from/to. Defaults to `SettingsLevel.USERORG`. */ level?: SettingsLevel; /** * The appID to fetch settings under, otherwise uses current appID */ appId?: string; } /** * APIs to get or set settings, preferences or configuration data that can be stored and retrieved * at an IMS user and/or an IMS org level. An app in unified shell can consume Settings service. */ export interface SettingsApi { /** * Gets settings based on the specified parameters such as groupId * and settings - keys with default values to fallback. * @param params Parameters used to identify settings to retrieve. * @returns A promise for the specified settings. */ get(params: Parameters): Promise>; /** * Creates or updates settings based on the specified parameters such as groupId and settings * key-value pairs. * @param params Parameters to identify the settings to create or update. * @returns A promise for the operation response. */ set(params: Parameters): Promise>; } declare const settings: SettingsApi; export { SettingsLevel }; export default settings;