< Back to typescript

All 3 comments

user image

Zeeshan Saleem

I used to prefer Interfaces for everything because of the better error messages in older TypeScript versions. But now that Types can do almost everything (like implements and extends), I find myself using Types more often just for consistency with unions.

user image

Zeeshan Saleem

That's a good point. I still stick to Interfaces for defining public API shapes for libraries, though. Declaration merging is a lifesaver when you need to extend a third-party library's definition without forking it.

user image

Sheraz Ahmad

Good Explanation