Skip to content

Type mismatch with crowdin constructor #508

@ashharrison90

Description

@ashharrison90

Hi! 👋 Somewhat related to #284, both the shipped types and the typescript example currently shown in the README suggest this is possible:

import crowdin from '@crowdin/crowdin-api-client';

const { translationsApi } = new crowdin({
  token: 'token',
  organization: 'org'
});

However that results in a crowdin is not a constructor error. It looks like you have to call new crowdin.default() in order to correctly instantiate the class, like:

import crowdin from '@crowdin/crowdin-api-client';

const { translationsApi } = new crowdin.default({
  token: 'token',
  organization: 'org'
});

I think:

  • the shipped types need updating to reflect this
  • the Typescript example in the README needs updating to reflect this

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions