The upgrade also features a module augmentation capability that lets developers design more modular libraries.
Bowden Kelly, program manager for Visual Studio and .Net at Microsoft, in a blog said “This allows library authors to distribute their libraries in a piecemeal fashion. Previously, TypeScript made the assumption that modules wouldn’t change. With module augmentation, users have the ability to extend existing modules such that consumers can specify if they want to import the whole module or just a subset.”
Strings in a type position become string literal types in version 1.8. “Only exact string matches are assignable to string literal types, and like any other type, they can be used in union types as well. So if we rewrite the AnimationOptions interface with string literal types, the API users now get type protection,” Kelly added.
YOU MIGHT ALSO LIKE::