mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-10 11:40:16 +08:00
added definitions for uri-templates
This commit is contained in:
@@ -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);
|
||||
Vendored
+18
@@ -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