@@ -14,18 +14,18 @@ type ErrorResponse = {
14
14
message : string ;
15
15
} ;
16
16
17
- type HandlerOptions = {
17
+ type RequestContext = {
18
18
request : Request ;
19
19
event : APIGatewayProxyEvent ;
20
20
context : Context ;
21
21
res : Response ;
22
22
} ;
23
23
24
- type ErrorResolveOptions = HandlerOptions & ResolveOptions ;
24
+ type ErrorResolveOptions = RequestContext & ResolveOptions ;
25
25
26
26
type ErrorHandler < T extends Error = Error > = (
27
27
error : T ,
28
- options : HandlerOptions
28
+ options : RequestContext
29
29
) => Promise < ErrorResponse > ;
30
30
31
31
interface ErrorConstructor < T extends Error = Error > {
@@ -59,7 +59,7 @@ type HandlerResponse = Response | JSONObject;
59
59
type RouteHandler <
60
60
TParams = Record < string , unknown > ,
61
61
TReturn = HandlerResponse ,
62
- > = ( args : TParams , options : HandlerOptions ) => Promise < TReturn > ;
62
+ > = ( args : TParams , options : RequestContext ) => Promise < TReturn > ;
63
63
64
64
type HttpMethod = keyof typeof HttpVerbs ;
65
65
@@ -84,7 +84,7 @@ type NextFunction = () => Promise<HandlerResponse | void>;
84
84
85
85
type Middleware = (
86
86
params : Record < string , string > ,
87
- options : HandlerOptions ,
87
+ options : RequestContext ,
88
88
next : NextFunction
89
89
) => Promise < void | HandlerResponse > ;
90
90
@@ -124,7 +124,7 @@ export type {
124
124
HttpMethod ,
125
125
Middleware ,
126
126
Path ,
127
- HandlerOptions ,
127
+ RequestContext ,
128
128
RouterOptions ,
129
129
RouteHandler ,
130
130
RouteOptions ,
0 commit comments