Restricting types for route-parser.

This commit is contained in:
Bob Buehler
2017-06-23 11:33:26 -05:00
committed by Robert Buehler
parent 92cde1421d
commit e5c7b40a2b

View File

@@ -1,6 +1,6 @@
// Type definitions for route-parser 0.0
// Type definitions for route-parser 0.1
// Project: https://github.com/rcs/route-parser
// Definitions by: Ian Ker-Seymer <https://github.com/ianks>
// Definitions by: Ian Ker-Seymer <https://github.com/ianks>, Bob Buehler <https://github.com/bobbuehler>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare class Route {
@@ -23,7 +23,7 @@ declare class Route {
* var route = new Route('/:one/:two')
* route.match('/foo/bar/') // -> {one: 'foo', two: 'bar'}
*/
match(pathname: string): { [i: string]: string } | boolean;
match(pathname: string): { [i: string]: string } | false;
/**
* Reverse a route specification to a path, returning false if it can't be
@@ -32,7 +32,7 @@ declare class Route {
* var route = new Route('/:one/:two')
* route.reverse({one: 'foo', two: 'bar'}) -> '/foo/bar'
*/
reverse(params: { [i: string]: any } ): string | boolean;
reverse(params: { [i: string]: any } ): string | false;
}
declare namespace Route {}