mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-13 08:57:26 +08:00
Merge pull request #1955 from Bartvds/def/uri-templates
added definitions for uri-templates
This commit is contained in:
@@ -276,6 +276,7 @@ List of Definitions
|
||||
* [Underscore-ko.js](https://github.com/kamranayub/UnderscoreKO) (by [Maurits Elbers](https://github.com/MagicMau))
|
||||
* [universal-analytics](https://github.com/peaksandpies/universal-analytics) (by [Bart van der Schoor](https://github.com/Bartvds))
|
||||
* [update-notifier](https://github.com/yeoman/update-notifier) (by [vvakame](https://github.com/vvakame))
|
||||
* [uri-templates](https://github.com/geraintluff/uri-variables) (by [Bart van der Schoor](https://github.com/Bartvds))
|
||||
* [urlrouter](https://github.com/fengmk2/urlrouter) (by [Carlos Ballesteros Velasco](https://github.com/soywiz))
|
||||
* [UUID.js](https://github.com/LiosK/UUID.js) (by [Jason Jarrett](https://github.com/staxmanade))
|
||||
* [Valerie](https://github.com/davewatts/valerie) (by [Howard Richards](https://github.com/conficient))
|
||||
|
||||
16
uri-templates/uri-templates-tests.ts
Normal file
16
uri-templates/uri-templates-tests.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/// <reference path="uri-templates.d.ts" />
|
||||
|
||||
import utmpl = require('uri-templates');
|
||||
import URITemplate = utmpl.URITemplate;
|
||||
|
||||
var str: string;
|
||||
var u: URITemplate;
|
||||
var obj: Object;
|
||||
|
||||
u = utmpl(str);
|
||||
|
||||
str = u.fillFromObject(obj);
|
||||
str = u.fill((key) => {
|
||||
return str;
|
||||
});
|
||||
obj = u.fromUri(str);
|
||||
18
uri-templates/uri-templates.d.ts
vendored
Normal file
18
uri-templates/uri-templates.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
// Type definitions for uri-templates 0.1.2
|
||||
// Project: https://github.com/geraintluff/uri-templates
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module 'uri-templates' {
|
||||
function utpl(template: string): utpl.URITemplate;
|
||||
|
||||
module utpl {
|
||||
export interface URITemplate {
|
||||
fillFromObject(vars: Object): string;
|
||||
fill(callback: (varName: string) => string): string;
|
||||
fromUri(uri: string): Object;
|
||||
}
|
||||
}
|
||||
|
||||
export = utpl;
|
||||
}
|
||||
Reference in New Issue
Block a user