UNPKG

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