Skip to content

Commit 110dff6

Browse files
author
Kahowane
committed
initial
1 parent 07a11ee commit 110dff6

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

index.d.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "2.3.6",
44
"description": "A Node.js API Gateway for the masses!",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"scripts": {
78
"test": "nyc mocha test/*.test.js",
89
"format": "npx standard --fix",

0 commit comments

Comments
 (0)