File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ import * as restana from 'restana' ;
2
+
3
+ declare namespace fastgateway {
4
+ type Type = 'http' | 'lambda' ;
5
+
6
+ type Method = 'GET' | 'DELETE' | 'PATCH' | 'POST' | 'PUT' | 'HEAD' | 'OPTIONS' | 'TRACE' ;
7
+
8
+ interface LambdaProxy {
9
+ region ?: string ;
10
+ target ?: string ;
11
+ }
12
+
13
+ interface Docs {
14
+ name : string ;
15
+ endpoint : string ;
16
+ type : string ;
17
+ }
18
+
19
+ interface Route {
20
+ proxyType ?: Type ;
21
+ fastProxy ?: { } ;
22
+ lambdaProxy ?: LambdaProxy ;
23
+ proxyHandler ?: Function ;
24
+ http2 ?: boolean ;
25
+ pathRegex ?: string ;
26
+ timeout ?: number ;
27
+ prefix : string ;
28
+ docs ?: Docs ;
29
+ prefixRewrite ?: string ;
30
+ target : string ;
31
+ methods ?: Method [ ] ;
32
+ middlewares ?: Function [ ] ;
33
+ hooks ?: { } ;
34
+ }
35
+
36
+ interface Options < P extends restana . Protocol > {
37
+ server ?: restana . Server < P > ;
38
+ restana ?: { } ;
39
+ middlewares ?: Function [ ] ;
40
+ pathRegex ?: string ;
41
+ timeout ?: number ;
42
+ targetOverride ?: string ;
43
+ routes : Route [ ] ;
44
+ }
45
+ }
46
+
47
+ declare function fastgateway < P extends restana . Protocol = restana . Protocol . HTTP > (
48
+ opts ?: fastgateway . Options < P >
49
+ ) : restana . Service < P > ;
50
+
51
+ export = fastgateway ;
Original file line number Diff line number Diff line change 3
3
"version" : " 2.3.7" ,
4
4
"description" : " A Node.js API Gateway for the masses!" ,
5
5
"main" : " index.js" ,
6
+ "types" : " index.d.ts" ,
6
7
"scripts" : {
7
8
"test" : " nyc mocha test/*.test.js" ,
8
9
"format" : " npx standard --fix" ,
You can’t perform that action at this time.
0 commit comments