luzzif / binance-api-client

A wrapper which can be used to interact with Binance's API. Entirely developed in TypeScript.
24 stars 12 forks source link

in my machine the type inference fails with this package, all types appears as any #120

Closed cocodrino closed 4 years ago

cocodrino commented 4 years ago

Hi, something really weird happens with this package, I've installed this through yarn, I set a binanceClient property as the type BinanceApiClient, the editor doesn't show any error nor warning, but it's treating the property as any...and all the types from binance-api-client in my editor appears as any (first time that this happens to me)

import {BinanceApiClient} from 'binance-api-client';

export class Binance {
  binanceClient : BinanceApiClient;

  constructor() {
    this.binanceClient = new BinanceApiClient(....)
    this.binanceClient.getExchangeInfo();

image

I've posted a question on StackOverflow, but I think that it's something related to the package because other libraries work ok, do you know what could be happening and how to solve it?

right now I've copied the files inside my project, pretty weird but it works ok in that way

thank you so much...

cocodrino commented 4 years ago

according to TS project manager seems that the shipped d.ts file has some trouble

https://github.com/microsoft/TypeScript/issues/39901

luzzif commented 4 years ago

Hi man, thanks for the heads up. I should have fixed the problem in the latest version (2.10.1). I tested it locally and it works as expected. Waiting for a feedback to actually close the issue, just in case.

image

cocodrino commented 4 years ago

hi @luzzif tested and it's working fine...thank you 👍