route-recognizer: Provides its own types (#15651)

This commit is contained in:
Andy
2017-04-17 09:39:31 -07:00
committed by GitHub
parent fbfb73aaaf
commit 0308b696f5
4 changed files with 6 additions and 52 deletions
+6
View File
@@ -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",
-23
View File
@@ -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");
-22
View File
@@ -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"
]
}