From 15e11d28d3e74193e820a9504f77619f50f6019c Mon Sep 17 00:00:00 2001 From: Shawn Sparks <46322400+shawnsparks-work@users.noreply.github.com> Date: Wed, 3 Mar 2021 15:54:48 -0600 Subject: [PATCH] fix(types): enhance accuracy of type definitions (#379) --- src/configure.d.ts | 2 +- src/current-invoke.d.ts | 6 ++++++ src/index.d.ts | 6 ++++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 src/current-invoke.d.ts diff --git a/src/configure.d.ts b/src/configure.d.ts index 81b27b87..af49503e 100644 --- a/src/configure.d.ts +++ b/src/configure.d.ts @@ -34,7 +34,7 @@ interface ConfigureResult { proxy: (proxyParams: ProxyParams) => Promise; } -declare function configure(configureParams: ConfigureParams): ConfigureResult; +declare function configure(configureParams: ConfigureParams): Handler & ConfigureResult; // declare function proxy(proxyParams: ProxyParams): Promise diff --git a/src/current-invoke.d.ts b/src/current-invoke.d.ts new file mode 100644 index 00000000..df8042f9 --- /dev/null +++ b/src/current-invoke.d.ts @@ -0,0 +1,6 @@ +export interface CurrentInvoke { + event?: any; + context?: any; +} + +export declare function getCurrentInvoke(): CurrentInvoke; diff --git a/src/index.d.ts b/src/index.d.ts index cc29a04d..fc33b76d 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,3 +1,5 @@ -import Configure from "./configure" +import configure from "./configure" -export = Configure \ No newline at end of file +export default configure; +export { default as configure } from "./configure" +export { getCurrentInvoke } from "./current-invoke"