This project is read-only.

Solution for "The explicit indexer for Object has been removed"?

Topics: General
Nov 21, 2013 at 5:46 PM
Edited Nov 21, 2013 at 5:46 PM
I have been updating some typings for 0.9.5, and one thing that appear a lot is the use of indexers to map a dictionary.

For example, jquery has this piece of code that doesn't work easily anymore.
attr(map: { [key: string]: any; }): JQuery;
To make this work, I had to cast the object to the type, like:
var attrs = <{ [key: string]: any; }> {
   key1: value
   key2: value

This is not practical, so the only thing I thought of was to change the parameter type to "any" in the method. This makes sense because these kinds of functions actually accept any object, but I would like to be sure what the correct solution would be.

Am I skiping something here? Or changing the signature to accept any is this the way to go?
Nov 22, 2013 at 4:34 PM
I agree that map should just be any (after all, [key: string]: any; describes any JavaScript object)
Dec 16, 2013 at 10:22 PM
Please fix, this is quite annoying
Dec 16, 2013 at 11:35 PM
What exactly do you want fixed?