What does a TypeScript index signature actually mean?
You are right to be confused. Index signatures mean a few things, and they mean slightly different things depending where and how you ask. First, index signatures imply that all declared properties in the type must have a compatible type. interface NotLegal { // Error, ‘string’ isn’t assignable to ‘number’ x: string; [key: string]: number; … Read more