I am building a typescript project on aws lambda. As aws-sdk comes with type definitions already I would expect it also to hold a definition for aws lambda. But I seem to have to install @types/aws-lambda separately for it to work.
//import { Lambda } from "aws-sdk";
import { Context } from "aws-lambda";
module.exports.hello = async (event:any, context:Context) => {
return {
statusCode: 200,
body: JSON.stringify({
message: 'function executed successfully!',
input: event,
}),
};
};
I would expect something like this being possible:
import { Lambda } from "aws-sdk";
module.exports.hello = async (event:any, context:Lambda.Context) => {
return {
statusCode: 200,
body: JSON.stringify({
message: 'function executed successfully!',
input: event,
}),
};
};
but it is not ;)
So How do I do it correctly?