ag-charts-community
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
26 lines (25 loc) • 1.43 kB
TypeScript
import type { DynamicContext } from 'ag-charts-core';
import type { AgContextMenuItemLiteral, AgContextMenuItemShowOn } from 'ag-charts-types';
import type { ContextMenuEvent } from '../../core/eventsHub';
import type { ChartRegistry } from '../../module/moduleContext';
import type { MouseWidgetEvent } from '../../widget/widgetEvents';
import type { ContextMenuCallback, ContextShowOnMap } from './contextMenuTypes';
import { ContextMenuBuiltins } from './contextMenuTypes';
export declare class ContextMenuRegistry {
private readonly ctx;
readonly builtins: ContextMenuBuiltins;
private readonly hiddenActions;
constructor(ctx: DynamicContext<ChartRegistry>);
static check<T extends AgContextMenuItemShowOn>(showOn: T, event: ContextMenuEvent): event is ContextMenuEvent<T>;
static checkCallback<T extends AgContextMenuItemShowOn>(desiredShowOn: T, showOn: AgContextMenuItemShowOn, _callback: ContextMenuCallback<AgContextMenuItemShowOn>): _callback is ContextMenuCallback<T>;
dispatchContext<T extends AgContextMenuItemShowOn>(showOn: T, pointerEvent: {
widgetEvent: MouseWidgetEvent<'contextmenu'>;
canvasX: number;
canvasY: number;
}, context: ContextShowOnMap[T]['context'], position?: {
x: number;
y: number;
}): void;
isVisible(id: AgContextMenuItemLiteral): boolean;
toggle(id: AgContextMenuItemLiteral, action?: 'show' | 'hide'): void;
}