File tree 2 files changed +12
-11
lines changed
2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ extern class Statics {
11
11
static public var hashHistory : HashHistory ;
12
12
static public var browserHistory : BrowserHistory ;
13
13
static public var withRouter : Dynamic -> Dynamic ;
14
-
15
- static public function useLocation <T >(): T ; // Avaliable for versions 4.0.0 and above
16
- static public function useHistory < T > (): T ; // Avaliable for versions 4.0.0 and above
14
+
15
+ static public function useLocation <Q >(): Location < Q > ; // Avaliable for versions 4.0.0 and above
16
+ static public function useHistory (): HashHistory ; // Avaliable for versions 4.0.0 and above
17
17
}
Original file line number Diff line number Diff line change @@ -14,6 +14,15 @@ typedef RouteProps = RoutePropsOf<Any, Any>;
14
14
typedef RoutePropsOfParams <P > = RoutePropsOf <P , Any >;
15
15
typedef RoutePropsOfQuery <Q > = RoutePropsOf <Any , Q >;
16
16
17
+ typedef Location <Q > = {
18
+ pathname : Pathname ,
19
+ search : QueryString ,
20
+ query : Query <Q >,
21
+ state : LocationState ,
22
+ action : Action ,
23
+ key : LocationKey ,
24
+ };
25
+
17
26
typedef RoutePropsOf <P , Q > = {
18
27
route : Route <P , Q >,
19
28
router : Router <P , Q >,
@@ -32,14 +41,6 @@ private typedef Component = EitherType<Class<ReactComponent>, String>;
32
41
private typedef EnterHook <P , Q > = RouterState <P , Q >-> RedirectFunction <Q >-> ? Function -> Any ;
33
42
private typedef Hash = String ;
34
43
private typedef LeaveHook <P , Q > = RouterState <P , Q >-> Any ;
35
- private typedef Location <Q > = {
36
- pathname : Pathname ,
37
- search : QueryString ,
38
- query : Query <Q >,
39
- state : LocationState ,
40
- action : Action ,
41
- key : LocationKey ,
42
- };
43
44
private typedef LocationDescriptorObject <Q > = {
44
45
pathname : Pathname ,
45
46
search : QueryString ,
You can’t perform that action at this time.
0 commit comments