Any way to specify the runtime type and validator when using TS defineProps? #6534
segevfiner
started this conversation in
General Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using
<script setup>
defineProps
TypeScript syntax, if you specify any imported type as part of the definition, e.g.:Then the runtime type will be specified as
null
(any), is there any way to specify a type in such cases? and is there any syntax for specifying a validator when using the syntax? Yeah we get TypeScript checking when using this syntax so the runtime type checking might not be as important, but for libraries it might still be useful to include the runtime types and appropriate validators in case they are consumed by a non-TypeScript user.Beta Was this translation helpful? Give feedback.
All reactions