Open
Description
Is your feature request related to a problem?
It's currently not possible to export a function form a typescript module when calling Agent#lambda
because the interface AwsLambda#Context
(defined in-line) is not exported in index.d.ts
.
// Typescript file: some-app.ts
import apm = require('elastic-apm-node');
const apmInstance = apm.start();
export const run = apmInstance.lambda({} as any); // ERROR: Exported variable 'run' has or is using name 'AwsLambda.Context' from external module [...]
Describe the solution you'd like
AwsLambda
could potentially be exported (?). Might be tricky since we currently export a default agent with export =
.
Describe alternatives you've considered
- Currently hacking by adding
as any
when exporting function from typescript file.
export const run = apmInstance.lambda({} as any) as any;
- Directly exporting AwsLambda but blocked by default export of
Agent