screepers / Screeps-Typescript-Declarations

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

Making RoomVisual an interface. #116

Open r12f opened 7 years ago

r12f commented 7 years ago

I found a helpful project to help us using RoomVisual in github, which is trying to extend the RoomVisual by changing its prototype: https://github.com/screepers/RoomVisual.

To make the project work for typescript, I created a typing to extend the RoomVisual: https://github.com/r12f/screeps-room-visual-extension-typings.

But since RoomVisual is declared as a class, typescript doesn't allow us to do it, so I am thinking to change this class to an interface.

I am very new in typescript, so please let me know, if it is actually a horrible idea.

thaelina commented 7 years ago

Hey, change the constructor parameter to optional and this would be good. See #121