Get type without constraints
Hello!
inferAmbient
retuns types with constraints like moreThanLength<0>
, which when I try to access values to, I get Type 'string' is not assignable to type 'moreThanLength<0>'
.
Is it possible to extract a more basic type?11 Replies
The easiest way externally is probably to wrap it in a type instance, then you access whatever version you need as a prop:
Wow! Thank you, it's perfect!
I am enjoying Arktype so much 😁
I'm glad to hear that. I do think because it's such a unique API, it's more "fun" to use than most libraries haha
Definitely. But also it makes sense, is super clean and clearly insanely flexible
Yeah exactly that's what makes it so cool that I chose the API because I believe it's the best possible solution, but also the best possible solution just happens to be very different from anything else out there right now so it feels very novel
I hope Typescript devs take some notes 🖊️
I think if ArkType can become a staple in the ecosystem, it could open up the door for a next generation of APIs that leverage it either directly or employ a similar strategy to allow native types
I was here
I feel the same way
Honestly, the last week of coding has been like a dream, like wow, it can be this comfortable
That is really great to hear it's definitely what I'm aiming for! I just need to publish the remaining docs to make it more accessible to people who aren't as willing to to hack at it/come in the Discord and ask questions
I'm just so thankful you're explaining all this to me 🙏
Haha well it makes it a lot easier when you're so positive about everything that is very energizing!