UNPKG

1.67 kBTypeScriptView Raw
1import * as React from "react";
2/**
3 * An abstract component that Blueprint components can extend
4 * in order to add some common functionality like runtime props validation.
5 *
6 * @deprecated componentWillReceiveProps is deprecated in React 16.9; use AbstractComponent2 instead
7 */
8export declare abstract class AbstractComponent<P, S> extends React.Component<P, S> {
9 /** Component displayName should be `public static`. This property exists to prevent incorrect usage. */
10 protected displayName: never;
11 private timeoutIds;
12 constructor(props: P, context?: any);
13 componentWillReceiveProps(nextProps: P & {
14 children?: React.ReactNode;
15 }): void;
16 componentWillUnmount(): void;
17 /**
18 * Set a timeout and remember its ID.
19 * All stored timeouts will be cleared when component unmounts.
20 *
21 * @returns a "cancel" function that will clear timeout when invoked.
22 */
23 setTimeout(callback: () => void, timeout?: number): () => void;
24 /**
25 * Clear all known timeouts.
26 */
27 clearTimeouts: () => void;
28 /**
29 * Ensures that the props specified for a component are valid.
30 * Implementations should check that props are valid and usually throw an Error if they are not.
31 * Implementations should not duplicate checks that the type system already guarantees.
32 *
33 * This method should be used instead of React's
34 * [propTypes](https://facebook.github.io/react/docs/reusable-components.html#prop-validation) feature.
35 * Like propTypes, these runtime checks run only in development mode.
36 */
37 protected validateProps(_: P & {
38 children?: React.ReactNode;
39 }): void;
40}
41
\No newline at end of file