exonum-client icon indicating copy to clipboard operation
exonum-client copied to clipboard

Make it work with Typescript

Open sim4life opened this issue 6 years ago • 5 comments

I'm making use of exonum-client using Typescript on NodeJS v10. I did: $ npm i @types/node --save $ npm i exonum-client --save

Now TSLint is giving me this error:

[ts] Could not find a declaration file for module 'exonum-client'. '/Users/username/workarea/node_proj/project/node_modules/exonum-client/lib/index.js' implicitly has an 'any' type. Try 'npm install @types/exonum-client' if it exists or add a new declaration (.d.ts) file containing 'declare module 'exonum-client';'

I'd request that $ npm i @types/exonum-client is made available. If not, then kindly supply a exonum-client/index.d.ts with exports and declarations done properly.

sim4life avatar May 08 '18 00:05 sim4life

@sim4life Could you please add your code example? And the way how you connect to Exonum lib in your app. Thanks for your feedback

KateNegrienko avatar Jun 20 '18 15:06 KateNegrienko

Thanks for getting back. The basic import of exonum-client doesn't work with typescript: import Exonum = require('exonum-client') //doesn't work import * as Exonum from 'exonum-client'; //doesn't work

sim4life avatar Jun 21 '18 22:06 sim4life

@sim4life I tried to repeat your problem, but my connection to Exonum works correctly. I use exonum-client ^0.10.0, typescript ~2.7.2 and angular ^6.0.3 for sample. So if it possible I need more information about your project (What framework do you use Angular or React?) and about versions of Exonum-client and TS.

KateNegrienko avatar Jun 22 '18 08:06 KateNegrienko

I'm getting this error, with a red curly underlining, on Visual Studio Code with TSLint:

[ts] Could not find a declaration file for module 'exonum-client'. '/Users/username/workarea/node_proj/silsilah/node_modules/exonum-client/lib/index.js' implicitly has an 'any' type. Try 'npm install @types/exonum-client' if it exists or add a new declaration (.d.ts) file containing 'declare module 'exonum-client';

sim4life avatar Jun 27 '18 04:06 sim4life

@sim4life Now we don't have the normal support of ts and we don't have @types/exonum-client. Now you can have a solution to the problem like this https://github.com/Microsoft/TypeScript/issues/15031 We will appreciate if you can help us with support ts 😌

KateNegrienko avatar Jun 27 '18 08:06 KateNegrienko