4
4
5
5
``` ts
6
6
7
- /// <reference types = " hoist-non-react-statics" />
8
7
/// <reference types = " react" />
9
8
10
9
import { Action } from ' redux' ;
@@ -15,49 +14,40 @@ import { ComponentClass } from 'react';
15
14
import { ComponentType } from ' react' ;
16
15
import { Context } from ' react' ;
17
16
import { Dispatch } from ' redux' ;
18
- import { ForwardRefExoticComponent } from ' react' ;
19
- import hoistStatics from ' hoist-non-react-statics' ;
20
- import { MemoExoticComponent } from ' react' ;
21
- import { NamedExoticComponent } from ' react' ;
22
- import { NonReactStatics } from ' hoist-non-react-statics' ;
17
+ import type { NonReactStatics } from ' hoist-non-react-statics' ;
23
18
import { default as React_2 } from ' react' ;
24
19
import { ReactNode } from ' react' ;
25
- import { RefAttributes } from ' react' ;
26
20
import { Store } from ' redux' ;
27
21
28
22
// @public (undocumented)
29
- export type AdvancedComponentDecorator <TProps , TOwnProps > = (component : ComponentType <TProps >) => NamedExoticComponent <TOwnProps >;
23
+ export type AdvancedComponentDecorator <TProps , TOwnProps > = (component : ComponentType <TProps >) => ComponentType <TOwnProps >;
30
24
31
25
// @public (undocumented)
32
26
export type AnyIfEmpty <T extends object > = keyof T extends never ? any : T ;
33
27
34
28
export { batch }
35
29
36
30
// @public (undocumented)
37
- export const connect: (mapStateToProps : MapStateToPropsParam <unknown , unknown , DefaultRootState >, mapDispatchToProps : unknown , mergeProps : MergeProps <unknown , unknown , unknown , unknown >, { pure , areStatesEqual , areOwnPropsEqual , areStatePropsEqual , areMergedPropsEqual , ... extraOptions }?: ConnectOptions <DefaultRootState , {}, {}, {}>) => <WC extends ComponentType < {}>>(WrappedComponent : WC ) => (ForwardRefExoticComponent <RefAttributes <unknown >> & {
38
- WrappedComponent: WC ;
39
- } & NonReactStatics <WC , {}>) | ((({
40
- <TOwnProps >(props : ConnectProps & TOwnProps ): JSX .Element ;
41
- displayName: string ;
42
- } | MemoExoticComponent < {
43
- <TOwnProps >(props : ConnectProps & TOwnProps ): JSX .Element ;
44
- displayName: string ;
45
- }>) & {
46
- WrappedComponent: WC ;
47
- }) & NonReactStatics <WC , {}>);
48
-
49
- // @public (undocumented)
50
- export function connectAdvanced<S , TProps , TOwnProps , TFactoryOptions extends AnyObject = {}>(selectorFactory : SelectorFactory <S , TProps , unknown , unknown >, { getDisplayName , methodName , shouldHandleStateChanges , forwardRef , context , ... connectOptions }?: ConnectAdvancedOptions & Partial <TFactoryOptions >): <WC extends React_2 .ComponentType <{}>>(WrappedComponent : WC ) => (React_2 .ForwardRefExoticComponent <React_2 .RefAttributes <unknown >> & {
51
- WrappedComponent: WC ;
52
- } & hoistStatics .NonReactStatics <WC , {}>) | ((({
53
- <TOwnProps_1 >(props : ConnectProps & TOwnProps_1 ): JSX .Element ;
54
- displayName: string ;
55
- } | React_2 .MemoExoticComponent <{
56
- <TOwnProps_1 >(props : ConnectProps & TOwnProps_1 ): JSX .Element ;
57
- displayName: string ;
58
- }>) & {
59
- WrappedComponent: WC ;
60
- }) & hoistStatics .NonReactStatics <WC , {}>);
31
+ export const connect: {
32
+ (): InferableComponentEnhancer <DispatchProp >;
33
+ <TStateProps = {}, no_dispatch = {}, TOwnProps = {}, State = DefaultRootState >(mapStateToProps : MapStateToPropsParam <TStateProps , TOwnProps , State >): InferableComponentEnhancerWithProps <TStateProps & DispatchProp <AnyAction >, TOwnProps >;
34
+ <no_state = {}, TDispatchProps = {}, TOwnProps_1 = {}>(mapStateToProps : null | undefined , mapDispatchToProps : MapDispatchToPropsNonObject <TDispatchProps , TOwnProps_1 >): InferableComponentEnhancerWithProps <TDispatchProps , TOwnProps_1 >;
35
+ <no_state_1 = {}, TDispatchProps_1 = {}, TOwnProps_2 = {}>(mapStateToProps : null | undefined , mapDispatchToProps : MapDispatchToPropsParam <TDispatchProps_1 , TOwnProps_2 >): InferableComponentEnhancerWithProps <ResolveThunks <TDispatchProps_1 >, TOwnProps_2 >;
36
+ <TStateProps_1 = {}, TDispatchProps_2 = {}, TOwnProps_3 = {}, State_1 = DefaultRootState >(mapStateToProps : MapStateToPropsParam <TStateProps_1 , TOwnProps_3 , State_1 >, mapDispatchToProps : MapDispatchToPropsNonObject <TDispatchProps_2 , TOwnProps_3 >): InferableComponentEnhancerWithProps <TStateProps_1 & TDispatchProps_2 , TOwnProps_3 >;
37
+ <TStateProps_2 = {}, TDispatchProps_3 = {}, TOwnProps_4 = {}, State_2 = DefaultRootState >(mapStateToProps : MapStateToPropsParam <TStateProps_2 , TOwnProps_4 , State_2 >, mapDispatchToProps : MapDispatchToPropsParam <TDispatchProps_3 , TOwnProps_4 >): InferableComponentEnhancerWithProps <TStateProps_2 & ResolveThunks <TDispatchProps_3 >, TOwnProps_4 >;
38
+ <no_state_2 = {}, no_dispatch_1 = {}, TOwnProps_5 = {}, TMergedProps = {}>(mapStateToProps : null | undefined , mapDispatchToProps : null | undefined , mergeProps : MergeProps <undefined , undefined , TOwnProps_5 , TMergedProps >): InferableComponentEnhancerWithProps <TMergedProps , TOwnProps_5 >;
39
+ <TStateProps_3 = {}, no_dispatch_2 = {}, TOwnProps_6 = {}, TMergedProps_1 = {}, State_3 = DefaultRootState >(mapStateToProps : MapStateToPropsParam <TStateProps_3 , TOwnProps_6 , State_3 >, mapDispatchToProps : null | undefined , mergeProps : MergeProps <TStateProps_3 , undefined , TOwnProps_6 , TMergedProps_1 >): InferableComponentEnhancerWithProps <TMergedProps_1 , TOwnProps_6 >;
40
+ <no_state_3 = {}, TDispatchProps_4 = {}, TOwnProps_7 = {}, TMergedProps_2 = {}>(mapStateToProps : null | undefined , mapDispatchToProps : MapDispatchToPropsParam <TDispatchProps_4 , TOwnProps_7 >, mergeProps : MergeProps <undefined , TDispatchProps_4 , TOwnProps_7 , TMergedProps_2 >): InferableComponentEnhancerWithProps <TMergedProps_2 , TOwnProps_7 >;
41
+ <TStateProps_4 = {}, no_dispatch_3 = {}, TOwnProps_8 = {}, State_4 = DefaultRootState >(mapStateToProps : MapStateToPropsParam <TStateProps_4 , TOwnProps_8 , State_4 >, mapDispatchToProps : null | undefined , mergeProps : null | undefined , options : ConnectOptions <State_4 , TStateProps_4 , TOwnProps_8 , {}>): InferableComponentEnhancerWithProps <DispatchProp <AnyAction > & TStateProps_4 , TOwnProps_8 >;
42
+ <TStateProps_5 = {}, TDispatchProps_5 = {}, TOwnProps_9 = {}>(mapStateToProps : null | undefined , mapDispatchToProps : MapDispatchToPropsNonObject <TDispatchProps_5 , TOwnProps_9 >, mergeProps : null | undefined , options : ConnectOptions <{}, TStateProps_5 , TOwnProps_9 , {}>): InferableComponentEnhancerWithProps <TDispatchProps_5 , TOwnProps_9 >;
43
+ <TStateProps_6 = {}, TDispatchProps_6 = {}, TOwnProps_10 = {}>(mapStateToProps : null | undefined , mapDispatchToProps : MapDispatchToPropsParam <TDispatchProps_6 , TOwnProps_10 >, mergeProps : null | undefined , options : ConnectOptions <{}, TStateProps_6 , TOwnProps_10 , {}>): InferableComponentEnhancerWithProps <ResolveThunks <TDispatchProps_6 >, TOwnProps_10 >;
44
+ <TStateProps_7 = {}, TDispatchProps_7 = {}, TOwnProps_11 = {}, State_5 = DefaultRootState >(mapStateToProps : MapStateToPropsParam <TStateProps_7 , TOwnProps_11 , State_5 >, mapDispatchToProps : MapDispatchToPropsNonObject <TDispatchProps_7 , TOwnProps_11 >, mergeProps : null | undefined , options : ConnectOptions <State_5 , TStateProps_7 , TOwnProps_11 , {}>): InferableComponentEnhancerWithProps <TStateProps_7 & TDispatchProps_7 , TOwnProps_11 >;
45
+ <TStateProps_8 = {}, TDispatchProps_8 = {}, TOwnProps_12 = {}, State_6 = DefaultRootState >(mapStateToProps : MapStateToPropsParam <TStateProps_8 , TOwnProps_12 , State_6 >, mapDispatchToProps : MapDispatchToPropsParam <TDispatchProps_8 , TOwnProps_12 >, mergeProps : null | undefined , options : ConnectOptions <State_6 , TStateProps_8 , TOwnProps_12 , {}>): InferableComponentEnhancerWithProps <TStateProps_8 & ResolveThunks <TDispatchProps_8 >, TOwnProps_12 >;
46
+ <TStateProps_9 = {}, TDispatchProps_9 = {}, TOwnProps_13 = {}, TMergedProps_3 = {}, State_7 = DefaultRootState >(mapStateToProps : MapStateToPropsParam <TStateProps_9 , TOwnProps_13 , State_7 >, mapDispatchToProps : MapDispatchToPropsParam <TDispatchProps_9 , TOwnProps_13 >, mergeProps : MergeProps <TStateProps_9 , TDispatchProps_9 , TOwnProps_13 , TMergedProps_3 >, options ? : ConnectOptions <State_7 , TStateProps_9 , TOwnProps_13 , TMergedProps_3 > | undefined ): InferableComponentEnhancerWithProps <TMergedProps_3 , TOwnProps_13 >;
47
+ };
48
+
49
+ // @public (undocumented)
50
+ export function connectAdvanced<S , TProps , TOwnProps , TFactoryOptions = {}>(selectorFactory : SelectorFactory <S , TProps , unknown , unknown >, { getDisplayName , methodName , shouldHandleStateChanges , forwardRef , context , ... connectOptions }?: ConnectAdvancedOptions & Partial <TFactoryOptions >): AdvancedComponentDecorator <TProps , TOwnProps & ConnectProps >;
61
51
62
52
// @public (undocumented)
63
53
export interface ConnectAdvancedOptions {
@@ -76,10 +66,13 @@ export interface ConnectAdvancedOptions {
76
66
}
77
67
78
68
// @public (undocumented)
79
- export type ConnectedComponent <C extends ComponentType <any >, P > = NamedExoticComponent < JSX . LibraryManagedAttributes < C , P > > & NonReactStatics <C > & {
69
+ export type ConnectedComponent <C extends ComponentType <any >, P > = ComponentType < P > & NonReactStatics <C > & {
80
70
WrappedComponent: C ;
81
71
};
82
72
73
+ // @public
74
+ export type ConnectedProps <TConnector > = TConnector extends InferableComponentEnhancerWithProps <infer TInjectedProps , any > ? unknown extends TInjectedProps ? TConnector extends InferableComponentEnhancer <infer TInjectedProps > ? TInjectedProps : never : TInjectedProps : never ;
75
+
83
76
// @public (undocumented)
84
77
export interface ConnectProps {
85
78
// (undocumented)
0 commit comments