Files
DefinitelyTyped/types/route-recognizer/index.d.ts
2017-03-24 14:27:52 -07:00

23 lines
551 B
TypeScript

// Type definitions for route-recognizer
// Project: https://github.com/tildeio/route-recognizer
// Definitions by: Dave Keen <http://www.keendevelopment.ch>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare class RouteRecognizer<H> {
constructor()
add: (routes: Route<H>[]) => void
recognize: (path: string) => MatchedRoute<H>[]
}
interface Route<H> {
path: string
handler: H
}
export = RouteRecognizer;
export as namespace RouteRecognizer;
interface MatchedRoute<H> {
handler: H
params: { [key: string]: string }
}