diff --git a/rest/rest-tests.ts b/rest/rest-tests.ts index cedc11b00..00ce6b3db 100644 --- a/rest/rest-tests.ts +++ b/rest/rest-tests.ts @@ -13,6 +13,7 @@ import oAuth = require('rest/interceptor/oAuth'); import csrf = require('rest/interceptor/csrf'); import errorCode = require('rest/interceptor/errorCode'); import retry = require('rest/interceptor/retry'); +import template = require('rest/interceptor/template'); import timeout = require('rest/interceptor/timeout'); import jsonp = require('rest/interceptor/jsonp'); import xdomain = require('rest/interceptor/ie/xdomain'); @@ -127,6 +128,7 @@ client = rest .wrap(csrf) .wrap(errorCode) .wrap(retry) + .wrap(template, { template: 'auth={token}', params: { token: 'hunter2' } }) .wrap(timeout) .wrap(jsonp) .wrap(xdomain) diff --git a/rest/rest.d.ts b/rest/rest.d.ts index a96e0822a..ac2f2ef0b 100644 --- a/rest/rest.d.ts +++ b/rest/rest.d.ts @@ -1,4 +1,4 @@ -// Type definitions for rest.js v1.2.0 +// Type definitions for rest.js v1.3.1 // Project: https://github.com/cujojs/rest // Definitions by: Wim Looman // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -255,6 +255,21 @@ declare module "rest/interceptor/retry" { export = retry; } +declare module "rest/interceptor/template" { + import rest = require("rest"); + + var hateoas: rest.Interceptor; + + module template { + interface Config { + template?: string; + params?: {}; + } + } + + export = hateoas; +} + declare module "rest/interceptor/timeout" { import rest = require("rest");