pathjs: various small fixes

This commit is contained in:
Erik Krogh Kristensen
2019-02-05 15:14:45 +01:00
parent c807902931
commit a407d194a1
2 changed files with 12 additions and 8 deletions
+10 -6
View File
@@ -3,6 +3,10 @@
// Definitions by: Lokesh Peta <https://github.com/lokeshpeta>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface IDictionary<T> {
[id: string]: T;
}
interface IPathHistory{
initial: any;
pushState(state: any, title: string, path: string):void;
@@ -19,11 +23,11 @@ interface IPathRoute{
}
interface IPathRoutes{
current: IPathRoute,
root: IPathRoute,
rescue: Function,
previous: IPathRoute,
defined: {}
current?: string,
root?: string,
rescue?: Function,
previous?: string,
defined: IDictionary<IPathRoute>
}
interface IPathCore{
@@ -43,7 +47,7 @@ interface IPath {
history: IPathHistory;
match(path: string, parameterize: boolean): IPathRoute;
match(path: string, parameterize: boolean): IPathRoute | null;
dispatch(passed_route: string): void;
+2 -2
View File
@@ -1,4 +1,4 @@
import {Path} from "./index";
Path.map("/test/:id")
.to(()=>{ });
@@ -30,4 +30,4 @@ var funs = new Array<Function>();
funs.push(test1);
funs.push(test2);
route.enter(funs);
route.enter(funs);