Skip to content

Commit 27214e1

Browse files
committed
Edit definitions
1 parent bbff969 commit 27214e1

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/react/router/Statics.hx

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extern class Statics {
1111
static public var hashHistory:HashHistory;
1212
static public var browserHistory:BrowserHistory;
1313
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
1717
}

src/react/router/Types.hx

+9-8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ typedef RouteProps = RoutePropsOf<Any, Any>;
1414
typedef RoutePropsOfParams<P> = RoutePropsOf<P, Any>;
1515
typedef RoutePropsOfQuery<Q> = RoutePropsOf<Any, Q>;
1616

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+
1726
typedef RoutePropsOf<P, Q> = {
1827
route:Route<P, Q>,
1928
router:Router<P, Q>,
@@ -32,14 +41,6 @@ private typedef Component = EitherType<Class<ReactComponent>, String>;
3241
private typedef EnterHook<P, Q> = RouterState<P, Q>->RedirectFunction<Q>->?Function->Any;
3342
private typedef Hash = String;
3443
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-
};
4344
private typedef LocationDescriptorObject<Q> = {
4445
pathname:Pathname,
4546
search:QueryString,

0 commit comments

Comments
 (0)