/**
* DevExtreme (ui/context_menu.d.ts)
* Version: 21.1.0 (build 21016-0316)
* Build date: Sat Jan 16 2021
*
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
    positionConfig
} from '../animation/position';

import '../jquery_augmentation';

import {
    dxElement
} from '../core/element';

import DataSource, {
    DataSourceOptions
} from '../data/data_source';

import {
    event
} from '../events/index';

import dxMenuBase, {
    dxMenuBaseOptions
} from './context_menu/ui.menu_base';

import {
    dxMenuBaseItem
} from './menu';

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxContextMenuOptions extends dxMenuBaseOptions<dxContextMenu> {
    /**
     */
    closeOnOutsideClick?: boolean | ((event: event) => boolean);
    /**
     */
    dataSource?: string | Array<dxContextMenuItem> | DataSource | DataSourceOptions;
    /**
     */
    items?: Array<dxContextMenuItem>;
    /**
     */
    onHidden?: ((e: { component?: dxContextMenu, element?: dxElement, model?: any }) => any);
    /**
     */
    onHiding?: ((e: { component?: dxContextMenu, element?: dxElement, model?: any, cancel?: boolean }) => any);
    /**
     */
    onPositioning?: ((e: { component?: dxContextMenu, element?: dxElement, model?: any, event?: event, position?: positionConfig }) => any);
    /**
     */
    onShowing?: ((e: { component?: dxContextMenu, element?: dxElement, model?: any, cancel?: boolean }) => any);
    /**
     */
    onShown?: ((e: { component?: dxContextMenu, element?: dxElement, model?: any }) => any);
    /**
     */
    position?: positionConfig;
    /**
     */
    showEvent?: {
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      delay?: number,
      /**
       * Warning! This type is used for internal purposes. Do not import it directly.
       */
      name?: string
    } | string;
    /**
     */
    submenuDirection?: 'auto' | 'left' | 'right';
    /**
     */
    target?: string | Element | JQuery;
    /**
     */
    visible?: boolean;
}
/**
 */
export default class dxContextMenu extends dxMenuBase {
    constructor(element: Element, options?: dxContextMenuOptions)
    constructor(element: JQuery, options?: dxContextMenuOptions)
    /**
     */
    hide(): Promise<void> & JQueryPromise<void>;
    /**
     */
    show(): Promise<void> & JQueryPromise<void>;
    /**
     */
    toggle(showing: boolean): Promise<void> & JQueryPromise<void>;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface dxContextMenuItem extends dxMenuBaseItem {
    /**
     */
    items?: Array<dxContextMenuItem>;
}

declare global {
interface JQuery {
    dxContextMenu(): JQuery;
    dxContextMenu(options: "instance"): dxContextMenu;
    dxContextMenu(options: string): any;
    dxContextMenu(options: string, ...params: any[]): any;
    dxContextMenu(options: dxContextMenuOptions): JQuery;
}
}
/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export type Options = dxContextMenuOptions;

/** @deprecated use Options instead */
/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export type IOptions = dxContextMenuOptions;
