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

Number Literal Type support? #7982

Closed
essuraj opened this issue Apr 9, 2016 · 2 comments
Closed

Number Literal Type support? #7982

essuraj opened this issue Apr 9, 2016 · 2 comments
Labels
Domain: Literal Types Unit types including string literal types, numeric literal types, Boolean literals, null, undefined Duplicate An existing issue was already created

Comments

@essuraj
Copy link

essuraj commented Apr 9, 2016

TypeScript 1.8.9:
Can there be a way to limit number value for example

an property that accepts 0-255 number or decimals as shown below

eg:

interface options{
red:number[0-255];//0 to 255
count:number[0-*];//0 to infinity
opacity:number[0.0-1.0];// decimal points from 0 to 1
}

this would let users limit the options that most javascript frameworks allow

Thanks

@malibuzios
Copy link

Here are some related issues: #7480, #4639, #7599, #4895.

@DanielRosenwasser DanielRosenwasser added Domain: Literal Types Unit types including string literal types, numeric literal types, Boolean literals, null, undefined Suggestion An idea for TypeScript labels Apr 10, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Apr 11, 2016

See #7480

@RyanCavanaugh RyanCavanaugh added Duplicate An existing issue was already created and removed Suggestion An idea for TypeScript labels Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Literal Types Unit types including string literal types, numeric literal types, Boolean literals, null, undefined Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

5 participants