Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it work with Typescript #99

Open
sim4life opened this issue May 8, 2018 · 5 comments
Open

Make it work with Typescript #99

sim4life opened this issue May 8, 2018 · 5 comments
Assignees

Comments

@sim4life
Copy link

sim4life commented May 8, 2018

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.

@KateNegrienko
Copy link
Contributor

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

@sim4life
Copy link
Author

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

@KateNegrienko
Copy link
Contributor

@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.

@sim4life
Copy link
Author

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';

@KateNegrienko
Copy link
Contributor

@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 microsoft/TypeScript#15031
We will appreciate if you can help us with support ts 😌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants