forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
routie.d.ts
35 lines (30 loc) · 1.03 KB
/
routie.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Type definitions for routie 0.3.2
// Project: https://github.com/jgallen23/routie
// Definitions by: Adilson <https://github.com/Adilson>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace routie {
interface Route {
constructor(path: string, name: string): Route;
addHandler(fn: Function): void;
removeHandler(fn: Function): void;
run(params: any): void;
match(path: string, params: any): boolean;
toURL(params: any): string;
}
interface Routie extends RoutieStatic {
(path: string): void;
(path: string, fn: Function): void;
(routes: { [key: string]: Function }): void;
}
interface RoutieStatic {
lookup(name: string, fn: Function): string;
remove(path: string, fn: Function): void;
removeAll(): void;
navigate(path: string, options?: RouteOptions): void;
noConflict(): Routie;
}
interface RouteOptions {
silent?: boolean;
}
}
declare var routie: routie.Routie;