vvakame
56295f5058
replace https://github.com/borisyankov/DefinitelyTyped to https://github.com/DefinitelyTyped/DefinitelyTyped
2016-03-17 00:55:26 +09:00
remojansen
9a0e11328b
added tests case and fixed issue
2016-02-17 20:42:26 +00:00
Remo H. Jansen
0997ad0603
Fixed wrong action creators type
...
Using some of the redux-router action creators like pushState :
```
import { pushState } from 'redux-router';
export function saveEngagementAsVisibleSuccess(goTo) {
return function(dispatch) {
dispatch(pushState(null, goTo));
}
}
```
Throws the following error:
```
Error TS2349: Cannot invoke an expression whose type lacks a call signature.
```
The redux-router [source code](https://github.com/acdlite/redux-router/blob/master/src/actionCreators.js#L46-L63 ) declare those as functions not objects:
```
export function historyAPI(method) {
return (...args) => ({
type: HISTORY_API,
payload: {
method,
args
}
});
}
export const pushState = historyAPI('pushState');
export const push = historyAPI('push');
export const replaceState = historyAPI('replaceState');
export const replace = historyAPI('replace');
export const setState = historyAPI('setState');
export const go = historyAPI('go');
export const goBack = historyAPI('goBack');
export const goForward = historyAPI('goForward');
```
So I have update the types from `__ReduxRouter.ReduxRouterAction` to `__ReduxRouter.historyAPI`:
```
export const pushState: __ReduxRouter.historyAPI;
export const pushState: __ReduxRouter.historyAPI;
export const push: __ReduxRouter.historyAPI;
export const replaceState: __ReduxRouter.historyAPI;
export const replace: __ReduxRouter.historyAPI;
export const setState: __ReduxRouter.historyAPI;
export const go: __ReduxRouter.historyAPI;
export const goBack: __ReduxRouter.historyAPI;
export const goForward: __ReduxRouter.historyAPI;
```
2016-02-17 17:47:49 +00:00
Remo H. Jansen
bb86dc40b9
Fixes compilation error
...
The original file contained:
```
/**
* A component that renders a React Router app using router state from a Redux store.
*/
export class ReactRouter { }
```
The exported ``ReactRouter ` class is empty but it is supposed to be the ReactRouter.
I removed the empty class and exported the the ReactRouter instead:
```
declare module "redux-router/lib/ReduxRouter" {
import Router from "react-router";
export default Router;
}
```
2016-02-05 11:12:51 +00:00
Stepan Mikhaylyuk
7139bce6da
minor fixes
2016-01-26 04:01:56 +03:00
Stepan Mikhaylyuk
75417d4087
added tests for redux router definitions
2016-01-26 03:50:06 +03:00
Stepan Mikhaylyuk
ee9afde348
added definitions for redux router
2016-01-26 03:46:45 +03:00