restify-cors-middleware: Fix lint (#20914)

This commit is contained in:
Andy
2017-10-23 11:12:47 -07:00
committed by Sheetal Nandi
parent ba1ed4e100
commit 3aec4e16b2
+10 -15
View File
@@ -10,11 +10,20 @@ import { RequestHandler } from 'restify';
declare namespace corsMiddleware {
interface Options {
origins: string[];
/**
* an array of whitelisted origins
* can be both strings and regular expressions
*/
origins: Array<string | RegExp>;
/** user defined headers to allow */
allowHeaders: string[];
/** user defined headers to expose */
exposeHeaders: string[];
/** if true, uses creds */
credentials?: boolean;
/** ms to cache preflight requests */
preflightMaxAge?: number;
/** customize preflight request handling */
preflightStrategy?: any;
}
@@ -24,19 +33,5 @@ declare namespace corsMiddleware {
}
}
/**
* @public
* @param {Object} options an options object
* @param {Array} [options.origins] an array of whitelisted origins, can be
* both strings and regular expressions
* @param {Boolean} [options.credentials] if true, uses creds
* @param {Array} [options.allowHeaders] user defined headers to allow
* @param {Array} [options.exposeHeaders] user defined headers to expose
* @param {Number} [options.preflightMaxAge] ms to cache preflight requests
* @param {Object | Function} [options.preflightStrategy]
* customize preflight request handling
* @returns {Object} returns an object with actual and preflight handlers
*/
declare function corsMiddleware(options: corsMiddleware.Options): corsMiddleware.CorsMiddleware;
export = corsMiddleware;