File tree 3 files changed +35
-10
lines changed
3 files changed +35
-10
lines changed Original file line number Diff line number Diff line change
1
+ package src .react .router ;
2
+
3
+ /*
4
+ * Avaliable for versions 4.0.0 and above
5
+ */
6
+
7
+ #if (jsImport)
8
+ @:js.import (' react-router-dom' , ' BrowserRouter' )
9
+ #else
10
+ @:jsRequire (' react-router-dom' , ' BrowserRouter' )
11
+ #end
12
+ extern class BrowserRouter extends react. ReactComponent {}
Original file line number Diff line number Diff line change
1
+ package src .react .router ;
2
+
3
+ /*
4
+ * Avaliable for versions 4.0.0 and above
5
+ */
6
+
7
+ #if (jsImport)
8
+ @:js.import (' react-router-dom' , ' HashRouter' )
9
+ #else
10
+ @:jsRequire (' react-router-dom' , ' HashRouter' )
11
+ #end
12
+ extern class HashRouter extends react. ReactComponent {}
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 >,
@@ -22,24 +31,16 @@ typedef RoutePropsOf<P, Q> = {
22
31
}
23
32
24
33
private typedef Object = Any ;
25
- @:enum
26
- private abstract Action (String ) {
34
+ #if haxe4 private enum #else @:enum private #end abstract Action (String ) {
27
35
var Push = ' PUSH' ;
28
36
var Replace = ' REPLACE' ;
29
37
var Pop = ' POP' ;
30
38
}
39
+
31
40
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