refinedev / refine

A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility.
https://refine.dev
MIT License
25.92k stars 1.96k forks source link

[FEAT]: Typed resources #6072

Open JuicyBenjamin opened 1 week ago

JuicyBenjamin commented 1 week ago

Is your feature request related to a problem? Please describe.

1) I'm not getting type feedback on whether my type input of a resource is correct. 2) I'm not getting a return type based on the used resource when using for example "useOne" and have to manually do it.

Describe alternatives you've considered

No response

Additional context

No response

Describe the thing to improve

Would be nice to know that a resource I'm calling exists via types. So I'm getting a type error if I'm calling "product" instead of "products" for example.

This would be the first implementation I'd really enjoy.

A bonus implementation, if even possible would be to automagically type the return type of the resources used, right now I'm manually marking them, this solution does work just fine, but it definitely would be more sleek if I didn't have to.

alicanerdurmaz commented 6 days ago

Hi @JuicyBenjamin, This is a great idea to improve the developer experience 🚀