I have this:
const symbols = {
typeMap: Symbol('type.map')
}
interface LangMap {
[key: string]: string | true,
golang: string,
typescript: string,
java: string,
swift: string
}
export const setTypeMap = function(v: LangMap) : LangMap{
v[symbols.typeMap] = true;
return v;
};
I get this error:
TS2538: Type 'unique symbol' cannot be used as an index type.
Does anyone know what that error is about? I am on tsc version 3.1.6.
[key: string]
? – Raymond[key: string | symbol]
didn't work either – Aynat