-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ECMAScript 5 (Accessors)? #9
Comments
I think that accessors can be declared only in classes and not in interfaces. Typson uses interfaces as source.
|
Yea, you can only declare them classes. But conceptually a type is a type right? For checking signatures the way the compiler (or json-schema itself) do it doesn't really matter which is which. I never generate really separate interfaces for my classes, it is a hassle to maintain. And unnecessary in TS; as type is about shape of object, not the named type. I sometimes even switch my code between interface or class when I describe JSON objects, it is handy top get a default object for that interface. (class maybe without methods, or only static helpers). So there are two things:
Basically 1 is sort of essential to work in real projects (who uses ES3 still?), 2 is more of an enhancement. |
Would be nice if getters/setters would work:
The text was updated successfully, but these errors were encountered: