enums - Define interface variable with only two string hardcoded values -


i have following code:

interface responsefromserver {     type:string;     message:string; } 

how can restrict type variable being 1 of 2 following values:

"success" "error" 

this isn't possible. types shape of data, not content.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -