mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
route-recognizer: Provides its own types (#15651)
This commit is contained in:
@@ -444,6 +444,12 @@
|
||||
"sourceRepoURL": "https://github.com/EnoF/rest-io",
|
||||
"asOfVersion": "4.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "route-recognizer",
|
||||
"typingsPackageName": "route-recognizer",
|
||||
"sourceRepoURL": "https://github.com/tildeio/route-recognizer",
|
||||
"asOfVersion": "0.3.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "node-scanf",
|
||||
"typingsPackageName": "scanf",
|
||||
|
||||
Vendored
-23
@@ -1,23 +0,0 @@
|
||||
// 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 }
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
|
||||
|
||||
import RouteRecognizer = require('route-recognizer')
|
||||
|
||||
var router = new RouteRecognizer<string>();
|
||||
router.add([{ path: "/posts", handler: "i am the handler" }]);
|
||||
var result = router.recognize("/posts");
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"route-recognizer-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user