Skip to content

Typescript - Unable to export Agent#lambda(...) from client library due to absence of exported inline AwsLambda.Context. #977

Open
@willbrazil

Description

@willbrazil

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

  1. Currently hacking by adding as any when exporting function from typescript file.
export const run = apmInstance.lambda({} as any) as any;
  1. Directly exporting AwsLambda but blocked by default export of Agent

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions