mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add template interceptor type definition
This commit is contained in:
@@ -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<any>(csrf)
|
||||
.wrap<any>(errorCode)
|
||||
.wrap<any>(retry)
|
||||
.wrap<any>(template, { template: 'auth={token}', params: { token: 'hunter2' } })
|
||||
.wrap<any>(timeout)
|
||||
.wrap<any>(jsonp)
|
||||
.wrap<any>(xdomain)
|
||||
|
||||
Vendored
+16
-1
@@ -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 <https://github.com/Nemo157>
|
||||
// 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<template.Config>;
|
||||
|
||||
module template {
|
||||
interface Config {
|
||||
template?: string;
|
||||
params?: {};
|
||||
}
|
||||
}
|
||||
|
||||
export = hateoas;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/timeout" {
|
||||
import rest = require("rest");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user