google-fabric / velocity-react

React components for Velocity.js
MIT License
2.94k stars 168 forks source link

Please provide Typings #206

Closed MartinHaeusler closed 7 years ago

MartinHaeusler commented 7 years ago

I just gave this library a shot, primarily because I was:

I am honestly amazed by this library, both the core velocity.js and the smooth react integration. It just fits!

Many react users (including me) are quite fond of TypeScript, even react itself comes with all typings included. This library would be even more awesome if it had a velocity-react.d.ts file to help with code completion and error checking. My own knowledge of this library is too limited to have a holistic picture of all possible settings. Is there any chance you could provide the typings? I already checked the web for existing typings for this library, but there are none it seems...

fionawhim commented 7 years ago

I'm open to PRs, but won't implement this personally.

Note that most of the typing would actually come from Velocity.js, since these components pass through many of the props.

MartinHaeusler commented 7 years ago

Well, as it happens, there are typings for Velocity already (however, I don't know how complete they are):

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/354cec620daccfa0ad167ba046651fb5fef69e8a/types/velocity-animate/index.d.ts

... just if anybody is interested in doing this. I'm just starting out with this library.

MartinHaeusler commented 7 years ago

Okay I took a look at it after all. Using your NPM documentation, I was able to figure out most things I think. I have attached my velocity-react.d.ts file to this post (velocity-react.d.ts.zip; I had to zip it because GitHub does not accept *.ts files as attachments).

This file has no guarantee for completion, but it works to get the basic examples going and give some guidance. It also lists the names of all animations that are included in velocity by default.

This file has absolutely zero dependencies to velocity typings. For attributes/references that refer to velocity, this typings file uses Object. This is because the standard velocity typings are crawling with Object and any types to begin with, so there is not much point in including them.

Feel free to do with this file whatever you want. If you take a look and see something missing, please, by all means, do update it. This is merely what I can make of the documentation.

fionawhim commented 7 years ago

Thanks for putting this together. I'll try and take a look and see about getting it in. I use Flow rather than TypeScript in my own projects, so I'd have to get familiar with it first.

DanHarman commented 6 years ago

@finneganh @MartinHaeusler Any further progess on this? Typings would be super useful as typescript has gained a lot of momentum since google endorsed it for angular... It makes the api a lot more discoverable too.

sanex3339 commented 6 years ago

bump

kusmierz commented 4 years ago

Hi @fionawhim, are you planning to add Typings?

fionawhim commented 4 years ago

@kusmierz Nope.

guilhermemarconi commented 3 years ago

dude it's almost four years since this issue was created. just bumping here to see what happens 🤷🏻‍♂️