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

Provide typescript type definitions #2839

Closed
rklaehn opened this issue Sep 27, 2018 · 12 comments
Closed

Provide typescript type definitions #2839

rklaehn opened this issue Sep 27, 2018 · 12 comments

Comments

@rklaehn
Copy link

rklaehn commented Sep 27, 2018

This would be extremely helpful. I have worked with both flow and typescript. Flow has some theoretical advantages, but typescript has way better tooling support and mindshare, which is why I reluctantly switched to typescript.

Please provide typescript type definitions just for the API. That would be extremely helpful.

@sweetpalma
Copy link

sweetpalma commented Nov 28, 2018

I second this - type definition absence turns IPFS usage into a complete nightmare on TypeScript projects. I've seen a couple of stubs like that around the GitHub:

https://github.com/beenotung/typestub-ipfs

Probably we can take some of them as a base and modify it for ipfs-api?

@ondratra
Copy link

ondratra commented Apr 3, 2019

We could start by merging stub @sweetpalma mentioned and then add/tweak definitions as we discover missing parts or mismatches.

@daviddias would you be willing to accept PR with minimum typings if i prepare it?

@alanshaw
Copy link
Member

alanshaw commented Apr 3, 2019

@ondratra what would the PR involve? I'm keen to make it easier for typescript users but I do not want to add any extra overhead for contributors who do not use typescript.

Do they need to live in this repo and can we share them with https://github.com/ipfs/js-ipfs?

@ondratra
Copy link

ondratra commented Apr 11, 2019

I was thinking about starting with code @sweetpalma linked and create typings for API only of js-ipfs-http-client. But you have a good point that typings don't need to be in this repository. I will learn about process of creating @types/js-ipfs-http-client package and put all typings there.

@beenotung
Copy link

beenotung commented Apr 24, 2019

I created typestub-ipfs as a standalone repo, instead of under DefinitelyTyped becuaue their approval process is too complicated for me, especially for a new project (as oppo to update existing one).

I am aware of the benefit if it get merged into DefinitelyTyped though.

@rigwild
Copy link

rigwild commented Feb 21, 2020

Hey, would love some typings too! 👍

Found this abandoned PR in DefinitelyTyped repo: DefinitelyTyped/DefinitelyTyped#38308

It may be reused.

@hugomrdias
Copy link
Member

hugomrdias commented Feb 23, 2020

We made typescript support a priority for the next months I'll personally be working on this and would love some help and feedback from you all.

My primary objective is to find the best way to provide accurate and up to date type definitions. It's really important to not make types generation a big burden so we can keep it always in sync with the code.

We want a long term solution to provide the best support for the typescript community.

I have a couple of ideas to do this but I'm gonna need your help to make this work.

What is the best way to validate that type definitions are accurate? Is tsc --no-emit enough? Do we need type definitions tests to actually be useful?

@achingbrain achingbrain transferred this issue from ipfs-inactive/js-ipfs-http-client Mar 9, 2020
@mfcodeworks
Copy link

mfcodeworks commented Mar 14, 2020

We made typescript support a priority for the next months I'll personally be working on this and would love some help and feedback from you all.

My primary objective is to find the best way to provide accurate and up to date type definitions. It's really important to not make types generation a big burden so we can keep it always in sync with the code.

We want a long term solution to provide the best support for the typescript community.

I have a couple of ideas to do this but I'm gonna need your help to make this work.

What is the best way to validate that type definitions are accurate? Is tsc --no-emit enough? Do we need type definitions tests to actually be useful?

Any progress or ETA?
I just published a library for IPFS usage in NestJS typescript framework for node.js, so this would be extremely useful

@hugomrdias
Copy link
Member

hugomrdias commented Mar 15, 2020

its in progress, will happen soon.

@sr229
Copy link

sr229 commented Apr 29, 2020

Can we get an ETA? This has been a blocker for our project and it would be nice if we could get some progress right now.

@achingbrain
Copy link
Member

achingbrain commented Apr 30, 2020

This is a high priority item on @hugomrdias's list for this quarter - please follow #2945 for updates.

@hugomrdias
Copy link
Member

hugomrdias commented May 21, 2020

Closing this one in favor of #2945

Thanks you all 🙏

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

No branches or pull requests

10 participants