Add definitions for restify's conditionalHandler plugin

This commit is contained in:
leanazulyoro
2018-04-16 10:28:18 -03:00
parent 7f0811ae8e
commit 04b8281f87
+12 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for restify 5.0
// Project: https://github.com/restify/node-restify
// Definitions by: Bret Little <https://github.com/blittle>, Steve Hipwell <https://github.com/stevehipwell>
// Definitions by: Bret Little <https://github.com/blittle>, Steve Hipwell <https://github.com/stevehipwell>, Leandro Almeida <https://github.com/leanazulyoro>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -946,6 +946,17 @@ export namespace plugins {
*/
function authorizationParser(options?: any): RequestHandler;
interface HandlerCandidate {
handler: RequestHandler | RequestHandler[];
version?: string | string[];
contentType?: string | string[];
}
/**
* Runs first handler that matches to the condition
*/
function conditionalHandler(candidates: HandlerCandidate | HandlerCandidate[]): RequestHandler[];
/**
* Conditional headers (If-*)
*/