I'm looking to define an oneToFive
interface that restricts input to numbers between 1 and 5.
What is the proper syntax for achieving this?
// encountering an error with this line
interface oneToFive = 1 | 2 | 3 | 4 | 5;
interface feedbackSection {
levelOfRelatability?: oneToFive;
qualityOfWriting?: oneToFive;
}