We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could you provide type definition for TypeScript?
Add index.d.ts.
index.d.ts
import middy from '@middy/core' type Type = 'string' | 'int' | 'float' | 'bool' type Config = string | [string] | [string, Type] | [string, Type, string] export interface Options { names: Record<string, Config> cache?: boolean cacheExpiryInMillis?: number setToContext?: boolean } declare const env: middy.Middleware<Options, any, any> export default env
Then, add types field to pacakge.json.
types
pacakge.json
{ "types": "index.d.ts" }
The text was updated successfully, but these errors were encountered:
I don't think context can be typed for middy 2.x because it is hard-coded as LambdaContext, only the request event can be typed.
LambdaContext
I think this requires a minor update to add an option to distribute into a new event property, for example event.env, instead.
event.env
Sorry, something went wrong.
Please feel free to raise a PR.
No branches or pull requests
Could you provide type definition for TypeScript?
My idea
Add
index.d.ts
.Then, add
types
field topacakge.json
.See also
The text was updated successfully, but these errors were encountered: