I have this interface, I was curious if there is a possible way to specify potential names that the key value could be. But I still get reference errors saying "bottom" isn't apart of IStyles. I am fairly new to using typescript, and when searching through stackoverflow, none of the other answers regarding what I was looking for jumped out at my immediately as the answer so I apologize if this is already somewhere and I have overlooked it.
I am looking to achieve something like this for a Svelte project I am working on as these key-names are obviously css names, so its imperative that I use the actually naming.
interface IStyles
{
position?: string;
[top | bottom] ?: string | number;
margin?: string | number;
padding?: string | number;
background?: string | Colors;
}