Re:JavaScript libraries should be written in TypeScript
by moron4hire on Wednesday March 16, 2016 @06:16PM
(#11301099)
Laziness is the root of computer science. There is no virtue in hard work for hard work's sake.
You can write quite crazy expressions abusing Boolean operators and he successfully keeps the static type.
You can also have different method overloads signatures as long as you have a more general implementation that does the dynamic checks at run-time manually. Most of the time you can use Union types anyway.
The big collection of definition files for almos any JS library out there is a living proof of how is possible to describe statically almost any JS API.
Let's face it, dynamic languages are about laziness, not about 'unconstraibed creativity'