mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 12:42:58 +08:00
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:
committed by
Sheetal Nandi
parent
aa9e285291
commit
1a77542902
18
types/helmet/index.d.ts
vendored
18
types/helmet/index.d.ts
vendored
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user