Skip to content

Commit a2b471a

Browse files
authored
Merge pull request spring-media#4 from WeltN24/typescript-types
Typescript types
2 parents bcfc8e5 + c50f25d commit a2b471a

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

index.d.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Type definitions for aws-lambda-router
2+
// Project: github.com/WeltN24/aws-lambda-router
3+
4+
export function handler(routeConfig: RouteConfig): any;
5+
6+
export interface ProxyIntegrationRoute {
7+
path: string;
8+
method: string;
9+
action?: (request: any) => any;
10+
}
11+
12+
export interface ProxyIntegrationConfig {
13+
cors: boolean;
14+
routes: ProxyIntegrationRoute[];
15+
debug?: boolean;
16+
errorMapping?: any;
17+
defaultHeaders?: string;
18+
}
19+
20+
export interface SnsRoute {
21+
subject: any;
22+
action?: (sns: any) => any;
23+
}
24+
25+
export interface SnsConfig {
26+
routes: SnsRoute[];
27+
debug?: boolean;
28+
}
29+
30+
export interface RouteConfig {
31+
proxyIntegration: ProxyIntegrationConfig;
32+
sns: SnsConfig;
33+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "aws-lambda-router",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "AWS lambda router",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"scripts": {
78
"test": "gulp test"
89
},

0 commit comments

Comments
 (0)