interface exports
soloroman opened this issue · comments
Could you please add interface exports?
I am using my custom wrapper for config selection and I would like to declare types.
There are 2 ways:
- Declare interfaces by myself and when package updates, this is potentially weak place.
- Just export interfaces as many packages do.
function expressHelmet({
options,
serviceCase,
}: {
options?: any // <- I would like to avoid this
serviceCase?: ServiceType;
}) {
return helmet(options || switcher(serviceCase) || {});
}
Unfortunately, I won't be able to export HelmetOptions
in this major version without making a breaking change. Would something like this work for you?
type HelmetOptions = Parameters<typeof helmet>[0];
In the next major version of Helmet, I plan to export this.
I just released Helmet v5.0.0-beta.1 which includes this change. You can now import helmet, { HelmetOptions } from 'helmet'
.
Please give it a try with npm install helmet@5.0.0-beta.1
and let me know if there are any problems! Feel free to reply here or email me@evanhahn.com with any feedback.