Type dictionary-like objects with dynamic keys.
Section: Objects, Interfaces, and Type Aliases
Use an index signature
typescript
typescript
type StringMap = {
[key: string]: string;
};Explanation
Index signatures are useful for config maps and lookup tables.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Objects, Interfaces, and Type Aliases
Define an interface
Use an interface to model a reusable object shape.
Define a type alias
Use a type alias for unions, objects, tuples, or helpers.
Annotate object shapes
Describe the expected properties of an object.