I want to create an interface with an unknown number of properties of type string in typescript.
eg: there could be 5 or maybe 50 property of type string
Is it possible in typescript?
You can try this to specify that a interface can have any number of properties:
interface MyInterface {
knownPropert1: string;
knownProperty2: string;
[key: string]: string; // specify that any other properties will be of type string too
}