/** * @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 {EventEmitter, TemplateRef, InjectionToken} from '@angular/core'; import {MenuPositionX, MenuPositionY} from './menu-positions'; import {Direction} from '@angular/cdk/bidi'; import {FocusOrigin} from '@angular/cdk/a11y'; import {MatMenuContent} from './menu-content'; /** * Injection token used to provide the parent menu to menu-specific components. * @docs-private */ export const MAT_MENU_PANEL = new InjectionToken('MAT_MENU_PANEL'); /** * Interface for a custom menu panel that can be used with `matMenuTriggerFor`. * @docs-private */ export interface MatMenuPanel { xPosition: MenuPositionX; yPosition: MenuPositionY; overlapTrigger: boolean; templateRef: TemplateRef; close: EventEmitter; parentMenu?: MatMenuPanel | undefined; direction?: Direction; focusFirstItem: (origin?: FocusOrigin) => void; resetActiveItem: () => void; setPositionClasses?: (x: MenuPositionX, y: MenuPositionY) => void; setElevation?(depth: number): void; lazyContent?: MatMenuContent; backdropClass?: string; hasBackdrop?: boolean; /** * @deprecated To be removed. * @breaking-change 8.0.0 */ addItem?: (item: T) => void; /** * @deprecated To be removed. * @breaking-change 8.0.0 */ removeItem?: (item: T) => void; }