Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jogibear9988
Copy link
Contributor

No description provided.

* If Type is numeric and has a maximum constraint.
*/
max?: string;

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?

Copy link
Contributor Author

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?

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.

Copy link
Contributor Author

@jogibear9988 jogibear9988 May 27, 2021

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.

@justinfagnani
Copy link
Collaborator

Is there an issue where this feature was discussed yet? Lets start features in issues.

@jogibear9988
Copy link
Contributor Author

jogibear9988 commented Feb 13, 2022

@justinfagnani we started this discussion partly in #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants