I have the following method:
public test(keyValue : { [index:string] : string} ){
...
}
How can I modify the signature so that keyValue (array filled with strings) shall have an index of type string but after that I can use this still as an array (filled also with strings) in something like that (maybe this syntax is also wrong for using key AND value?):
keyValue.forEach(key, value => {
//key is string
//value is string
});
string[] & { [s: string]: string};should work but an array literal will not be assignable to it so it is of limited value. What is it you are trying to achieve?