@@ -3,7 +3,7 @@ import Callback from './callback';
33import Dispatcher , { ExtractArguments } from './dispatcher' ;
44import Dispatchers from './dispatchers' ;
55import NewGlobalState from './new-global-state' ;
6- import Reducer , { AdditionalReducers } from './reducer' ;
6+ import Reducer , { AdditionalReducers , PropertyReducer } from './reducer' ;
77import { GlobalTuple , StateTuple } from './use-global' ;
88import WithGlobal , { Getter , Setter } from './with-global' ;
99
@@ -17,40 +17,53 @@ export default interface ReactNProvider<
1717 G extends { } = State ,
1818 R extends { } = Reducers ,
1919> {
20+
2021 addCallback ( callback : Callback < G > ) : BooleanFunction ;
22+
2123 addReducer < A extends any [ ] = any [ ] > (
2224 name : string ,
2325 reducer : Reducer < G , R , A > ,
2426 ) : BooleanFunction ;
27+
2528 addReducers ( reducers : AdditionalReducers < G , R > ) : BooleanFunction ;
2629 dispatch : Dispatchers < G , R > ;
30+
2731 getDispatch ( ) : Dispatchers < G , R > ;
32+
2833 getGlobal ( ) : G ;
2934 global : G ;
35+
3036 removeCallback ( callback : Callback < G > ) : boolean ;
37+
3138 reset ( ) : void ;
39+
3240 setGlobal (
3341 newGlobalState : NewGlobalState < G > ,
3442 callback ?: Callback < G > ,
3543 ) : Promise < G > ;
44+
3645 useDispatch ( ) : Dispatchers < G , R > ;
3746 useDispatch < A extends any [ ] = any [ ] > (
3847 reducer : Reducer < G , R , A > ,
3948 ) : Dispatcher < G , A > ;
4049 useDispatch < A extends any [ ] = any [ ] , P extends keyof G = keyof G > (
41- reducer : Reducer < G , R , A , G [ P ] > ,
50+ reducer : PropertyReducer < G , A , P > ,
4251 property : P ,
4352 ) : Dispatcher < G , A > ;
4453 useDispatch < K extends keyof R = keyof R > (
4554 reducer : K ,
4655 ) : Dispatcher < G , ExtractArguments < R [ K ] > > ;
56+
4757 useGlobal ( ) : GlobalTuple < G > ;
4858 useGlobal < Property extends keyof G > (
4959 property : Property ,
5060 ) : StateTuple < G , Property > ;
61+
5162 withGlobal < HP , LP > (
5263 getter ?: Getter < G , R , HP , LP > ,
5364 setter ?: Setter < G , R , HP , LP > ,
5465 ) : WithGlobal < HP , LP > ;
66+
5567 new ( props : { } , context ?: any ) : React . Component < { } , { } > ;
68+
5669}
0 commit comments