/************************************************************************* * 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. **************************************************************************/ export interface NavItem { /** * Whether the path is absolute or relative to the base path. */ absolutePath?: boolean; /** * Nested children Sidebar nav items */ children?: NavItem[]; /** * Whether or not to expand children by default. */ defaultExpanded?: boolean; /** * Whether or not to disable the nav item. */ disabled?: boolean; /** * ID of the Sidebar nav item. */ id: string; /** * The label and display name of the Sidebar nav item. */ name: string; /** * Where to open external URL e.g., '_self' or '_blank' for same tab or new tab. */ target: string; /** * A string url the user is taken to when this item is clicked. */ url?: string; } export interface NavSettings { /** * ID of the Sidebar nav. * */ id: string; /** * Whether or not to enable type to select. */ typeToSelect?: boolean; /** * Type and style of Sidebar nav. */ variant?: 'default' | 'multiLevel'; } export interface NavConfig { /** * List of nav item objects. */ menu: NavItem[]; /** * Extra Sidebar nav options and configurations. */ settings?: NavSettings; } /** * @deprecated APIs that let solutions interact with Sidebar nav. * This is now deprecated in favor of the sidenav api. * Remove this once all solutions have been transitioned to sidenav. */ export interface SidebarApi { /** * Configuration to add headings, items, and other settings to the Sidebar nav. * * ***Example:*** * * ```typescript * sidebar.config = { * menu: [ * {absolutePath: true, id: 'home', name: 'Home', url: '/home'}, * {id: 'example', name: 'Example', url: '/'}, * {id: 'journeys', name: 'Journeys', url: '/journeys'}, * { * heading: 'STORAGE', * items: [ * {id: 'external', name: 'External', target: '_blank', url: 'https://adobe.com'} * ] * }, * { * heading: 'DOCUMENTS', * items: [ * {children: [{id: 'child1', name: 'Child 1'}, {id: 'child2', name: 'Child 2'}], id: '2', name: 'Item 2'} * ] * } * ], * settings: { * typeToSelect: true, * variant: 'multiLevel' * } * }; * ``` * * Options: * * menu: List of nav items and headers and their nested (children) nav items to add to the Sidebar nav. There are two types: * * Heading Nav Item * * heading: The heading name. This string needs to be translated using the locale shell provides. * * items: The list of nav items that belong under the heading. Each nav items should have the below properties * * Regular Nav Item * * id: Unique id and value of the nav item. * * name: The nav item's label and display name. This string needs to be translated using the locale shell provides. * * children: (optional) List of children nav item objects nested under the current nav item. * * defaultExpanded: (optional) Whether or not this item's children are expanded and shown by default. * * disabled: (optional) Whether or not this item is disabled. * * target: (optional) Where to open external URL e.g., '_self' or '_blank' for same tab or new tab. * * url: A string url the user is taken to when this item is clicked. * * absolutePath: Whether the path is absolute or relative to the base path. * * settings: Optional object of additional settings for the Sidebar nav. * * id: Unique id and value of the sidebar nav. * * typeToSelect: Whether to enable typing to select an item. * * variant: Can be one of two values: default or multiLevel. If there is nested children, use multiLevel. */ config: NavConfig; /** * Whether the Sidebar nav should start out as collapsed or not. * * ***Example:*** * * ```typescript * sidebar.collapsed = true; * ``` */ collapsed: boolean; /** * Whether the Sidebar nav should currently be visible or not. * * ***Example:*** * * ```typescript * sidebar.visible = false; * ``` */ visible: boolean; } declare const sidebar: SidebarApi; export default sidebar;