screepers / Screeps-Typescript-Declarations

The repository for *Screeps's* TypeScript type definitions.
69 stars 44 forks source link

"Map" definition conflicts with ES6 "Map" target #18

Closed Dessix closed 8 years ago

Dessix commented 8 years ago

It seems that, since the definition for Map has no accessible constructor, we should be able to just rename it to something that doesn't conflict, so the Map type is usable for non-string dictionary keys?

NhanHo commented 8 years ago

Hmm so you're right that we don't need to use Map directly in the game. But the main problem I'm concerned with right now is that renaming type Map to something else will break current code of anyone typing their code with Map. Note that interestingly, while Map is an ES6 construct, it's not actually in Typescript yet. Any suggestion?

Dessix commented 8 years ago

Map is in typescript so far as I can see: qzjnd48 1 (At least when the target is ES6, I haven't checked on an ES5 target)

But from what I've seen, Screeps Map is not accessible globally because the ES6 Map constructor overrides it. If this would break backward compatibility, the Node upgrade already beat it to the punch.

NhanHo commented 8 years ago

It's changed to GameMap now! Please let me know if there is any other issue.