diff --git a/packages/http-router/index.d.ts b/packages/http-router/index.d.ts index 421460250..98d9db85d 100644 --- a/packages/http-router/index.d.ts +++ b/packages/http-router/index.d.ts @@ -8,16 +8,7 @@ import { Handler as LambdaHandler } from 'aws-lambda' -export enum Method { - Get = 'GET', - Post = 'POST', - Put = 'PUT', - Patch = 'PATCH', - Delete = 'DELETE', - Options = 'OPTIONS', - Head = 'HEAD', - Any = 'ANY' -} +export type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'ANY' type TResult = ALBResult | APIGatewayProxyResult diff --git a/packages/http-router/index.test-d.ts b/packages/http-router/index.test-d.ts index 14dd5f77f..dfc1fc67e 100644 --- a/packages/http-router/index.test-d.ts +++ b/packages/http-router/index.test-d.ts @@ -1,6 +1,6 @@ import { expectType } from 'tsd' import middy from '@middy/core' -import httpRouterHandler, { Method } from '.' +import httpRouterHandler from '.' import { APIGatewayProxyEvent, APIGatewayProxyResult, @@ -16,7 +16,7 @@ const lambdaHandler: LambdaHandler const middleware = httpRouterHandler([ { - method: Method.Get, + method: 'GET', path: '/', handler: lambdaHandler }