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 -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -