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

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

java - SmsManager sending message more than one -