Update helmet types with support for expect-ct (#18609)

* Update helmet types with support for expect-ct

* Correct helmet expectCt summary
This commit is contained in:
Elliot Blackburn
2017-08-05 00:42:58 +01:00
committed by Sheetal Nandi
parent aa9e285291
commit 1a77542902

View File

@@ -1,6 +1,6 @@
// Type definitions for helmet
// Project: https://github.com/helmetjs/helmet
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>, Evan Hahn <https://github.com/EvanHahn>
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>, Evan Hahn <https://github.com/EvanHahn>, Elliot Blackburn <https://github.com/bluehatbrit>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import express = require('express');
@@ -19,7 +19,8 @@ declare namespace helmet {
ieNoOpen?: boolean,
noCache?: boolean,
noSniff?: boolean,
xssFilter?: boolean | IHelmetXssFilterConfiguration
xssFilter?: boolean | IHelmetXssFilterConfiguration,
expectCt?: boolean | IHelmetExpectCtConfiguration,
}
export interface IHelmetContentSecurityPolicyDirectiveFunction {
@@ -96,6 +97,12 @@ declare namespace helmet {
setOnOldIE?: boolean;
}
export interface IHelmetExpectCtConfiguration {
enforce?: boolean;
maxAge?: number;
reportUri?: string;
}
/**
* @summary Interface for helmet class.
* @interface
@@ -179,5 +186,12 @@ declare namespace helmet {
* @return {RequestHandler} The Request handler.
*/
xssFilter(options?: IHelmetXssFilterConfiguration): express.RequestHandler;
/**
* @summary Adds the "Expect-CT" header.
* @param {helmet.IHelmetExpectCtConfiguration} options
* @returns {e.RequestHandler}
*/
expectCt(options?: IHelmetExpectCtConfiguration): express.RequestHandler;
}
}