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

Support for Typescript typings #59

Open
t-ricci-enhancers opened this issue Dec 31, 2019 · 7 comments
Open

Support for Typescript typings #59

t-ricci-enhancers opened this issue Dec 31, 2019 · 7 comments

Comments

@t-ricci-enhancers
Copy link

t-ricci-enhancers commented Dec 31, 2019

This library doesn't have support for Typescript's type definitions, right?

Is it planned to add those?

I don't see any community-provided typings on DefinitelyTyped

@mfirry
Copy link
Collaborator

mfirry commented Dec 31, 2019

My two cents:

for a little I bit I enjoyed flow.org and tried to add types (for flow) to paths-js (under a loose supervision from @andreaferretti).
Here's what's left https://github.com/mfirry/typed-paths-js

It's definitely doable to add Typescript typing to paths-js and actually somebody started doing it years ago (https://github.com/bdedardel/paths-typescript).

I don't think @andreaferretti is willing to do it, but It shouldn't be so hard and paths-js itself is not going to change that much so.

@t-ricci-enhancers
Copy link
Author

t-ricci-enhancers commented Dec 31, 2019

I could give a hand in writing typings (I'll also check the flowtypes you posted), but I haven't used the library much and the documentation doesn't seem to be precise about expected types. I'll see what I can do when I have some time... I'm currently working on a fork of a react-native library which uses paths-js, and I'm porting that from JS to TS and that's why I figured the type definitions for paths-js are missing

@andreaferretti
Copy link
Owner

Hi @t-ricci-enhancers , in fact there are Scala JS bindings here, so the library is fully typed. The type system for Scala JS and Typescript are not the same, but it should be doable to translate from one to another.

the documentation doesn't seem to be precise about expected types

Can you point me to an instance of this? I have tried to be precise about the shape of expected inputs and outputs for all components, but maybe I missed something

@t-ricci-enhancers
Copy link
Author

t-ricci-enhancers commented Jan 3, 2020

Hi @andreaferretti nothing to be worrying about, I meant to say that the signatures of the methods and properties of the objects returned by functions in the markdown documentation and examples aren't as detailed and precise as TypeScript's type definition would be. That's why I'd like to see type definitions

@andreaferretti
Copy link
Owner

As I mentioned, I did the work for Scala JS, coming with definitions like this simple one or this more compelx one

You can take inspiration from there (or at least the peace of mind of knowing that the library is fully typed and does not do some strange dynamic metaprogramming trick behind your back). If you want to try writing types, I can give help when you get stuck

@t-ricci-enhancers
Copy link
Author

t-ricci-enhancers commented Jan 3, 2020

Yes, now I've got plenty of informations from your comments, thank you

@mfirry
Copy link
Collaborator

mfirry commented Jan 3, 2020

For some (weird) reasons I had completely forgotten about ScalaJS bindings. Happy new year!

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

3 participants