You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all huge thanks for creating this library. I am in awe of how many thorny cases you've considered and covered whilst maintaining a user friendly but principled interface.
I am attempting to represent a logging interface using Typebox and am running into some issues with variadic parameters:
Function rest parameters are not currently supported in TypeBox, but are being considered in later revisions. Currently the Type.Rest function only extracts variadic types from Intersect, Union, Tuple structures and returns the interior TSchema[] (which isn't a type).
There are intentions to repurpose Rest for your exact use case, and have been prototyping this feature somewhat recently, however this would be a breaking change as it involves promoting the Rest function result as an actual type that can be remapped on functions and constructors. The eventual API for this will look as follows.
constF=Type.Function([Type.Rest(Type.String())],Type.Void())typeF=Static<typeofF>// type F = (...arg: string[]) => void
Note, I don't expect this to be ready for some time, but will be aiming for a significant revision near the end of the year. Have marked this issue as future for the time being.
Hi there,
First of all huge thanks for creating this library. I am in awe of how many thorny cases you've considered and covered whilst maintaining a user friendly but principled interface.
I am attempting to represent a logging interface using Typebox and am running into some issues with variadic parameters:
The suggestion from the Typebox workbench is something like this:
However that type resolves to something like:
Which isn't quite right
The text was updated successfully, but these errors were encountered: