let count = -1;
const array = ReadonlyArray<T>;
array.reduce<{[k in string]: T}>((acc: {[k in string]: T}, entry) => ({
// ^-->acc-type ^--->acc-type
count = count + 1;
return {
...acc,
[count]: array[count]
}
}, {})
The count stuff is all bad and I can be ignored, whats important here is the typing for acc. I'm pretty sure you don't need it typed in both places.