1 | import * as PropTypes from 'prop-types';
|
2 | import * as React from 'react';
|
3 | import { InputEventListener, InputTargetElement } from './types';
|
4 | interface EventStackProps {
|
5 |
|
6 | name: string;
|
7 |
|
8 | on: InputEventListener;
|
9 |
|
10 | pool?: string;
|
11 |
|
12 | target?: InputTargetElement;
|
13 | }
|
14 |
|
15 |
|
16 |
|
17 | export default class EventStack extends React.PureComponent<EventStackProps> {
|
18 | static propTypes: {
|
19 |
|
20 | name: PropTypes.Validator<string>;
|
21 |
|
22 | on: PropTypes.Validator<((...args: any[]) => any) | (((...args: any[]) => any) | null)[]>;
|
23 | /** A name of pool. */
|
24 | pool: PropTypes.Requireable<string>;
|
25 | /** A DOM element on which we will subscribe. */
|
26 | target: PropTypes.Requireable<Object>;
|
27 | };
|
28 | static defaultProps: {
|
29 | pool: string;
|
30 | target: string;
|
31 | };
|
32 | componentDidMount(): void;
|
33 | componentDidUpdate(prevProps: EventStackProps): void;
|
34 | componentWillUnmount(): void;
|
35 | subscribe(props: Readonly<EventStackProps>): void;
|
36 | unsubscribe(props: Readonly<EventStackProps>): void;
|
37 | render(): null;
|
38 | }
|
39 | export {};
|
40 |
|
\ | No newline at end of file |