BrasilAPI / cep-promise

Busca por CEP integrado diretamente aos serviços dos Correios, ViaCEP e outros (Node.js e Browser)
MIT License
2.88k stars 316 forks source link

[Typescript] Cannot use namespace 'cep' as a value.ts #245

Open lucasltv opened 2 years ago

lucasltv commented 2 years ago

Someone else has the same problem when using with Typescript?

Steps to reproduce:

import cep, { CEP } from 'cep-promise';

....

const data = await cep(str, {});

Version: 4.1.2

I think that is a conflict definition for library.

lucasltv commented 2 years ago

Just a workaround, adding the ts ignore next line comment:

// @ts-ignore: Unreachable code error
const data: CEP = await cep(str, {});
victorfernandesraton commented 2 years ago

@lucasltv you should try cep-any project

https://github.com/victorfernandesraton/cep-any

henriquemachad0 commented 1 year ago

Someone else has the same problem when using with Typescript?

Steps to reproduce:

import cep, { CEP } from 'cep-promise';

....

const data = await cep(str, {});

Version: 4.1.2

I think that is a conflict definition for library.

Someone else has the same problem when using with Typescript?

Steps to reproduce:

import cep, { CEP } from 'cep-promise';

....

const data = await cep(str, {});

Version: 4.1.2

I think that is a conflict definition for library.

Someone else has the same problem when using with Typescript?

Steps to reproduce:

import cep, { CEP } from 'cep-promise';

....

const data = await cep(str, {});

Version: 4.1.2

I think that is a conflict definition for library.

Same problem here