mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
restify-cors-middleware: Fix lint (#20914)
This commit is contained in:
+10
-15
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user