diff --git a/types/pathjs/index.d.ts b/types/pathjs/index.d.ts index fa652d0245..2ab8198c59 100644 --- a/types/pathjs/index.d.ts +++ b/types/pathjs/index.d.ts @@ -3,6 +3,10 @@ // Definitions by: Lokesh Peta // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export interface IDictionary { + [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 } 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; diff --git a/types/pathjs/pathjs-tests.ts b/types/pathjs/pathjs-tests.ts index f64fa2a15b..e71dcc7dbb 100644 --- a/types/pathjs/pathjs-tests.ts +++ b/types/pathjs/pathjs-tests.ts @@ -1,4 +1,4 @@ - +import {Path} from "./index"; Path.map("/test/:id") .to(()=>{ }); @@ -30,4 +30,4 @@ var funs = new Array(); funs.push(test1); funs.push(test2); -route.enter(funs); \ No newline at end of file +route.enter(funs);