/*!
 * Copyright 2020 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { AfterViewInit, ElementRef, EventEmitter, Provider, QueryList, Renderer2, TrackByFunction } from '@angular/core';
import { ClrDropdown, ClrDropdownMenu, ClrDropdownTrigger } from '@clr/angular';
import { ActionItem, TextIcon } from '../common/interfaces';
import { CliptextConfig } from '../lib/directives';
import { DropdownFocusHandlerService } from './dropdown-focus-handler.service';
export declare const NESTED_MENU_HIDE_DELAY = 400;
export declare function dropdownFocusHandlerServiceFactory(renderer: Renderer2, existing: DropdownFocusHandlerService): DropdownFocusHandlerService;
export declare const DROPDOWN_FOCUS_HANDLER_PROVIDER: Provider;
/**
 * Component used for displaying nested drop downs
 */
export declare class DropdownComponent implements AfterViewInit {
    private parentVcdDropdown;
    private focusHandler;
    private _dropdownItemContents;
    private _items;
    /**
     * Decides what goes into the action buttons
     * @param textIcon An enum that describes the possible ways to display the button title
     */
    set dropdownItemContents(textIcon: TextIcon);
    get dropdownItemContents(): TextIcon;
    /**
     * Nested list of dropdown objects
     */
    set items(items: ActionItem<unknown, unknown>[]);
    get items(): ActionItem<unknown, unknown>[];
    dropdownMenuUpdated: EventEmitter<{
        menu: HTMLElement;
    }>;
    constructor(parentVcdDropdown: DropdownComponent, focusHandler: DropdownFocusHandlerService);
    set clrDropdownMenu(val: ClrDropdownMenu);
    private _clrDropdownMenu;
    set dropdownTriggerEl(val: ElementRef<HTMLElement>);
    _dropdownTriggerEl: HTMLElement;
    set clrDropdownMenuEl(val: ElementRef<HTMLElement>);
    _clrDropdownMenuEl: HTMLElement;
    /**
     * If a icon should be displayed inside contextual buttons
     */
    shouldShowIcon: boolean;
    /**
     * If a text should be displayed inside contextual buttons
     */
    shouldShowText: boolean;
    /**
     * If the contextual buttons with icons should have a tooltip
     */
    shouldShowTooltip: boolean;
    /**
     * Default configuration for vcdShowClippedText directive
     */
    clipTextConfig: CliptextConfig;
    /**
     * Text Content of the button that opens the root dropdown when clicked
     */
    dropdownTriggerBtnTxt: string;
    /**
     * Icon shown in the button that opens the root dropdown when clicked
     */
    dropdownTriggerBtnIcon: string;
    /**
     * The {@link ngForTrackBy} method used for rendering of a dropdown actions or for rendering nested drop downs
     * NOTE: Without this, nested drop downs don't get rendered on the screen
     */
    trackByFunction: TrackByFunction<ActionItem<unknown, unknown>>;
    /**
     * The position the root dropdown with respect to root dropdown trigger button. Refer to {@link clrPosition} for it's values
     */
    dropdownPosition: string;
    /**
     * The position of all the nested dropdowns {@link clrPosition}. Default is 'bottom-left'
     */
    nestedDropdownPosition: string;
    /**
     * Argument for {@link ActionItem.handler} and {@link ActionItem.disabled} methods. Please refer to
     * {@link ActionMenuComponent.selectedEntities}
     */
    selectedEntities: unknown[];
    /**
     * Used for displaying different button contents in the root dropdown trigger button vs nested dropdown trigger button
     */
    isNestedDropdown: boolean;
    isDropdownDisabled: boolean;
    /**
     * Css class name added to the dropdown trigger buttons
     */
    dropdownTriggerButtonClassName: string;
    /**
     * To toggle open and close states when hovered over
     */
    clrDropdown: ClrDropdown;
    /**
     * The button that opens this dropdown when clicked. Used for preventing the clarity frameworks click handler logic
     * from executing
     */
    clrDropdownTrigger: ClrDropdownTrigger;
    /**
     * List of nested dropdown children that belong to this dropdown. Used to close when a different child in this menu list is
     * hovered over
     */
    vcdDropdownChildren: QueryList<DropdownComponent>;
    private hideTimeout;
    private flattenNestedItemsWithSingleChild;
    private flattenItemsWithSingleChild;
    /**
     * Nested menus are toggled using the mouseover and mouseout events instead of mouse clicks. So the claritys
     * click handler which conflicts with that is prevented from executing
     */
    ngAfterViewInit(): void;
    /**
     * To check in the HTML, if a dropdown item of separator type should be used to add a separator item in the dropdown
     * This is required because,
     * 1. As each item decides its own availability, some groups may become empty and we collapse separators before them
     * 2. A separator is not required if it is the first item in the dropdown list
     * @param index Position of the dropdown item in the dropdown list
     * @param currentItem The current item in the list that is being iterated over
     */
    shouldRenderAsSeparator(index: number, currentItem: ActionItem<unknown, unknown>): boolean;
    /**
     * Handles the mouseover events on this dropdown's children that are of {@link #DROPDOWN_ITEM_SELECTOR} and
     * {@link #NESTED_DROPDOWN_TRIGGER_SELECTOR} type. When mouse is hovered on a child of type...
     * - DROPDOWN_ITEM_SELECTOR: Any open children of dropdown type have to be closed. This is because, user will always not mouse out of
     * a nested dropdown host(<vcd-dropdown>) to trigger the close event. He can move the mouse from nested dropdown's item to this
     * dropdown's item directly
     * - NESTED_DROPDOWN_TRIGGER_SELECTOR: Any open children of parent dropdown have to be closed and this dropdown has to be opened. We ask
     * the parent to close its children because, the mouse over events are not propagated upwards when hovered over a child of nested
     * dropdown type
     */
    onMouseOver(event: Event): void;
    /**
     * Handles the mouseout events on this dropdown's children that are of {@link #NESTED_DROPDOWN_TRIGGER_SELECTOR} type
     */
    onMouseOut(event: Event): void;
    private closeOpenVcdDropdownChildren;
    /**
     * When space or enter key is pressed on the focused dropdown menu item, it has to be clicked
     * @param event Space or Enter key press event
     */
    onDropdownItemActivated(event: Event): void;
    /**
     * When space or enter is pressed on a nested trigger, the nested menu has to be opened. So, we trigger a mouseover event which opens
     * the nested menu
     * @param event Space or Enter key press event
     */
    onDropdownTriggerActivated(event: Event): void;
    /**
     * We use [clrDisabled] instead of [disabled] to show that a dropdown item is disabled. However, it doesn't prevent the item from
     * getting activated when it is clicked. So, we make sure the action is not disabled before clicking it
     */
    onItemClicked(item: ActionItem<any, any>): void;
    /**
     * To visually disable a displayed action
     */
    isItemDisabled(item: ActionItem<any, any>): boolean;
    /**
     * When an esc key is pressed on a dropdown item, the behavior should be same as pressing left arrow key on the item. This is
     * being handled here instead of inside the {@link DropdownFocusHandlerService} because, the escape event is being absorned by
     * Claritys focus handling logic before it reaches the service.
     */
    onDropdownEscPressed(event: Event): void;
}
