TypeScript 3.8, a new version of Microsoft’s typed superset of , is now available as a production release. The latest upgrade emphasizes type-only imports and exports and ECMAScript standards compliance.
The release adds a new syntax for type-only imports and exports, with the intent of giving users more fine-grained control over import and elision. The
import type syntax only imports declarations to be used for type annotations and declarations and always gets fully erased. The
export type syntax only provides an export to be used for type contexts and is erased from TypeScript output.
In conjunction with
import type, TypeScript 3.8 also adds a compiler flag to control what happens with imports that won’t be used at runtime:
Other improvements promised in TypeScript 3.8 include:
allowJsflag; type-checking of those files is supported via the
jsconfig.jsonlets users tell the compiler/language service which file watching strategies to use to keep track of files and directories.
objectin JSDoc is no longer
You can install the general release of TypeScript 3.8 through or via NPM:
npm install typescript