elysiajs / elysia

Ergonomic Framework for Humans
https://elysiajs.com
MIT License
9.07k stars 193 forks source link

Please Export Typebox Types #686

Open MatthewAry opened 2 weeks ago

MatthewAry commented 2 weeks ago

What is the problem this feature would solve?

I'm building some meta-programming functions to make creating APIs for dealing with pagination, sorting, and filtering on data a bit easier. In order for my types to work correctly, I sometimes have to import TypeBox types and that makes me have to add Typebox as a dependency to my project, which means that I have to manually track the version of TypeBox that Elysia uses.

What is the feature you are proposing to solve the problem?

Please export all Typebox types from the Elysia package. This would make things much easier for this kind of scenario.

What alternatives have you considered?

I could, get access to the types directly by using the Parameters or ReturnType typescript utilities, but that can get annoying and increases the coupling of my code.

darr1s commented 2 weeks ago

Hey there 👋 disclaimer, I'm not the core contrib.

I'm currently as well working on the same thing. To allow route to define their allowed filters/sort by and map it to drizzle queries.

I'm currently considering porting over feathers-query (https://feathersjs.com/api/schema/validators.html#validatequery).

Just like to know what is ur approach if you don't mind sharing.