Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't know about TS, but in the main competitor, Flowtype, you can give uhoh this type:

    uhoh : ((x : string) => number) & ((x : number) => string)
And get what you expect:

    const a = uhoh('foo') // : number
    const b = uhoh(3)     // : string


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: