@@ -14,18 +14,18 @@ type ErrorResponse = {
1414 message : string ;
1515} ;
1616
17- type HandlerOptions = {
17+ type RequestContext = {
1818 request : Request ;
1919 event : APIGatewayProxyEvent ;
2020 context : Context ;
2121 res : Response ;
2222} ;
2323
24- type ErrorResolveOptions = HandlerOptions & ResolveOptions ;
24+ type ErrorResolveOptions = RequestContext & ResolveOptions ;
2525
2626type ErrorHandler < T extends Error = Error > = (
2727 error : T ,
28- options : HandlerOptions
28+ options : RequestContext
2929) => Promise < ErrorResponse > ;
3030
3131interface ErrorConstructor < T extends Error = Error > {
@@ -59,7 +59,7 @@ type HandlerResponse = Response | JSONObject;
5959type RouteHandler <
6060 TParams = Record < string , unknown > ,
6161 TReturn = HandlerResponse ,
62- > = ( args : TParams , options : HandlerOptions ) => Promise < TReturn > ;
62+ > = ( args : TParams , options : RequestContext ) => Promise < TReturn > ;
6363
6464type HttpMethod = keyof typeof HttpVerbs ;
6565
@@ -84,7 +84,7 @@ type NextFunction = () => Promise<HandlerResponse | void>;
8484
8585type Middleware = (
8686 params : Record < string , string > ,
87- options : HandlerOptions ,
87+ options : RequestContext ,
8888 next : NextFunction
8989) => Promise < void | HandlerResponse > ;
9090
@@ -124,7 +124,7 @@ export type {
124124 HttpMethod ,
125125 Middleware ,
126126 Path ,
127- HandlerOptions ,
127+ RequestContext ,
128128 RouterOptions ,
129129 RouteHandler ,
130130 RouteOptions ,
0 commit comments