-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.d.ts
64 lines (55 loc) · 1.36 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import * as restana from 'restana';
declare namespace fastgateway {
type Type = 'http' | 'lambda';
type Method = 'GET' | 'DELETE' | 'PATCH' | 'POST' | 'PUT' | 'HEAD' | 'OPTIONS' | 'TRACE';
interface LambdaProxy {
region?: string;
target?: string;
}
interface Docs {
name: string;
endpoint: string;
type: string;
}
interface Route {
proxyType?: Type;
fastProxy?: {};
lambdaProxy?: LambdaProxy;
proxyHandler?: Function;
http2?: boolean;
pathRegex?: string;
timeout?: number;
prefix: string;
docs?: Docs;
prefixRewrite?: string;
target: string;
methods?: Method[];
middlewares?: Function[];
hooks?: Hooks;
}
interface Hooks {
onRequest?: Function,
rewriteHeaders?: Function,
onResponse?: Function,
rewriteRequestHeaders?: Function,
request?: {
timeout?: number,
[x: string]: any
}
queryString?: string,
[x: string]: any
}
interface Options<P extends restana.Protocol> {
server?: Object | restana.Service<P> | Express.Application;
restana?: {};
middlewares?: Function[];
pathRegex?: string;
timeout?: number;
targetOverride?: string;
routes: Route[];
}
}
declare function fastgateway<P extends restana.Protocol = restana.Protocol.HTTP>(
opts?: fastgateway.Options<P>
): restana.Service<P>;
export = fastgateway;