UNPKG

2.85 kBTypeScriptView Raw
1/**
2 * @fileoverview This component is DEPRECATED, and the code is frozen.
3 * All changes & bugfixes should be made to ContextMenu2 instead.
4 */
5import * as React from "react";
6import { type Constructor } from "./legacyCommon";
7export declare const CONTEXTMENU_WARN_DECORATOR_NO_METHOD = "[Blueprint] @ContextMenuTarget-decorated class should implement renderContextMenu.";
8export declare const CONTEXTMENU_WARN_DECORATOR_NEEDS_REACT_ELEMENT = "[Blueprint] \"@ContextMenuTarget-decorated components must return a single React.JSX.Element or an empty render.";
9export interface ContextMenuTargetLegacyComponent extends React.Component {
10 render(): React.ReactElement<any> | null | undefined;
11 renderContextMenu: (e: React.MouseEvent<HTMLElement>) => React.JSX.Element | undefined;
12 onContextMenuClose?: () => void;
13}
14/**
15 * ContextMenuTarget decorator.
16 *
17 * @see https://blueprintjs.com/docs/#core/components/context-menu.decorator-usage
18 * @deprecated use ContextMenu2
19 */
20export declare function ContextMenuTargetLegacy<T extends Constructor<ContextMenuTargetLegacyComponent>>(WrappedComponent: T): {
21 new (...args: any[]): {
22 render(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null | undefined;
23 renderContextMenu: (e: React.MouseEvent<HTMLElement, MouseEvent>) => React.JSX.Element | undefined;
24 onContextMenuClose?: (() => void) | undefined;
25 context: any;
26 setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
27 forceUpdate(callback?: (() => void) | undefined): void;
28 readonly props: Readonly<{}> & Readonly<{
29 children?: React.ReactNode;
30 }>;
31 state: Readonly<{}>;
32 refs: {
33 [key: string]: React.ReactInstance;
34 };
35 componentDidMount?(): void;
36 shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
37 componentWillUnmount?(): void;
38 componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
39 getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
40 componentDidUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void;
41 componentWillMount?(): void;
42 UNSAFE_componentWillMount?(): void;
43 componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
44 UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
45 componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
46 UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
47 };
48 displayName: string;
49} & T;
50
\No newline at end of file