diff --git a/src/configure.d.ts b/src/configure.d.ts index 4ad0088a..620a13f6 100644 --- a/src/configure.d.ts +++ b/src/configure.d.ts @@ -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"; @@ -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 { @@ -37,7 +49,9 @@ interface ConfigureResult { proxy: (proxyParams: ProxyParams) => Promise; } -declare function configure(configureParams: ConfigureParams): Handler & ConfigureResult; +declare function configure( + configureParams: ConfigureParams +): Handler & ConfigureResult; // declare function proxy(proxyParams: ProxyParams): Promise diff --git a/src/frameworks/index.d.ts b/src/frameworks/index.d.ts new file mode 100644 index 00000000..747ab8c6 --- /dev/null +++ b/src/frameworks/index.d.ts @@ -0,0 +1,5 @@ +interface Framework { + sendRequest: (handler: { request: any; response: any }) => void; +} + +export default Framework;