I'm currently struggling with specifying allowed values for a property in TypeScript.
Within my interface, I have statically typed the property like this:
interface SomeInterface{
prop: "bell" | "edit" | "log-out"
}
However, I am looking for a way to dynamically change the list of allowed values, like so:
const list = ["bell", "edit", "log-out"]
interface SomeInterface{
prop: list (where all values from list are allowed)
}
The challenge lies in having the list of allowed values change dynamically.
Just a heads up, this is my first time reaching out on stackoverflow. Thank you!