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
I think it's better to add this as a separate runtype if possible (especially for the sake of correspondence to TS's type system), but I'm not sure how we should implement. Maybe we could use tagged template?
But then Static<typeof Dog> is not possible currently as TS doesn't populate TemplateStringsArray (the type of first parameter of the tagged template function) as a tuple of string literal types. My ideal behavior is suggested here, but it's not likely to be available at least in the near future.
That said, I confirmed runtime type checking is possible in the above syntax. I'm going to file a PR.
In Typescript there is a thing called Template Literal Types. So I've made this example type:
The resulting union type of
Dog
now is"Bob's dog" | "Jeff's dog"
.Is there a way to create a corresponding runtype for this?
The text was updated successfully, but these errors were encountered: