I am trying to have a function that takes an index as parameter where the key is limited to a key of T
function aliasSet<T>(values: {[x:keyof T]:string})
//compiler error: An index signature parameter type must be 'string' or 'number'
Is there anyway to achieve that? Is this the right approach?