@@ -13,6 +13,26 @@ export type MapToProps<P extends AnyProps = AnyProps> = {
1313 dependsOnOwnProps ?: boolean
1414}
1515
16+ /**
17+ * What the `init*` factories below hand back to `selectorFactory`: the same
18+ * call signature as {@linkcode MapToProps}, but with `dependsOnOwnProps`
19+ * always present — `selectorFactory` reads it unconditionally.
20+ */
21+ export type WrappedMapToProps < P extends AnyProps = AnyProps > = {
22+ ( stateOrDispatch : StateOrDispatch , ownProps ?: P ) : FixTypeLater
23+ dependsOnOwnProps : boolean
24+ }
25+
26+ /**
27+ * The fields of `selectorFactory`'s `InitOptions` that the `init*` factories
28+ * actually read. Kept structural (rather than importing `InitOptions`) so the
29+ * two modules don't have to agree on its type parameters.
30+ */
31+ export type InitProxyOptions = {
32+ readonly displayName : string
33+ readonly wrappedComponentName : string
34+ }
35+
1636export function wrapMapToPropsConstant (
1737 // * Note:
1838 // It seems that the dispatch argument
@@ -26,7 +46,7 @@ export function wrapMapToPropsConstant(
2646 }
2747 | ActionCreatorsMapObject
2848 | ActionCreator < any > ,
29- ) {
49+ ) : ( dispatch : Dispatch ) => WrappedMapToProps {
3050 return function initConstantSelector ( dispatch : Dispatch ) {
3151 const constant = getConstant ( dispatch )
3252
@@ -67,7 +87,10 @@ function getDependsOnOwnProps(mapToProps: MapToProps) {
6787export function wrapMapToPropsFunc < P extends AnyProps = AnyProps > (
6888 mapToProps : MapToProps ,
6989 methodName : string ,
70- ) {
90+ ) : (
91+ dispatch : Dispatch ,
92+ factoryOptions : { displayName : string } ,
93+ ) => WrappedMapToProps < P > {
7194 return function initProxySelector (
7295 dispatch : Dispatch ,
7396 { displayName } : { displayName : string } ,
0 commit comments