mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-07 04:50:54 +08:00
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
// 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;
|