mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
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:
@@ -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
4
apex.js/index.d.ts
vendored
@@ -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 = λ;
|
||||
|
||||
Reference in New Issue
Block a user