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
Hello!
Ideally yes, but it would be restricted and not provide all the features MST provides. For example unions may provide a dispatch to determine which type resolve if the value is ambiguos, and that's impossible with TS. Another example is default values.
Thank you for the quick answer!
The idea of having "no new api" seemed tempting. But I guess practically and maintenance wise the possible gain would be negligible.
@TomMarius
MST also supports dynamic default values. So things like this can be ambiguous between a view or a property with default. It also breaks the TS type system.
class Foo {
bar: string = () => Math.random().toString(36);
}
Could a Typescript class contain all the necessary information via types and annotations to generate a model definition?
Just some transformer examples:
microsoft/TypeScript#14419 (comment)
The text was updated successfully, but these errors were encountered: