mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add rest interceptor definitions
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
/// <reference path="./rest.d.ts" />
|
||||
|
||||
import rest = require('rest');
|
||||
|
||||
import defaultRequest = require('rest/interceptor/defaultRequest');
|
||||
import hateoas = require('rest/interceptor/hateoas');
|
||||
import location = require('rest/interceptor/location');
|
||||
import mime = require('rest/interceptor/mime');
|
||||
import pathPrefix = require('rest/interceptor/pathPrefix');
|
||||
import basicAuth = require('rest/interceptor/basicAuth');
|
||||
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 timeout = require('rest/interceptor/timeout');
|
||||
import jsonp = require('rest/interceptor/jsonp');
|
||||
import xdomain = require('rest/interceptor/ie/xdomain');
|
||||
import xhr = require('rest/interceptor/ie/xhr');
|
||||
|
||||
import registry = require('rest/mime/registry');
|
||||
|
||||
rest('/').then(function(response) {
|
||||
@@ -38,3 +52,18 @@ registry.register('application/vnd.com.example', {
|
||||
}
|
||||
});
|
||||
|
||||
client = rest
|
||||
.wrap(defaultRequest)
|
||||
.wrap(hateoas)
|
||||
.wrap(location)
|
||||
.wrap(mime)
|
||||
.wrap(pathPrefix)
|
||||
.wrap(basicAuth)
|
||||
.wrap(oAuth)
|
||||
.wrap(csrf)
|
||||
.wrap(errorCode)
|
||||
.wrap(retry)
|
||||
.wrap(timeout)
|
||||
.wrap(jsonp)
|
||||
.wrap(xdomain)
|
||||
.wrap(xhr);
|
||||
|
||||
Vendored
+99
-3
@@ -62,12 +62,28 @@ declare module "rest" {
|
||||
}
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/errorCode" {
|
||||
declare module "rest/interceptor/defaultRequest" {
|
||||
import rest = require("rest");
|
||||
|
||||
var errorCode: rest.Interceptor;
|
||||
var defaultRequest: rest.Interceptor;
|
||||
|
||||
export = errorCode;
|
||||
export = defaultRequest;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/hateoas" {
|
||||
import rest = require("rest");
|
||||
|
||||
var hateoas: rest.Interceptor;
|
||||
|
||||
export = hateoas;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/location" {
|
||||
import rest = require("rest");
|
||||
|
||||
var location: rest.Interceptor;
|
||||
|
||||
export = location;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/mime" {
|
||||
@@ -78,6 +94,86 @@ declare module "rest/interceptor/mime" {
|
||||
export = mime;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/pathPrefix" {
|
||||
import rest = require("rest");
|
||||
|
||||
var pathPrefix: rest.Interceptor;
|
||||
|
||||
export = pathPrefix;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/basicAuth" {
|
||||
import rest = require("rest");
|
||||
|
||||
var basicAuth: rest.Interceptor;
|
||||
|
||||
export = basicAuth;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/oAuth" {
|
||||
import rest = require("rest");
|
||||
|
||||
var oAuth: rest.Interceptor;
|
||||
|
||||
export = oAuth;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/csrf" {
|
||||
import rest = require("rest");
|
||||
|
||||
var csrf: rest.Interceptor;
|
||||
|
||||
export = csrf;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/errorCode" {
|
||||
import rest = require("rest");
|
||||
|
||||
var errorCode: rest.Interceptor;
|
||||
|
||||
export = errorCode;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/retry" {
|
||||
import rest = require("rest");
|
||||
|
||||
var retry: rest.Interceptor;
|
||||
|
||||
export = retry;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/timeout" {
|
||||
import rest = require("rest");
|
||||
|
||||
var timeout: rest.Interceptor;
|
||||
|
||||
export = timeout;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/jsonp" {
|
||||
import rest = require("rest");
|
||||
|
||||
var jsonp: rest.Interceptor;
|
||||
|
||||
export = jsonp;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/ie/xdomain" {
|
||||
import rest = require("rest");
|
||||
|
||||
var xdomain: rest.Interceptor;
|
||||
|
||||
export = xdomain;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/ie/xhr" {
|
||||
import rest = require("rest");
|
||||
|
||||
var xhr: rest.Interceptor;
|
||||
|
||||
export = xhr;
|
||||
}
|
||||
|
||||
declare module "rest/mime/registry" {
|
||||
import when = require("when");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user