UNPKG

2.93 kBTypeScriptView Raw
1/**
2 * @fileoverview This component is DEPRECATED, and the code is frozen.
3 * All changes & bugfixes should be made to HotkeysTarget2 instead.
4 */
5import * as React from "react";
6import { HotkeysProps } from "../components/hotkeys";
7import { HotkeysEvents } from "./hotkeysEvents";
8import { Constructor } from "./legacyCommon";
9export interface HotkeysTargetLegacyComponent extends React.Component {
10 /** Components decorated with the `@HotkeysTargetLegacy` decorator must implement React's component `render` function. */
11 render(): React.ReactElement<any> | null | undefined;
12 /**
13 * Components decorated with the `@HotkeysTargetLegacy` decorator must implement
14 * this method, and it must return a `Hotkeys` React element.
15 */
16 renderHotkeys: () => React.ReactElement<HotkeysProps>;
17}
18/** @deprecated use `useHotkeys` hook or `<HotkeysTarget2>` component */
19export declare function HotkeysTargetLegacy<T extends Constructor<HotkeysTargetLegacyComponent>>(WrappedComponent: T): {
20 new (...args: any[]): {
21 /** @internal */
22 globalHotkeysEvents: HotkeysEvents;
23 /** @internal */
24 localHotkeysEvents: HotkeysEvents;
25 componentDidMount(): void;
26 componentWillUnmount(): void;
27 render(): JSX.Element;
28 /**
29 * Components decorated with the `@HotkeysTargetLegacy` decorator must implement
30 * this method, and it must return a `Hotkeys` React element.
31 */
32 renderHotkeys: () => React.ReactElement<HotkeysProps, string | React.JSXElementConstructor<any>>;
33 context: any;
34 setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
35 forceUpdate(callback?: (() => void) | undefined): void;
36 readonly props: Readonly<{}> & Readonly<{
37 children?: React.ReactNode;
38 }>;
39 state: Readonly<{}>;
40 refs: {
41 [key: string]: React.ReactInstance;
42 };
43 shouldComponentUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): boolean;
44 componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
45 getSnapshotBeforeUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>): any;
46 componentDidUpdate?(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void;
47 componentWillMount?(): void;
48 UNSAFE_componentWillMount?(): void;
49 componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
50 UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{}>, nextContext: any): void;
51 componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
52 UNSAFE_componentWillUpdate?(nextProps: Readonly<{}>, nextState: Readonly<{}>, nextContext: any): void;
53 };
54 displayName: string;
55} & T;
56
\No newline at end of file