Skip to content

[BUG] TypeScript enums are handled incorrectly #628

@jabuj-amalytix

Description

@jabuj-amalytix

Environment
JavaScript 1.7.0

Describe the bug
Whenever a enum is used in the type declarations, it refers to an instance of a class, not to a constant

To Reproduce

new PricingSpAoi(...).getCompetitiveSummary({
  requests: [
    {
      method: 'GET',
      // -> The type "string" cannot be assigned to the type "HttpMethod"
      asin: '...',
      marketplaceId: '...',
      includedData: ['featuredBuyingOptions'],
      // -> The type "string" cannot be assigned to the type "CompetitiveSummaryIncludedData"
    }
  ]
})

Expected behavior
No error

Additional context
Note, that HttpMethod and CompetitiveSummaryIncludedData are classes and not enums, so typescript expects an instance of a class here which is weird

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions