react-universal-interface
Version:
Universal Children Definition for React Components
56 lines (55 loc) • 2.92 kB
TypeScript
import * as React from 'react';
declare const wrapInStatefulComponent: (Comp: any) => {
new (props: Readonly<any>): {
render(): any;
context: any;
setState<K extends string | number | symbol>(state: any, callback?: () => void): void;
forceUpdate(callback?: () => void): void;
readonly props: Readonly<any> & Readonly<{
children?: React.ReactNode;
}>;
state: Readonly<any>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
};
new (props: any, context?: any): {
render(): any;
context: any;
setState<K extends string | number | symbol>(state: any, callback?: () => void): void;
forceUpdate(callback?: () => void): void;
readonly props: Readonly<any> & Readonly<{
children?: React.ReactNode;
}>;
state: Readonly<any>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any;
componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void;
};
contextType?: React.Context<any>;
};
export default wrapInStatefulComponent;