@@ -27,7 +27,7 @@ export declare interface FileOptions {
27
27
maxAge ?: number ;
28
28
root ?: string ;
29
29
lastModified ?: boolean | string ;
30
- headers ?: { } ;
30
+ headers ?: { [ key : string ] : string } ;
31
31
cacheControl ?: boolean | string ;
32
32
private ?: boolean ;
33
33
}
@@ -36,10 +36,10 @@ export declare interface App {
36
36
[ namespace : string ] : HandlerFunction ;
37
37
}
38
38
39
- export declare type Middleware = ( req : Request , res : Response , next : Middleware ) => void ;
39
+ export declare type Middleware = ( req : Request , res : Response , next : ( ) => void ) => void ;
40
40
export declare type ErrorHandlingMiddleware = ( error : Error , req : Request , res : Response , next : ErrorHandlingMiddleware ) => void ;
41
41
export declare type ErrorCallback = ( error ?: Error ) => void ;
42
- export declare type HandlerFunction = ( req ? : Request , res ? : Response , next ?: NextFunction ) => void | { } | Promise < { } > ;
42
+ export declare type HandlerFunction = ( req : Request , res : Response , next ?: NextFunction ) => void | any | Promise < any > ;
43
43
export declare type LoggerFunction = ( message : string ) => void ;
44
44
export declare type NextFunction = ( ) => void ;
45
45
export declare type TimestampFunction = ( ) => string ;
@@ -80,7 +80,7 @@ export declare interface LoggerOptions {
80
80
rules ?: SamplingOptions [ ] ;
81
81
} ;
82
82
serializers ?: {
83
- [ name : string ] : ( req : Request ) => { } ;
83
+ [ name : string ] : ( prop : any ) => any ;
84
84
} ;
85
85
stack ?: boolean ;
86
86
}
@@ -100,17 +100,21 @@ export declare class Request {
100
100
app : API ;
101
101
version : string ;
102
102
id : string ;
103
- params : { } ;
103
+ params : {
104
+ [ key : string ] : string | undefined ;
105
+ } ;
104
106
method : string ;
105
107
path : string ;
106
108
query : {
107
- [ key : string ] : string ;
109
+ [ key : string ] : string | undefined ;
108
110
} ;
109
111
headers : {
110
- [ key : string ] : string ;
112
+ [ key : string ] : string | undefined ;
111
113
} ;
112
- rawHeaders ?: { } ;
113
- body : { } | string ;
114
+ rawHeaders ?: {
115
+ [ key : string ] : string | undefined ;
116
+ } ;
117
+ body : any ;
114
118
rawBody : string ;
115
119
route : '' ;
116
120
requestContext : APIGatewayEventRequestContext ;
@@ -119,8 +123,8 @@ export declare class Request {
119
123
stageVariables : { [ name : string ] : string } | null ;
120
124
auth : {
121
125
[ key : string ] : any ;
122
- type : 'Bearer' | 'Basic' | 'OAuth' | 'Digest' ;
123
- value : string ;
126
+ type : 'Bearer' | 'Basic' | 'OAuth' | 'Digest' | 'none' ;
127
+ value : string | null ;
124
128
} ;
125
129
cookies : {
126
130
[ key : string ] : CookieOptions ;
@@ -141,10 +145,13 @@ export declare class Request {
141
145
error : LoggerFunction ;
142
146
fatal : LoggerFunction ;
143
147
} ;
148
+
149
+ [ key : string ] : any ;
144
150
}
145
151
146
152
export declare class Response {
147
153
status ( code : number ) : this;
154
+ sendStatus ( code : number ) : void ;
148
155
header ( key : string , value : string ) : this;
149
156
getHeader ( key : string ) : string ;
150
157
hasHeader ( key : string ) : boolean ;
0 commit comments