tommybananas / finale

Create flexible REST endpoints and controllers from Sequelize models in your Express app
188 stars 36 forks source link

TypeScript type definition? #30

Open devuxer opened 6 years ago

devuxer commented 6 years ago

I'm not seeing any typings for this project. Any plans in the works to provide one?

I had put together a typings file for epilogue. Would that be a straightforward migration to finale?

tommybananas commented 6 years ago

No plans right now but great idea! Feel free to submit a pull request, I think we kept the API the exact same so it should be straight forward. Thanks much

On Fri, Sep 14, 2018 at 12:25 PM devuxer notifications@github.com wrote:

I'm not seeing any typings for this project. Any plans in the works to provide one?

I had put together a typings file https://gist.github.com/devuxer/48e3db113e057edd58acfe78c9b7e28a for epilogue. Would that be a straightforward migration to finale?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tommybananas/finale/issues/30, or mute the thread https://github.com/notifications/unsubscribe-auth/ACELE-tnvQYr0_WSvof1X1FUdv-MqyF5ks5ua-aJgaJpZM4Wpp6w .

devuxer commented 6 years ago

@tommybananas, Thanks for the speedy reply! Glad to know migration should be straightforward. I'm not an expert at publishing type definition files, but I think the usual approach is create a pull request of DefinitelyTyped rather than this project (finale). I'll try to look into that when I get some time.

tommybananas commented 6 years ago

It would be good to get that documented in the readme if you ever get that done. thanks!

devuxer commented 6 years ago

I'm afraid I haven't had a chance yet. It is unfortunately not trivial to publish to DefinitelyTyped. Check out the instructions to see what I mean. I'm not giving up, but it will probably be some weeks before I have time to tackle this.

devuxer commented 6 years ago

Meanwhile, here is the latest file I've been working from, which in itself might help some people out until it's officially supported on DefinitelyTyped:

https://gist.github.com/devuxer/77adb37a496ea756c8a735b22fed439e

pvanagtmaal commented 5 years ago

@devuxer Have you made any progress on this?

shamoons commented 5 years ago

@devuxer given that type file, how would I actually use it?

devuxer commented 5 years ago

@shamoons ,

Create a typings folder in your project root, then add the contents of the gist to a file called finale-rest-d.ts. This should just work as long as you haven't don't anything unusual in your tsconfig.json.

shamoons commented 5 years ago

@devuxer So I'm using flowtype and I used flowgen to create the definition file. It's causing some slight headache

devuxer commented 5 years ago

@shamoons , Oh sorry, I'm not sure how to help with that.

tommybananas commented 5 years ago

@devuxer do you think it is mature enough to add to this project? Feel free to create a PR