Skip to content

Commit 51b94fc

Browse files
committed
Export RouterSink and HistoryAction
1 parent 709720e commit 51b94fc

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
},
2828
"homepage": "https://github.com/cyclejs-community/cyclic-router#readme",
2929
"dependencies": {
30-
"@cycle/history": "^6.2.0",
30+
"@cycle/history": "^6.3.0",
3131
"@cycle/run": "^3.1.0",
32-
"history": "^4.6.1"
32+
"history": "^4.6.3"
3333
},
3434
"devDependencies": {
3535
"@cycle/rxjs-run": "^7.0.0",
36-
"@types/history": "^4.5.1",
36+
"@types/history": "^4.6.0",
3737
"@types/mocha": "^2.2.41",
38-
"@types/node": "^7.0.22",
38+
"@types/node": "^8.0.19",
3939
"assert": "^1.4.1",
4040
"babel-preset-es2015": "^6.24.1",
4141
"babel-register": "^6.24.1",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export {makeRouterDriver} from './makeRouterDriver';
1+
export * from './makeRouterDriver';
22
export {RouterSource} from './RouterSource';
33
export * from './interfaces';

src/makeRouterDriver.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import {makeHistoryDriver} from '@cycle/history';
22
import {RouteMatcher} from './interfaces';
33
import {RouterSource} from './RouterSource';
44
import {History} from 'history';
5+
import {HistoryInput, GenericInput} from '@cycle/history';
6+
import {Stream} from 'xstream';
7+
8+
export declare type HistoryAction = HistoryInput | GenericInput | string;
9+
export declare type RouterSink = Stream<HistoryAction>;
510

611
/**
712
* Instantiates an new router driver function using the same arguments required
@@ -25,7 +30,7 @@ function makeRouterDriver(history: History, routeMatcher: RouteMatcher) {
2530
* history driver would expect.
2631
* @return {routerAPI}
2732
*/
28-
return function routerDriver(sink$: any) {
33+
return function routerDriver(sink$: RouterSink) {
2934
const history$ = historyDriver(sink$).remember();
3035
return new RouterSource(history$, [], history.createHref, routeMatcher);
3136
};

0 commit comments

Comments
 (0)