3
3
// Definitions by: Adilson <https://github.com/Adilson>
4
4
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5
5
6
- interface Route {
7
- constructor ( path : string , name : string ) : Route ;
8
- addHandler ( fn : Function ) : void ;
9
- removeHandler ( fn : Function ) : void ;
10
- run ( params : any ) : void ;
11
- match ( path : string , params : any ) : boolean ;
12
- toURL ( params : any ) : string ;
6
+ declare module routie {
7
+ interface Route {
8
+ constructor ( path : string , name : string ) : Route ;
9
+ addHandler ( fn : Function ) : void ;
10
+ removeHandler ( fn : Function ) : void ;
11
+ run ( params : any ) : void ;
12
+ match ( path : string , params : any ) : boolean ;
13
+ toURL ( params : any ) : string ;
14
+ }
15
+
16
+ interface Routie extends RoutieStatic {
17
+ ( path : string ) : void ;
18
+ ( path : string , fn : Function ) : void ;
19
+ ( routes : { [ key : string ] : Function } ) : void ;
20
+ }
21
+
22
+ interface RoutieStatic {
23
+ lookup ( name : string , fn : Function ) : string ;
24
+ remove ( path : string , fn : Function ) : void ;
25
+ removeAll ( ) : void ;
26
+ navigate ( path : string , options ?: RouteOptions ) : void ;
27
+ noConflict ( ) : Routie ;
28
+ }
29
+
30
+ interface RouteOptions {
31
+ silent ?: boolean ;
32
+ }
13
33
}
14
34
15
- declare function routie ( path : string ) : void ;
16
- declare function routie ( path : string , fn : Function ) : void ;
17
- declare function routie ( routes : { [ key : string ] : Function } ) : void ;
35
+ declare var routie : routie . Routie ;
0 commit comments