/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { BaseHarnessFilters, ComponentHarness, ComponentHarnessConstructor, ContentContainerComponentHarness, HarnessLoader, HarnessPredicate } from '@angular/cdk/testing'; import { MenuHarnessFilters, MenuItemHarnessFilters } from './menu-harness-filters'; export declare abstract class _MatMenuHarnessBase & { with: (options?: ItemFilters) => HarnessPredicate; }), Item extends ComponentHarness & { click(): Promise; getSubmenu(): Promise<_MatMenuHarnessBase | null>; }, ItemFilters extends BaseHarnessFilters> extends ContentContainerComponentHarness { private _documentRootLocator; protected abstract _itemClass: ItemType; /** Whether the menu is disabled. */ isDisabled(): Promise; /** Whether the menu is open. */ isOpen(): Promise; /** Gets the text of the menu's trigger element. */ getTriggerText(): Promise; /** Focuses the menu. */ focus(): Promise; /** Blurs the menu. */ blur(): Promise; /** Whether the menu is focused. */ isFocused(): Promise; /** Opens the menu. */ open(): Promise; /** Closes the menu. */ close(): Promise; /** * Gets a list of `MatMenuItemHarness` representing the items in the menu. * @param filters Optionally filters which menu items are included. */ getItems(filters?: Omit): Promise; /** * Clicks an item in the menu, and optionally continues clicking items in subsequent sub-menus. * @param itemFilter A filter used to represent which item in the menu should be clicked. The * first matching menu item will be clicked. * @param subItemFilters A list of filters representing the items to click in any subsequent * sub-menus. The first item in the sub-menu matching the corresponding filter in * `subItemFilters` will be clicked. */ clickItem(itemFilter: Omit, ...subItemFilters: Omit[]): Promise; protected getRootHarnessLoader(): Promise; /** Gets the menu panel associated with this menu. */ private _getMenuPanel; /** Gets the id of the menu panel associated with this menu. */ private _getPanelId; } export declare abstract class _MatMenuItemHarnessBase, Menu extends ComponentHarness> extends ContentContainerComponentHarness { protected abstract _menuClass: MenuType; /** Whether the menu is disabled. */ isDisabled(): Promise; /** Gets the text of the menu item. */ getText(): Promise; /** Focuses the menu item. */ focus(): Promise; /** Blurs the menu item. */ blur(): Promise; /** Whether the menu item is focused. */ isFocused(): Promise; /** Clicks the menu item. */ click(): Promise; /** Whether this item has a submenu. */ hasSubmenu(): Promise; /** Gets the submenu associated with this menu item, or null if none. */ getSubmenu(): Promise; } /** Harness for interacting with a standard mat-menu in tests. */ export declare class MatMenuHarness extends _MatMenuHarnessBase { /** The selector for the host element of a `MatMenu` instance. */ static hostSelector: string; protected _itemClass: typeof MatMenuItemHarness; /** * Gets a `HarnessPredicate` that can be used to search for a `MatMenuHarness` that meets certain * criteria. * @param options Options for filtering which menu instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with(options?: MenuHarnessFilters): HarnessPredicate; } /** Harness for interacting with a standard mat-menu-item in tests. */ export declare class MatMenuItemHarness extends _MatMenuItemHarnessBase { /** The selector for the host element of a `MatMenuItem` instance. */ static hostSelector: string; protected _menuClass: typeof MatMenuHarness; /** * Gets a `HarnessPredicate` that can be used to search for a `MatMenuItemHarness` that meets * certain criteria. * @param options Options for filtering which menu item instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with(options?: MenuItemHarnessFilters): HarnessPredicate; }