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

Expose TypeScript definitions so that they are easily accessible #5

Open
Xstoudi opened this issue Jan 15, 2016 · 6 comments
Open

Expose TypeScript definitions so that they are easily accessible #5

Xstoudi opened this issue Jan 15, 2016 · 6 comments

Comments

@Xstoudi
Copy link

Xstoudi commented Jan 15, 2016

Hey,
Is there a way to use the module with typescript's import ?
Thanks

@WasabiFan
Copy link
Owner

The .d.ts files should be included with the module on npm. So, if you have installed the module locally, browse to the path <project location>/node_modules/ev3dev-lang/bin (where <project location> is the place where you npm installed from) to see them. To use them from an IDE, you can either reference that relative path (the one listed above) or copy the definition files to your project directory and use them from there.

Do you think it would be helpful if I published the .d.ts files in the repo as well?

@Xstoudi
Copy link
Author

Xstoudi commented Jan 15, 2016

Nop, but the way you use to make your import are outdated...
After correct this, you can contribute to DefinitelyTyped/DefinitelyTyped to everybody can install with

tsd install ev3dev-lang

I'll maybe make a PR here this week-end to update definitions and on DefinitelyTyped to publish them, if it's okay to you :)

@WasabiFan
Copy link
Owner

Nop, but the way you use to make your import are outdated...

What do you mean? If there's something that I can be doing better, I'd be happy to hear it -- I am not by any means a TypeScript expert.

After correct this, you can contribute to DefinitelyTyped/DefinitelyTyped to everybody can install with

I was resisting doing that because so few people use this module at the moment -- most people who are on ev3dev are using Python. So I just didn't want to "pollute" DefinitelyTyped until there were more people that would benefit from it. But I'd be happy to try to get ev3dev-lang-js published there if you think it's useful.

I'll maybe make a PR here this week-end to update definitions and on DefinitelyTyped to publish them, if it's okay to you :)

Of course! I'll always accept PRs. But please don't open a PR against DefinitelyTyped yet so that we can make sure that the import/exports are how they should be and have some time to discuss.

@Xstoudi
Copy link
Author

Xstoudi commented Jan 16, 2016

What do you mean? If there's something that I can be doing better, I'd be happy to hear it -- I am not by any means a TypeScript expert.

The TSC v1.6.2 return this error on Visual Studio Code :
Error
Check your version with tsc --version ^^

I was resisting doing that because so few people use this module at the moment -- most people who are on ev3dev are using Python. So I just didn't want to "pollute" DefinitelyTyped until there were more people that would benefit from it. But I'd be happy to try to get ev3dev-lang-js published there if you think it's useful.

I think you wont must worry about this, but whatever, it's your choice. ^^

Of course! I'll always accept PRs. But please don't open a PR against DefinitelyTyped yet so that we can make sure that the import/exports are how they should be and have some time to discuss.
No problem.

@WasabiFan
Copy link
Owner

The TSC v1.6.2 return this error on Visual Studio Code :

Try changing your TypeScript settings for the project to target EcmaScript 5 instead. Because newer versions of Node don't support old ARM processors, we can't run ES6 on the EV3 😢 If the TypeScript transpiler is nice enough to convert ES6 code into ES5, that shouldn't be a problem; but if it isn't, we will be needing to stick with ES5 features.

@Xstoudi
Copy link
Author

Xstoudi commented Jan 16, 2016

It works, thanks :)

@WasabiFan WasabiFan changed the title Typescript definitons Expose TypeScript definitions so that they are easily accessible Apr 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants