PhilWaldmann / openrecord

Make ORMs great again!
https://openrecord.js.org
MIT License
486 stars 38 forks source link

TypeScript Support #66

Closed matheusgrieger closed 6 years ago

matheusgrieger commented 6 years ago

Hello! Nice to see the revamped 2.0 version, great work! But do you have any plans to add TypeScript support with type declarations? That would be a really nice thing to have!

Thank you for your amazing package!

PhilWaldmann commented 6 years ago

Definitely!!

But I think the type declarations need to generated based on your models and their attributes. Otherwise it wont make too much sense, right?

jpitchardu commented 6 years ago

Yeah, I think it can be approached with generics.

matheusgrieger commented 6 years ago

Yes, I think so too.

But shouldn't OpenRecord have its own types? Not only for code completions within VSCode for example, but also because some TypeScript configs will throw errors because they can't check OpenRecord types ("implicitly has 'any' type").

jpitchardu commented 6 years ago

Probably for the context or store api, but for models I agree with @PhilWaldmann it's the user who defines the types.

matheusgrieger commented 6 years ago

I agree with you guys. My point when opening this issue was solely for OpenRecord API. Sorry if I couldn't express myself correctly :sweat_smile:

PhilWaldmann commented 6 years ago

Typescript support for all available methods is implemented.