When working with typescript, how can I define the type signature for a plain old javascript object that allows any key, but restricts the values to strings only? For example, {a:"foo"}
and {b:"bar"}
are considered valid values, while {a:[1,2,3]}
and {b:3}
are not.
I'm looking to write something similar to
let foo : {*: string} = {a: "foo"}
Currently, my workaround involves using any
, but I would prefer a more precise solution.