You have to define what kind of index type the object has. In your case it is a string
based index.
const myObj: {[index: string]:any} = {}
More Related Contents:
- Transform union type to intersection type
- Type union not checking for excess properties
- TypeScript: Object.keys return string[]
- Does Typescript support mutually exclusive types?
- ‘any’ vs ‘Object’
- How to implement a typescript decorator?
- Get an object’s class name at runtime
- How to convert a string to number in TypeScript?
- How to use jQuery with TypeScript
- Type definition in object literal in TypeScript
- Confusing “duplicate identifier” Typescript error message
- What does the “as const” mean in TypeScript and what is its use case?
- How do I declare object value type without declaring key type?
- Typescript: Check “typeof” against custom type
- Angular2 – should private variables be accessible in the template?
- Typescript check object by type or interface at runtime with typeguards in 2020+
- TypeScript: void return type converted to any type?
- Angular 2 beta.17: Property ‘map’ does not exist on type ‘Observable’
- why is return type `null` (or any other type) assignable to return type `void`?
- Obtaining the return type of a function
- What does “… resolves to a non-module entity and cannot be imported using this construct” mean?
- Typescript 2.0. “types” field in tsconfig.json
- What’s the meaning of “=>” in TypeScript? (Fat Arrow)
- Typescript: Omit a property from all interfaces in a union, but keep the union structure
- How to update TypeScript to latest version with npm?
- Typescript: Spread types may only be created from object types
- Typescript and filter Boolean
- Angular2 – root relative imports
- Why TypeScript lets me add a string and a number? Can I prevent it?
- A way to mark arbitrary strings in Typescript Template Literals