d.ts contextMenu support fromMenu

Type definitions for jQuery contextMenu support fromMenu

在原本的版本裡並沒有”fromMenu”的定義,已修正D.TS文件,如下。

新增介面JQueryContextMenuStatic ,並將舊的方法註解。

// Type definitions for jQuery contextMenu 1.7.0+
 // Project: http://medialize.github.com/jQuery-contextMenu/
 // Definitions by: Natan Vivo <https://github.com/nvivo/>
 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

///

interface JQueryContextMenuOptions {
 selector: string;
 appendTo?: string;
 trigger?: string;
 autoHide?: boolean;
 delay?: number;
 determinePosition?: (menu: JQuery) => void;
 position?: (opt: JQuery, x: number, y: number) => void;
 positionSubmenu?: (menu: JQuery) => void;
 zIndex?: number;
 animation?: {
 duration?: number;
 show?: string;
 hide?: string;
 };
 events?: {
 show?: () => void;
 hide?: () => void;
 };
 callback?: (key: any, options: any) => any;
 items?: any;
 build?: (triggerElement: JQuery, e: Event) => any;
 reposition?: boolean;
 className?: string;
 itemClickEvent?: string;
 }

interface JQueryContextMenuStatic {
 (options?: JQueryContextMenuOptions): JQuery;
 (type: string, selector?: any): JQuery;
 fromMenu?: any;
 }

interface JQueryStatic {
 //contextMenu(options?: JQueryContextMenuOptions): JQuery;
 //contextMenu(type: string, selector?: any): JQuery;
 contextMenu?: JQueryContextMenuStatic;
 }

interface JQuery {
 //contextMenu(options?: any): JQuery;
 contextMenu?: JQueryContextMenuStatic;
 }

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *