mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
25 lines
558 B
TypeScript
25 lines
558 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 module "route-recognizer" {
|
|
|
|
class RouteRecognizer<H> {
|
|
constructor()
|
|
add: (routes: Route<H>[]) => void
|
|
recognize: (path: string) => MatchedRoute<H>[]
|
|
}
|
|
|
|
interface Route<H> {
|
|
path: string
|
|
handler: H
|
|
}
|
|
|
|
export = RouteRecognizer
|
|
}
|
|
|
|
interface MatchedRoute<H> {
|
|
handler: H
|
|
params: { [key: string]: string }
|
|
} |