Skip to content

Commit d4b77aa

Browse files
R4VANG3Rvkbansal
authored andcommitted
Now exporting prop interfaces for extending (#306)
* Now exporting prop interfaces for extending * Moved to module * Flattened exports
1 parent 1390a2f commit d4b77aa

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

src/index.d.ts

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
declare module "react-contextmenu" {
22
import * as React from "react";
33

4-
interface ContextMenuProps {
4+
export interface ContextMenuProps {
55
id: string,
66
data?: any,
77
className?: string,
@@ -12,7 +12,7 @@ declare module "react-contextmenu" {
1212
onShow?: {(event: any): void},
1313
}
1414

15-
interface ContextMenuTriggerProps {
15+
export interface ContextMenuTriggerProps {
1616
id: string,
1717
attributes?: React.HTMLAttributes<any>,
1818
collect?: {(data: any): any},
@@ -23,7 +23,7 @@ declare module "react-contextmenu" {
2323
disableIfShiftIsPressed?: boolean,
2424
}
2525

26-
interface MenuItemProps {
26+
export interface MenuItemProps {
2727
attributes?: React.HTMLAttributes<HTMLDivElement>,
2828
className?: string;
2929
data?: Object,
@@ -33,7 +33,7 @@ declare module "react-contextmenu" {
3333
onClick?: {(event: React.TouchEvent<HTMLDivElement> | React.MouseEvent<HTMLDivElement>, data: Object, target: HTMLElement): void} | Function,
3434
}
3535

36-
interface SubMenuProps {
36+
export interface SubMenuProps {
3737
title: React.ReactElement<any> | React.ReactText,
3838
className?: string,
3939
disabled?: boolean,
@@ -43,24 +43,16 @@ declare module "react-contextmenu" {
4343
onClick?: {(event: React.TouchEvent<HTMLDivElement> | React.MouseEvent<HTMLDivElement>, data: Object, target: HTMLElement): void} | Function,
4444
}
4545

46-
module ReactContextmenu {
47-
export const ContextMenu: React.ComponentClass<ContextMenuProps>;
48-
export const ContextMenuTrigger: React.ComponentClass<ContextMenuTriggerProps>;
49-
export const MenuItem: React.ComponentClass<MenuItemProps>;
50-
export const SubMenu: React.ComponentClass<SubMenuProps>;
51-
export function connectMenu(menuId: string): (menu: any) => any;
52-
export function showMenu(opts?: any, target?: HTMLElement): void;
53-
export function hideMenu(opts?: any, target?: HTMLElement): void;
54-
}
55-
56-
export = ReactContextmenu;
46+
export const ContextMenu: React.ComponentClass<ContextMenuProps>;
47+
export const ContextMenuTrigger: React.ComponentClass<ContextMenuTriggerProps>;
48+
export const MenuItem: React.ComponentClass<MenuItemProps>;
49+
export const SubMenu: React.ComponentClass<SubMenuProps>;
50+
export function connectMenu(menuId: string): (menu: any) => any;
51+
export function showMenu(opts?: any, target?: HTMLElement): void;
52+
export function hideMenu(opts?: any, target?: HTMLElement): void;
5753
}
5854

5955
declare module "react-contextmenu/modules/actions" {
60-
module ReactContextmenuActions {
61-
export function showMenu(opts?: any, target?: HTMLElement): void;
62-
export function hideMenu(opts?: any, target?: HTMLElement): void;
63-
}
64-
65-
export = ReactContextmenuActions;
56+
export function showMenu(opts?: any, target?: HTMLElement): void;
57+
export function hideMenu(opts?: any, target?: HTMLElement): void;
6658
}

0 commit comments

Comments
 (0)