fix type definition for package: apex.js (#13825)

* fix `export default` issue

* use `namespace` instead of (internal) `module`

* write it as an external module
This commit is contained in:
Yoriki Yamaguchi
2017-01-07 22:01:39 +09:00
committed by Andy
parent e90374421a
commit 1af69c47fb
2 changed files with 9 additions and 4 deletions

View File

@@ -1,5 +1,8 @@
import λ from "apex.js";
import * as λ from "apex.js";
const handler = λ(event => {
console.log("Invoked with event " + JSON.stringify(event));
const handler = λ((event, context) => {
console.log("Event: " + JSON.stringify(event));
console.log("Context: " + JSON.stringify(context));
return {event, context};
});

4
apex.js/index.d.ts vendored
View File

@@ -5,4 +5,6 @@
/// <reference types="aws-lambda" />
export default function λ(fn: (event: any, context: AWSLambda.Context) => any): (event: any, context: AWSLambda.Context, callback: AWSLambda.Callback) => void;
declare function λ(fn: (event: any, context: AWSLambda.Context) => any): (event: any, context: AWSLambda.Context, callback: AWSLambda.Callback) => void;
declare namespace λ {}
export = λ;