mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-30 11:14:27 +08:00
Move interfaces into exported module
This commit is contained in:
Vendored
+20
-18
@@ -71,27 +71,29 @@ declare module "rest/interceptor" {
|
||||
import when = require("when");
|
||||
import rest = require("rest");
|
||||
|
||||
// TODO: These two configs should be merged to use union output types.
|
||||
function interceptor(config: interceptor.Config): rest.Interceptor;
|
||||
function interceptor(config: interceptor.PromiseConfig): rest.Interceptor;
|
||||
|
||||
interface Config {
|
||||
init?: (config: any) => any;
|
||||
request?: (request: rest.Request, config: any, meta: rest.Meta) => rest.Request;
|
||||
response?: (response: rest.Response, config: any, meta: rest.Meta) => rest.Response;
|
||||
success?: (response: rest.Response, config: any, meta: rest.Meta) => rest.Response;
|
||||
error?: (response: rest.Response, config: any, meta: rest.Meta) => rest.Response;
|
||||
module interceptor {
|
||||
// TODO: These two configs should be merged to use union output types.
|
||||
|
||||
interface Config {
|
||||
init?: (config: any) => any;
|
||||
request?: (request: rest.Request, config: any, meta: rest.Meta) => rest.Request;
|
||||
response?: (response: rest.Response, config: any, meta: rest.Meta) => rest.Response;
|
||||
success?: (response: rest.Response, config: any, meta: rest.Meta) => rest.Response;
|
||||
error?: (response: rest.Response, config: any, meta: rest.Meta) => rest.Response;
|
||||
}
|
||||
|
||||
interface PromiseConfig {
|
||||
init?: (config: any) => any;
|
||||
request?: (request: rest.Request, config: any, meta: rest.Meta) => when.Promise<rest.Request>;
|
||||
response?: (response: rest.Response, config: any, meta: rest.Meta) => when.Promise<rest.Response>;
|
||||
success?: (response: rest.Response, config: any, meta: rest.Meta) => when.Promise<rest.Response>;
|
||||
error?: (response: rest.Response, config: any, meta: rest.Meta) => when.Promise<rest.Response>;
|
||||
}
|
||||
}
|
||||
|
||||
interface PromiseConfig {
|
||||
init?: (config: any) => any;
|
||||
request?: (request: rest.Request, config: any, meta: rest.Meta) => when.Promise<rest.Request>;
|
||||
response?: (response: rest.Response, config: any, meta: rest.Meta) => when.Promise<rest.Response>;
|
||||
success?: (response: rest.Response, config: any, meta: rest.Meta) => when.Promise<rest.Response>;
|
||||
error?: (response: rest.Response, config: any, meta: rest.Meta) => when.Promise<rest.Response>;
|
||||
}
|
||||
|
||||
function interceptor(config: Config): rest.Interceptor;
|
||||
function interceptor(config: PromiseConfig): rest.Interceptor;
|
||||
|
||||
export = interceptor;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user