In TypeScript I know it's possible to interface a dictionary in the following way:
interface MyDictionary {
[key: string]: string;
}
However, the external package I'm using returns a dictionary with a method on it to format the data contained in it for another purpose.
So I would like to interface it by doing something like the following:
interface MyDictionary {
[key: string]: string;
formatForSomethingElse(): any;
}
However this gives me the following error:
Property 'formatForSomethingElse' of type '() => any' is not assignable to string index type 'string'.ts(2411)
As the object I'm interfacing is external and I have no control over it. Is my only option in this instance, to change the dictionary value to type any?