-
Notifications
You must be signed in to change notification settings - Fork 27
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
additional properties for attributes #52
base: main
Are you sure you want to change the base?
Conversation
* If Type is numeric and has a maximum constraint. | ||
*/ | ||
max?: string; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case that you had these values by default, would they not likely be defined by the type? e.g.
type AllowedStrings = 'one of' | 'two of' | 'three of';
// ....
public myProp: AllowedStrings = 'one of';
Etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get what you mean. What is if the type is "numeric" and max is 9999. Would you list all values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like maybe this is both “state of the art” and a little early, but possibly the approach that would make sense. microsoft/TypeScript#43505 Would have thought there’d already be types for this, but without the min/max makes more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is if it's a number enum? as I said in #51
The combined type 1 | 2 | 3 would not help much.
You would know wich values are valid, but no meaning behind them.
Is there an issue where this feature was discussed yet? Lets start features in issues. |
@justinfagnani we started this discussion partly in #51 |
No description provided.