0

I am using AWS pinpoint service with typescript. And I want to define return type for GetSegmentCommand's output. The docs says that it is exported as this:

export interface GetSegmentCommandOutput extends GetSegmentResponse, MetadataBearer 

But when I try to use it in my project like this:

import { PinpointClient, GetSegmentCommand, GetSegmentCommandOutput } from '@aws-sdk/client-pinpoint'; 

typescript compiler gives off this error: GetSegmentCommandOutput not found in '@aws-sdk/client-pinpoint'

What could be the reason for it.? And if I am making any mistake, how can I do it correctly.?

Looked at the docs of typescript. Confirmed within node_modules package of @aws-sdk/client-pinpoint to verify that they actually export the interface.

2
  • Just tried it without getting any errors. Do you get the error in your IDE or when you run the actual compile (tsc) on the command-line? If an interface can't be loaded, the error normally reads "TS2724: '"@aws-sdk/client-pinpoint"' has no exported member named 'GetSegmentCommandOutput'... " Commented Jul 8, 2024 at 17:22
  • I too tried it with creating a separate project and it works there. But I think it is something related to the es-lint that I am using. ES-lint is not recognising this export, and with my checks setup at the time of commit, eslint doesn't let it pass. I will spend some time on checking it. Commented Jul 10, 2024 at 5:54

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.