/************************************************************************* * 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 type { SubOrg } from './appcontext'; export type { SubOrg } from './appcontext'; export interface SelectedSubOrg { /** * The sub-org that's currently selected. */ selectedSubOrg?: SubOrg; } /** * Defines the attributes of the configuration for sub-orgs. */ export type SubOrgs = SelectedSubOrg & Record; /** * APIs that let solutions interact with Org Switcher menu. */ export interface OrgSwitcherApi { /** * Configuration to add sub-orgs (nested under their parent org) to the org switcher. In this * object, the key is the parent org that the sub orgs in the array are associated with. * * ***Example:*** * * ```typescript * orgswitcher.subOrgs: { * 'OrgId1': [ * {id: '123', name: 'Sub Org 1'}, * {id: '321', name:'Sub Org 2'} * ], * 'OrgId2': [ * {id: '124', name: 'Sub Org 3'}, * {id: '412', name:'Sub Org 4'} * ], * selectedSubOrg: {id: '123', name: 'Sub Org 1'} * }; * ``` * * Options: * * subOrgs: Object mapping parent org ids to an array of its sub orgs with a special key for * specifying the currently selected sub org. * * id: The unique id of the sub org. * * name: The name of the sub org that will be displayed in the org switcher. * * selectedSubOrg: The current selected sub org. This goes inside of the subOrgs object as a * special key. */ subOrgs: SubOrgs; } declare const orgSwitcher: OrgSwitcherApi; export default orgSwitcher;