I'm updating an existing project from V2 to V3 of the AWS SDK for JavaScript and also moving our usage from JavaScript to TypeScript.
I'm struggling to define strongly typed handlers for the Lamdas.
The examples I've found are similar to this. I'm guessing that they're using V2 of the SDK.
export const lambdaHandler = async (event: APIGatewayEvent, context: Context): Promise<APIGatewayProxyResult> => {
return {
statusCode: 200,
body: JSON.stringify({
message: 'hello world',
}),
};
};
I've had a look through the V3 source for classes similar to APIGatewayEvent
, Context
and APIGatewayProxyResult
but nothing jumps out at me as filling those roles.
Can someone please tell me how to strongly type these signatures?