I have occasion to use some of the Screeps type definitions outside of the Screeps environment. (I'm making a server-side implementation of RoomVisual for visualizing test results and want to make sure the interfaces match.) However, installing @types/screeps imports all of the definitions everywhere in my project, which is a recipe for confusion when most of the objects aren't available in my environment. From what I understand of DefinitelyTyped/DefinitelyTyped#5045 (comment), it sounds like the way to make this work is to have two packages, one to declare everything and the other to export it all into the global namespace.
I've proved this to work conceptually in wolfgang42@45c0ee2, but that was done by hacking up the build scripts and TBH I'm not really sure of the correct way to structure this. So I'm opening this issue to start the discussion; further thoughts are appreciated.
I have occasion to use some of the Screeps type definitions outside of the Screeps environment. (I'm making a server-side implementation of RoomVisual for visualizing test results and want to make sure the interfaces match.) However, installing
@types/screepsimports all of the definitions everywhere in my project, which is a recipe for confusion when most of the objects aren't available in my environment. From what I understand of DefinitelyTyped/DefinitelyTyped#5045 (comment), it sounds like the way to make this work is to have two packages, one to declare everything and the other to export it all into the global namespace.I've proved this to work conceptually in wolfgang42@45c0ee2, but that was done by hacking up the build scripts and TBH I'm not really sure of the correct way to structure this. So I'm opening this issue to start the discussion; further thoughts are appreciated.