Skip to content

Commit 093af02

Browse files
fix(types): add missing config params (#486) (#488)
1 parent 5c1e0a5 commit 093af02

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/configure.d.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { RequestListener } from "http";
22
import { Handler } from "aws-lambda";
33
import Logger from "./logger";
4+
import Framework from "./frameworks";
45

56
type EventSources = "AWS_SNS" | "AWS_DYNAMODB";
67

@@ -18,12 +19,23 @@ interface BinarySettings {
1819
isBinary?: Function | boolean;
1920
contentTypes?: string[];
2021
}
22+
23+
interface LogSettings {
24+
level: string;
25+
}
26+
2127
interface ConfigureParams {
2228
app: RequestListener;
29+
logSettings?: LogSettings;
30+
log?: Logger;
31+
framework?: Framework;
2332
binaryMimeTypes?: string[];
2433
binarySettings?: BinarySettings;
34+
resolutionMode?: string;
35+
eventSourceName?: string;
2536
eventSource?: EventSource; // TODO:
2637
eventSourceRoutes?: { [key in EventSources]?: string };
38+
respondWithErrors?: boolean;
2739
}
2840

2941
interface BinarySettings {
@@ -37,7 +49,9 @@ interface ConfigureResult<TEvent = any, TResult = any> {
3749
proxy: (proxyParams: ProxyParams) => Promise<Object>;
3850
}
3951

40-
declare function configure<TEvent = any, TResult = any>(configureParams: ConfigureParams): Handler<TEvent, TResult> & ConfigureResult<TEvent, TResult>;
52+
declare function configure<TEvent = any, TResult = any>(
53+
configureParams: ConfigureParams
54+
): Handler<TEvent, TResult> & ConfigureResult<TEvent, TResult>;
4155

4256
// declare function proxy(proxyParams: ProxyParams): Promise<any>
4357

src/frameworks/index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
interface Framework {
2+
sendRequest: (handler: { request: any; response: any }) => void;
3+
}
4+
5+
export default Framework;

0 commit comments

Comments
 (0)