@@ -32,12 +32,18 @@ export declare interface FileOptions {
32
32
private ?: boolean ;
33
33
}
34
34
35
+ export declare interface RegisterOptions {
36
+ prefix ?: string ;
37
+ }
38
+
39
+ export type Package = any ;
40
+
35
41
export declare interface App {
36
- [ namespace : string ] : HandlerFunction ;
42
+ [ namespace : string ] : Package ;
37
43
}
38
44
39
45
export declare type Middleware = ( req : Request , res : Response , next : ( ) => void ) => void ;
40
- export declare type ErrorHandlingMiddleware = ( error : Error , req : Request , res : Response , next : ErrorHandlingMiddleware ) => void ;
46
+ export declare type ErrorHandlingMiddleware = ( error : Error , req : Request , res : Response , next : ( ) => void ) => void ;
41
47
export declare type ErrorCallback = ( error ?: Error ) => void ;
42
48
export declare type HandlerFunction = ( req : Request , res : Response , next ?: NextFunction ) => void | any | Promise < any > ;
43
49
export declare type LoggerFunction = ( message : string ) => void ;
@@ -138,6 +144,7 @@ export declare class Request {
138
144
userAgent : string ;
139
145
clientType : 'desktop' | 'mobile' | 'tv' | 'tablet' | 'unknown' ;
140
146
clientCountry : string ;
147
+ namespace : App ;
141
148
142
149
log : {
143
150
trace : LoggerFunction ;
@@ -181,8 +188,8 @@ export declare class Response {
181
188
}
182
189
183
190
export declare class API {
184
- app ( namespace : string , handler : HandlerFunction ) : App ;
185
- app ( options : App ) : App ;
191
+ app ( namespace : string , package : Package ) : App ;
192
+ app ( packages : App ) : App ;
186
193
187
194
get ( path : string , ...handler : HandlerFunction [ ] ) : void ;
188
195
get ( ...handler : HandlerFunction [ ] ) : void ;
@@ -202,7 +209,10 @@ export declare class API {
202
209
any ( ...handler : HandlerFunction [ ] ) : void ;
203
210
METHOD ( method : METHODS , path : string , ...handler : HandlerFunction [ ] ) : void ;
204
211
METHOD ( method : METHODS , ...handler : HandlerFunction [ ] ) : void ;
205
-
212
+ register ( routes : ( api : API , options ?: RegisterOptions ) => void , options ?: RegisterOptions ) : void ;
213
+ routes ( format : true ) : void ;
214
+ routes ( format : false ) : string [ ] [ ] ;
215
+ routes ( ) : string [ ] [ ] ;
206
216
207
217
208
218
0 commit comments