ondras / rot.js

ROguelike Toolkit in JavaScript. Cool dungeon-related stuff, interactive manual, documentation, tests!
https://ondras.github.io/rot.js/hp/
BSD 3-Clause "New" or "Revised" License
2.33k stars 255 forks source link

Color.fromString's inferred return type is too general #183

Closed dominik-ro closed 4 years ago

dominik-ro commented 4 years ago

src/color.ts:

export function fromString(str: string) {
    // ...
}

tsc infers return type number[], but it should be Color. Also, could you export the Color type, please?

ondras commented 4 years ago

Hi @dominik-ro,

I just pushed a fix that should do it. Please let me know if you need more adjustments.