@itwin/core-react
Version:
A react component library of iTwin.js UI general purpose components
70 lines • 4.21 kB
TypeScript
/** @packageDocumentation
* @module Common
*/
import * as React from "react";
import { Timer } from "../utils/Timer.js";
/** Properties for [[withTimeout]] React higher-order component
* @public
* @deprecated in 4.15.0. Props of deprecated {@link withTimeout} HOC.
*/
export interface WithTimeoutProps {
/** Timeout duration in milliseconds */
timeout: number;
/** Callback function for timeout */
onTimeout?: () => void;
}
/** withTimeout is a React higher-order component that adds timeout support.
* @public
* @deprecated in 4.15.0. Not used by AppUI.
*/
export declare const withTimeout: <ComponentProps extends object>(Component: React.ComponentType<ComponentProps>) => {
new (props: ComponentProps & WithTimeoutProps): {
timer: Timer;
componentDidMount(): void;
/** @internal */
componentDidUpdate(_prevProps: Readonly<ComponentProps & WithTimeoutProps>): void;
componentWillUnmount(): void;
render(): React.JSX.Element;
startTimer(timeout: number): void;
context: unknown;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps & WithTimeoutProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<ComponentProps & WithTimeoutProps>;
state: Readonly<{}>;
shouldComponentUpdate?(nextProps: Readonly<ComponentProps & WithTimeoutProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<ComponentProps & WithTimeoutProps>, prevState: Readonly<{}>): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<ComponentProps & WithTimeoutProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<ComponentProps & WithTimeoutProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<ComponentProps & WithTimeoutProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps & WithTimeoutProps>, nextState: Readonly<{}>, nextContext: any): void;
};
new (props: ComponentProps & WithTimeoutProps, context: any): {
timer: Timer;
componentDidMount(): void;
/** @internal */
componentDidUpdate(_prevProps: Readonly<ComponentProps & WithTimeoutProps>): void;
componentWillUnmount(): void;
render(): React.JSX.Element;
startTimer(timeout: number): void;
context: unknown;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps & WithTimeoutProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly<ComponentProps & WithTimeoutProps>;
state: Readonly<{}>;
shouldComponentUpdate?(nextProps: Readonly<ComponentProps & WithTimeoutProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<ComponentProps & WithTimeoutProps>, prevState: Readonly<{}>): any;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<ComponentProps & WithTimeoutProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<ComponentProps & WithTimeoutProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<ComponentProps & WithTimeoutProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps & WithTimeoutProps>, nextState: Readonly<{}>, nextContext: any): void;
};
contextType?: React.Context<any> | undefined;
propTypes?: any;
};
//# sourceMappingURL=withTimeout.d.ts.map