2019-04-17 13:51:52 +08:00
|
|
|
import * as React from 'react';
|
2019-04-22 15:47:07 +08:00
|
|
|
import * as hoistNonReactStatics from 'hoist-non-react-statics';
|
2019-04-17 13:51:52 +08:00
|
|
|
import { Omit } from '../_util/type';
|
|
|
|
import { FormComponentProps } from './Form';
|
|
|
|
|
|
|
|
// Copy from @types/react-redux https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-redux/index.d.ts
|
|
|
|
export type ConnectedComponentClass<
|
|
|
|
C extends React.ComponentType<any>,
|
|
|
|
P
|
|
|
|
> = React.ComponentClass<JSX.LibraryManagedAttributes<C, P>> & hoistNonReactStatics.NonReactStatics<C> & {
|
|
|
|
WrappedComponent: C;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type FormWrappedProps<TOwnProps extends FormComponentProps> =
|
|
|
|
<
|
|
|
|
C extends React.ComponentType
|
|
|
|
>(component: C)
|
|
|
|
=> ConnectedComponentClass<C, Omit<TOwnProps, keyof FormComponentProps>>;
|