Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/configure.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { RequestListener } from "http";
import { Handler } from "aws-lambda";
import Logger from "./logger";
import Framework from "./frameworks";

type EventSources = "AWS_SNS" | "AWS_DYNAMODB";

Expand All @@ -18,12 +19,23 @@ interface BinarySettings {
isBinary?: Function | boolean;
contentTypes?: string[];
}

interface LogSettings {
level: string;
}

interface ConfigureParams {
app: RequestListener;
logSettings?: LogSettings;
log?: Logger;
framework?: Framework;
binaryMimeTypes?: string[];
binarySettings?: BinarySettings;
resolutionMode?: string;
eventSourceName?: string;
eventSource?: EventSource; // TODO:
eventSourceRoutes?: { [key in EventSources]?: string };
respondWithErrors?: boolean;
}

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

declare function configure<TEvent = any, TResult = any>(configureParams: ConfigureParams): Handler<TEvent, TResult> & ConfigureResult<TEvent, TResult>;
declare function configure<TEvent = any, TResult = any>(
configureParams: ConfigureParams
): Handler<TEvent, TResult> & ConfigureResult<TEvent, TResult>;

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

Expand Down
5 changes: 5 additions & 0 deletions src/frameworks/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
interface Framework {
sendRequest: (handler: { request: any; response: any }) => void;
}

export default Framework;