1- import React = require( 'react' ) ;
21import { Reducers , State } from '../default' ;
32import Callback from '../types/callback' ;
43import {
87import Dispatcher , { ExtractArguments } from '../types/dispatcher' ;
98import Dispatchers from '../types/dispatchers' ;
109import NewGlobalState from '../types/new-global-state' ;
10+ import Omit from '../types/omit' ;
1111import ReactNProvider from '../types/provider' ;
1212import Reducer , { AdditionalReducers } from '../types/reducer' ;
1313import { GlobalTuple , StateTuple } from '../types/use-global' ;
@@ -27,12 +27,13 @@ import setGlobal from './set-global';
2727import useDispatch from './use-dispatch' ;
2828import useGlobal from './use-global' ;
2929import withGlobal from './with-global' ;
30+ import React = require( 'react' ) ;
3031
3132
3233
3334type BooleanFunction = ( ) => boolean ;
3435
35- interface ReactN extends TypeOfReact {
36+ interface ReactN extends Omit < typeof React , 'Component' | 'default' | 'PureComponent' > {
3637
3738 < P extends { } = { } , S extends { } = { } , G extends { } = State , R extends { } = Reducers , SS = any > (
3839 DecoratedComponent : React . ComponentClass < P , S > ,
@@ -51,8 +52,6 @@ interface ReactN extends TypeOfReact {
5152 reducers : AdditionalReducers < G , R > ,
5253 ) : BooleanFunction ;
5354
54- Component : ReactNComponentClass ;
55-
5655 createProvider < G extends { } = State , R extends { } = Reducers > (
5756 initialState ?: G ,
5857 initialReducers ?: R ,
@@ -65,8 +64,6 @@ interface ReactN extends TypeOfReact {
6564
6665 getGlobal < G extends { } = State > ( ) : G ;
6766
68- PureComponent : ReactNPureComponentClass ;
69-
7067 removeCallback < G extends { } = State > (
7168 callback : Callback < G > ,
7269 ) : boolean ;
@@ -102,21 +99,45 @@ interface ReactN extends TypeOfReact {
10299}
103100
104101declare namespace ReactNTypes {
102+
103+ interface Component <
104+ P extends { } = { } ,
105+ S extends { } = { } ,
106+ G extends { } = State ,
107+ R extends { } = Reducers ,
108+ SS = any ,
109+ > extends ReactNComponent < P , S , G , R , SS > { }
110+
105111 interface ComponentClass <
106112 P extends { } = { } ,
107113 S extends { } = { } ,
108114 G extends { } = State ,
109115 R extends { } = Reducers ,
110- SS = any
111- > extends React . ComponentClass < P , S > {
112- new ( props : P , context ?: any ) : ReactNComponent < P , S , G , R , SS > ;
113- }
116+ SS = any ,
117+ > extends ReactNComponentClass < P , S , G , R , SS > { }
114118
119+ interface PureComponent <
120+ P extends { } = { } ,
121+ S extends { } = { } ,
122+ G extends { } = State ,
123+ R extends { } = Reducers ,
124+ SS = any ,
125+ > extends ReactNPureComponent < P , S , G , R , SS > { }
126+
127+ interface PureComponentClass <
128+ P extends { } = { } ,
129+ S extends { } = { } ,
130+ G extends { } = State ,
131+ R extends { } = Reducers ,
132+ SS = any ,
133+ > extends ReactNPureComponentClass < P , S , G , R , SS > { }
134+
135+ class Component { }
115136 class ComponentClass { }
137+ class PureComponent { }
138+ class PureComponentClass { }
116139}
117140
118- type TypeOfReact = typeof React ;
119-
120141
121142
122143export = Object . assign ( reactn , React , {
0 commit comments