UNPKG

2.37 kBTypeScriptView Raw
1import * as React from "react";
2import { IConstructor } from "../../common/constructor";
3export interface IContextMenuTargetComponent extends React.Component {
4 render(): React.ReactElement<any> | null | undefined;
5 renderContextMenu: (e: React.MouseEvent<HTMLElement>) => JSX.Element | undefined;
6 onContextMenuClose?: () => void;
7}
8/** @deprecated use ContextMenu2 */
9export declare function ContextMenuTarget<T extends IConstructor<IContextMenuTargetComponent>>(WrappedComponent: T): {
10 new (...args: any[]): {
11 render(): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | null | undefined;
12 renderContextMenu: (e: React.MouseEvent<HTMLElement, MouseEvent>) => JSX.Element | undefined;
13 onContextMenuClose?: (() => void) | undefined;
14 context: any;
15 setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
16 forceUpdate(callback?: (() => void) | undefined): void;
17 readonly props: Readonly<{}> & Readonly<{
18 children?: React.ReactNode;
19 }>;
20 state: Readonly<{}>;
21 refs: {
22 [key: string]: React.ReactInstance;
23 };
24 componentDidMount?(): void;
25 shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
26 componentWillUnmount?(): void;
27 componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
28 getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
29 componentDidUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void;
30 componentWillMount?(): void;
31 UNSAFE_componentWillMount?(): void;
32 componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
33 UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
34 componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
35 UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
36 };
37 displayName: string;
38} & T;
39
\No newline at end of file