From 647f01024a1f0c6ffb9e4626ac33e7b34639334c Mon Sep 17 00:00:00 2001 From: Murat Corlu Date: Fri, 31 Jan 2020 15:28:08 +0100 Subject: [PATCH] fix: Proper type definition for returned callback --- package-lock.json | 6 +++--- package.json | 2 +- src/lambda-wrapper.d.ts | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index afc71d0..41af9b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -764,9 +764,9 @@ } }, "@types/aws-lambda": { - "version": "8.10.33", - "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.33.tgz", - "integrity": "sha512-BZ8lPY/vyUq+Bid/BgYrKbUF36SZYuGOAMgOq/VgqnTQnCn9GBo3HejKZ6xrUzA8zLf9Pjs707amkt4f7rWujw==", + "version": "8.10.40", + "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.40.tgz", + "integrity": "sha512-D0hOUw2y6in/cPWv0JMMCBnO3Hc/DNeLi8QQ1wymwk9Eixh6IFgVnCGJnUHefjxKEAVxL7z6LKBsFUrIjKygRg==", "dev": true }, "@types/babel__core": { diff --git a/package.json b/package.json index 9f810c2..beed0c1 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "homepage": "https://github.com/muratcorlu/lambda-expressless#readme", "devDependencies": { "@types/accepts": "^1.3.5", - "@types/aws-lambda": "^8.10.33", + "@types/aws-lambda": "^8.10.40", "@types/connect": "^3.4.33", "body-parser": "^1.19.0", "jest": "^24.9.0", diff --git a/src/lambda-wrapper.d.ts b/src/lambda-wrapper.d.ts index 55ff65a..f1d556c 100644 --- a/src/lambda-wrapper.d.ts +++ b/src/lambda-wrapper.d.ts @@ -1,8 +1,11 @@ import { Request } from './request'; import { Response } from './response'; -import { APIGatewayProxyHandler } from 'aws-lambda'; +import { APIGatewayProxyEvent, Context, APIGatewayProxyResult } from 'aws-lambda'; import { NextFunction, NextHandleFunction } from "connect"; +export interface APIGatewayProxyHandler { + (event: APIGatewayProxyEvent, context: Context): Promise +} export interface Middleware extends NextHandleFunction { (request: Request, response: Response, next: NextFunction): void