@perfectmemory/ngx-contextmenu
Version:
A context menu component for Angular
39 lines (38 loc) • 1.32 kB
TypeScript
import { ContextMenuComponent } from '../../components/context-menu/context-menu.component';
import { ContextMenuOverlaysService } from '../context-menu-overlays/context-menu-overlays.service';
import * as i0 from "@angular/core";
export interface ContextMenuOpenAtPositionOptions<T> {
/**
* Optional associated data to the context menu, will be emitted when a menu item is selected
*/
value?: T;
/**
* The horizontal position of the menu
*/
x: number;
/**
* The vertical position of the menu
*/
y: number;
}
/**
* Programmatically open a ContextMenuComponent to a X/Y position
*/
export declare class ContextMenuService<T> {
private contextMenuOverlaysService;
constructor(contextMenuOverlaysService: ContextMenuOverlaysService);
/**
* Show the given `ContextMenuComponent` at a specified X/Y position
*/
show(contextMenu: ContextMenuComponent<T>, options?: ContextMenuOpenAtPositionOptions<T>): void;
/**
* Close all open `ContextMenuComponent`
*/
closeAll(): void;
/**
* Return true if any `ContextMenuComponent` is open
*/
hasOpenMenu(): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<ContextMenuService<any>, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ContextMenuService<any>>;
}