1 | import type * as React from 'react';
|
2 | import type { Omit } from '../_util/types';
|
3 | import type { WrappedFormInternalProps } from './Form';
|
4 | interface REACT_STATICS {
|
5 | childContextTypes: true;
|
6 | contextType: true;
|
7 | contextTypes: true;
|
8 | defaultProps: true;
|
9 | displayName: true;
|
10 | getDefaultProps: true;
|
11 | getDerivedStateFromError: true;
|
12 | getDerivedStateFromProps: true;
|
13 | mixins: true;
|
14 | propTypes: true;
|
15 | type: true;
|
16 | }
|
17 | interface KNOWN_STATICS {
|
18 | name: true;
|
19 | length: true;
|
20 | prototype: true;
|
21 | caller: true;
|
22 | callee: true;
|
23 | arguments: true;
|
24 | arity: true;
|
25 | }
|
26 | interface MEMO_STATICS {
|
27 | $$typeof: true;
|
28 | compare: true;
|
29 | defaultProps: true;
|
30 | displayName: true;
|
31 | propTypes: true;
|
32 | type: true;
|
33 | }
|
34 | interface FORWARD_REF_STATICS {
|
35 | $$typeof: true;
|
36 | render: true;
|
37 | defaultProps: true;
|
38 | displayName: true;
|
39 | propTypes: true;
|
40 | }
|
41 | declare type NonReactStatics<S extends React.ComponentType<any>, C extends {
|
42 | [key: string]: true;
|
43 | } = {}> = {
|
44 | [key in Exclude<keyof S, S extends React.MemoExoticComponent<any> ? keyof MEMO_STATICS | keyof C : S extends React.ForwardRefExoticComponent<any> ? keyof FORWARD_REF_STATICS | keyof C : keyof REACT_STATICS | keyof KNOWN_STATICS | keyof C>]: S[key];
|
45 | };
|
46 | export declare type Matching<InjectedProps, DecorationTargetProps> = {
|
47 | [P in keyof DecorationTargetProps]: P extends keyof InjectedProps ? InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : InjectedProps[P] : DecorationTargetProps[P];
|
48 | };
|
49 | export declare type GetProps<C> = C extends React.ComponentType<infer P> ? P : never;
|
50 | export declare type ConnectedComponentClass<C extends React.ComponentType<any>, P> = React.ComponentClass<JSX.LibraryManagedAttributes<C, P>> & NonReactStatics<C> & {
|
51 | WrappedComponent: C;
|
52 | };
|
53 | export declare type FormWrappedProps<TOwnProps extends WrappedFormInternalProps> = <C extends React.ComponentType<Matching<TOwnProps, GetProps<C>>>>(component: C) => ConnectedComponentClass<C, Omit<TOwnProps, keyof WrappedFormInternalProps>>;
|
54 | export {};
|