screepers / typed-screeps

Strong TypeScript declarations for the game Screeps.
MIT License
189 stars 77 forks source link

getDirectionTo can return undefined but typings only have DirectionConstant as a return value. #254

Open Sca1ey opened 8 months ago

Sca1ey commented 8 months ago

Expected Behavior

The return type of getDirection to should be DirectionConstant | undefined

Actual Behavior

The return type on getDirection to is DirectionConstant

Sample code (if available)

const roomPos = new RoomPosition(25, 25, 'E7N51')
console.log(roomPos.getDirectionTo(roomPos)) //undefined

Your Environment