UNPKG

2.35 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/**
9 * ContextMenuTarget decorator.
10 *
11 * @see https://blueprintjs.com/docs/#core/components/context-menu.decorator-usage
12 * @deprecated use ContextMenu2
13 */
14export declare function ContextMenuTarget<T extends IConstructor<IContextMenuTargetComponent>>(WrappedComponent: T): {
15 new (...args: any[]): {
16 render(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined;
17 renderContextMenu: (e: React.MouseEvent<HTMLElement, MouseEvent>) => JSX.Element | undefined;
18 onContextMenuClose?: (() => void) | undefined;
19 context: any;
20 setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
21 forceUpdate(callback?: (() => void) | undefined): void;
22 readonly props: Readonly<{}> & Readonly<{
23 children?: React.ReactNode;
24 }>;
25 state: Readonly<{}>;
26 refs: {
27 [key: string]: React.ReactInstance;
28 };
29 componentDidMount?(): void;
30 shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
31 componentWillUnmount?(): void;
32 componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
33 getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
34 componentDidUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void;
35 componentWillMount?(): void;
36 UNSAFE_componentWillMount?(): void;
37 componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
38 UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
39 componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
40 UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
41 };
42 displayName: string;
43} & T;
44
\No newline at end of file