{"id":1215,"date":"2017-10-31T17:04:29","date_gmt":"2017-10-31T17:04:29","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/typescript\/?p=1215"},"modified":"2019-02-20T10:45:43","modified_gmt":"2019-02-20T17:45:43","slug":"announcing-typescript-2-6","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/typescript\/announcing-typescript-2-6\/","title":{"rendered":"Announcing TypeScript 2.6"},"content":{"rendered":"<div style=\"font-size: 16px\">\nTypeScript 2.6 is here in time for Halloween, but have no fear! We&#8217;ve got some great treats for you in this release.<\/p>\n<p>If you haven&#8217;t heard of TypeScript, it&#8217;s a language that builds on top of the most up-to-date versions of JavaScript by adding optional static types. These types don&#8217;t just help catch things like typos and logic errors; they also can bring you even better tooling like editor completions, easier navigation of your codebase, and more. Best of all, you don&#8217;t always have to write out your type annotations &#8211; TypeScript can often infer them for you!<\/p>\n<p>To learn more about TypeScript itself, you can <a href=\"https:\/\/www.typescriptlang.org\/\">visit our website<\/a>, but if you&#8217;re already familiar with it and want to try out the release, we have it available <a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.TypeScript.MSBuild\">over NuGet<\/a> or through npm using the following command:<\/p>\n<div class=\"highlight highlight-source-shell\">\n<pre>npm install -g typescript<\/pre>\n<\/div>\n<p>Visual Studio 2015 users (who have <a href=\"https:\/\/www.visualstudio.com\/en-us\/news\/releasenotes\/vs2015-update3-vs\">Update 3<\/a>) can <a href=\"http:\/\/download.microsoft.com\/download\/6\/D\/8\/6D8381B0-03C1-4BD2-AE65-30FF0A4C62DA\/2.6.1-TS-release-dev14update3-20171027.2\/TypeScript_Dev14Full.exe\">install TypeScript 2.6 from here<\/a>, and Visual Studio 2017 users using <a href=\"https:\/\/www.visualstudio.com\/en-us\/news\/releasenotes\/vs2017-relnotes-v15.2\">version 15.2 or later<\/a> will be able to get TypeScript by simply <a href=\"http:\/\/download.microsoft.com\/download\/7\/0\/A\/70A6AC0E-8934-4396-A43E-445059F430EA\/2.6.1-TS-release-dev14update3-20171027.2\/TypeScript_SDK.exe\">installing it from here<\/a>. Visual Studio 2017 users should be sure to <a href=\"https:\/\/github.com\/Microsoft\/TypeScript\/wiki\/Updating-TypeScript-in-Visual-Studio-2017\">read up on how you can configure your project to target specific versions of TypeScript<\/a>.<\/p>\n<p>TypeScript 2.6 will be available for other editors soon. In the meantime you can configure <a href=\"https:\/\/code.visualstudio.com\/Docs\/languages\/typescript#_using-newer-typescript-versions\">Visual Studio Code<\/a> and <a href=\"https:\/\/github.com\/Microsoft\/TypeScript-Sublime-Plugin\/#note-using-different-versions-of-typescript\">Sublime Text<\/a> to use a newer version. <a href=\"https:\/\/github.com\/Microsoft\/TypeScript\/wiki\/TypeScript-Editor-Support\">Other editors<\/a> may have different approaches to getting TypeScript 2.6 running.<\/p>\n<p>Let&#8217;s see what&#8217;s ready today in TypeScript 2.6!<\/p>\n<h2>Contravariant parameter types with <code style=\"color: #a31515;font-size: 29px\">--strictFunctionTypes<\/code><\/h2>\n<p>When comparing signatures &#8211; things that make your types <em>callable<\/em> or <em>constructable<\/em> &#8211; TypeScript has to account for both the return types and the parameter types.<\/p>\n<p>Return types are easy &#8211; for a function <code style=\"color: #a31515\">f<\/code> to be assignable to <code style=\"color: #a31515\">g<\/code>, <code style=\"color: #a31515\">f<\/code>&#8216;s return type has to be assignable to <code style=\"color: #a31515\">g<\/code>&#8216;s return type. The fact that the directionality doesn&#8217;t change in this comparison is called <em>covariance<\/em>.<\/p>\n<p>However, parameters are actually a different story &#8211; the correct approach is to go in the opposite direction! To see why, let&#8217;s take a quick example where we assign the below function <code style=\"color: #a31515\">g<\/code> to <code style=\"color: #a31515\">f<\/code>:<\/p>\n<div class=\"highlight highlight-source-ts\">\n<pre><span style=\"color: #0000ff\">interface<\/span> <span style=\"color: #267F99\">Animal<\/span> { animalProp<span class=\"pl-k\">:<\/span> <span style=\"color: #0000ff\">any<\/span> };\n<span style=\"color: #0000ff\">interface<\/span> <span style=\"color: #267F99\">Dog<\/span> <span style=\"color: #0000ff\">extends<\/span> <span class=\"pl-e\">Animal<\/span> { dogProp<span class=\"pl-k\">:<\/span> <span style=\"color: #0000ff\">any<\/span> };\n\n<span style=\"color: #0000ff\">let<\/span> f <span class=\"pl-k\">=<\/span> (<span class=\"pl-v\">animal<\/span><span class=\"pl-k\">:<\/span> <span style=\"color: #267F99\">Animal<\/span>) <span class=\"pl-k\">=&gt;<\/span> <span class=\"pl-smi\">animal<\/span>.<span class=\"pl-smi\">animalProp<\/span>;\n<span style=\"color: #0000ff\">let<\/span> g <span class=\"pl-k\">=<\/span> (<span class=\"pl-v\">dog<\/span><span class=\"pl-k\">:<\/span> <span style=\"color: #267F99\">Dog<\/span>) <span class=\"pl-k\">=&gt;<\/span> <span class=\"pl-smi\">dog<\/span>.<span class=\"pl-smi\">dogProp<\/span>;\n\n<span style=\"color: #148A14\">\/\/ Should this succeed?<\/span>\n<span class=\"pl-smi\">f<\/span> <span class=\"pl-k\">=<\/span> <span class=\"pl-smi\">g<\/span>;<\/pre>\n<\/div>\n<p>At a glance, we might be tempted to say that since <code style=\"color: #a31515\">Dog<\/code> is assignable to <code style=\"color: #a31515\">Animal<\/code>, <code style=\"color: #a31515\">g<\/code> is assignable to <code style=\"color: #a31515\">f<\/code>, but that&#8217;s not the case. It becomes clear once we ask the right questions about substitutability:<\/p>\n<ul>\n<li>Is it okay for a value of type <code style=\"color: #a31515\">(dog: Dog) =&gt; any<\/code> to say it can be used in place of a <code style=\"color: #a31515\">(animal: Animal) =&gt; any<\/code>?\n<ul>\n<li>Is it okay to say my function only expects an <code style=\"color: #a31515\">Animal<\/code> when it may use properties that on <code style=\"color: #a31515\">Dog<\/code>?\n<ul>\n<li>Only if an <code style=\"color: #a31515\">Animal<\/code> can be used in place of a <code style=\"color: #a31515\">Dog<\/code> &#8211; so is <code style=\"color: #a31515\">Animal<\/code> assignable to <code style=\"color: #a31515\">Dog<\/code>?\n<ul>\n<li>No! It&#8217;s missing <code style=\"color: #a31515\">dogProp<\/code>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>So <code style=\"color: #a31515\">g<\/code> is not assignable to <code style=\"color: #a31515\">f<\/code>, but is the opposite true?<\/p>\n<ul>\n<li>Is it okay for a value of type <code style=\"color: #a31515\">(animal: Animal) =&gt; any<\/code> to say it can be used in place of a <code style=\"color: #a31515\">(dog: Dog) =&gt; any<\/code>?\n<ul>\n<li>Is it okay to say my function expects a <code style=\"color: #a31515\">Dog<\/code> when it may use properties that on <code style=\"color: #a31515\">Animal<\/code>?\n<ul>\n<li>Only if a <code style=\"color: #a31515\">Dog<\/code> can be used in place of an <code style=\"color: #a31515\">Animal<\/code> &#8211; so is <code style=\"color: #a31515\">Dog<\/code> assignable to <code style=\"color: #a31515\">Animal<\/code>?\n<ul>\n<li>Yes!<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Notice that in asking if <code style=\"color: #a31515\">(animal: Animal) =&gt; any<\/code> is assignable to <code style=\"color: #a31515\">(dog: Dog) =&gt; any<\/code>, we end up asking whether <code style=\"color: #a31515\">Dog<\/code> is assignable to <code style=\"color: #a31515\">Animal<\/code>. This flip in direction is called <em>contravariance<\/em>.<\/p>\n<p>While this approach is appropriate in most languages, it&#8217;s difficult to reconcile it with the way that JavaScript is broadly used. Things like using arrays and describing methods in the HTML DOM hierarchy turn out to be problematic with strict contravariance. For instance, in the <code style=\"color: #a31515\">Array&lt;T&gt;<\/code> type, its <code style=\"color: #a31515\">pop<\/code> method <em>returns<\/em> a <code style=\"color: #a31515\">T<\/code> and its <code style=\"color: #a31515\">push<\/code> method <em>takes<\/em> a <code style=\"color: #a31515\">T<\/code>. If TypeScript compared every function parameter contravariantly, it would make all <code style=\"color: #a31515\">Array<\/code>s <em>invariant<\/em> on <code style=\"color: #a31515\">T<\/code> since <code style=\"color: #a31515\">T<\/code> occurs in both covariant and contravariant positions. In other words, <code style=\"color: #a31515\">Array&lt;Dog&gt;<\/code> wouldn&#8217;t be assignable to <code style=\"color: #a31515\">Array&lt;Animal&gt;<\/code>, which could be challenging to work around for many scenarios.<\/p>\n<p>That&#8217;s why TypeScript compares parameters <em>bivariantly<\/em> or <em>bidirectionally<\/em>. It means completely unrelated types will get caught, but it means that certain unsavory issues can fall through the cracks when there is enough overlap:<\/p>\n<div class=\"highlight highlight-source-ts\">\n<pre><span style=\"color: #0000ff\">function<\/span> makeLowerCase(<span class=\"pl-v\">s<\/span><span class=\"pl-k\">:<\/span> <span style=\"color: #0000ff\">string<\/span>) {\n    <span style=\"color: #0000ff\">return<\/span> <span class=\"pl-smi\">s<\/span>.<span class=\"pl-c1\">toLowerCase<\/span>();\n}\n\n<span style=\"color: #0000ff\">declare<\/span> <span style=\"color: #0000ff\">let<\/span> foo<span class=\"pl-k\">:<\/span> <span style=\"color: #267F99\">Promise<\/span>&lt;<span style=\"color: #0000ff\">string<\/span> <span class=\"pl-k\">|<\/span> <span style=\"color: #0000ff\">number<\/span>&gt;;\n<span class=\"pl-smi\">foo<\/span>.<span class=\"pl-en\">then<\/span>(<span class=\"pl-smi\">makeLowerCase<\/span>); <span style=\"color: #148A14\">\/\/ Whoops! TypeScript allows this, but `makeLowerCase` might get a `number`.<\/span><\/pre>\n<\/div>\n<p>That&#8217;s why in TypeScript 2.6, we&#8217;re bringing users a way to tighten things up with <code style=\"color: #a31515\">--strictFunctionTypes<\/code> Under this new <code style=\"color: #a31515\">--strict<\/code> mode flag, any function type that doesn&#8217;t originate from a method has its parameters compared strictly contravariantly.<\/p>\n<p>That means that the above code will fail, because when we try to pass <code style=\"color: #a31515\">makeLowerCase<\/code> with the type <code style=\"color: #a31515\">(s: string) =&gt; string<\/code>to <code style=\"color: #a31515\">then<\/code> which expects a function of type <code style=\"color: #a31515\">(onfulfilled: string | number) =&gt; ...<\/code>, we&#8217;ll flip directions and try to assess whether <code style=\"color: #a31515\">string | number<\/code> is assignable to <code style=\"color: #a31515\">string<\/code> (which isn&#8217;t the case &#8211; <code style=\"color: #a31515\">string<\/code> is a subtype of <code style=\"color: #a31515\">string | number<\/code>). Excluding methods from the check allows TypeScript to continue modeling the above use-cases (e.g. event handlers and simpler array handling) while still bringing this much-demanded strictness check.<\/p>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Covariance_and_contravariance_(computer_science)\">Covariance and contravariance<\/a> probably deserve a more thorough explanation. If you&#8217;d like to read a bit more, <a href=\"https:\/\/www.stephanboyer.com\/post\/132\/what-are-covariance-and-contravariance\">Stephan Boyer has an approachable article<\/a> that gives a reasonable high-level explanation. You can also read up more on <a href=\"https:\/\/github.com\/Microsoft\/TypeScript\/pull\/18654\">the original pull request<\/a>. The short version is that with <code style=\"color: #a31515\">--strictFunctionTypes<\/code>, you&#8217;ll be able to catch many common mistakes.<\/p>\n<p>Keep in mind that while <code style=\"color: #a31515\">--strictFunctionTypes<\/code> is opt-in, it will automatically be turned on if you&#8217;re operating with the <code style=\"color: #a31515\">--strict<\/code> flag on. This may introduce some breaks, so to disable the check with <code style=\"color: #a31515\">--strict<\/code> on, you can specify <code style=\"color: #a31515\">--strictFunctionTypes false<\/code> on the command line or in your <code style=\"color: #a31515\">tsconfig.json<\/code> as so:<\/p>\n<div class=\"highlight highlight-source-json\">\n<pre>{\n    <span style=\"color: #a31515\"><span class=\"pl-pds\">\"<\/span>compilerOptions<span class=\"pl-pds\">\"<\/span><\/span>: {\n        <span style=\"color: #a31515\"><span class=\"pl-pds\">\"<\/span>strict<span class=\"pl-pds\">\"<\/span><\/span>: <span style=\"color: #0000ff\">true<\/span>,\n        <span style=\"color: #a31515\"><span class=\"pl-pds\">\"<\/span>strictFunctionTypes<span class=\"pl-pds\">\"<\/span><\/span>: <span style=\"color: #0000ff\">false<\/span>\n    }\n}<\/pre>\n<\/div>\n<h2>Translated <code style=\"color: #a31515;font-size: 29px\">tsc<\/code> via the <code style=\"color: #a31515;font-size: 29px\">--locale<\/code> flag<\/h2>\n<p>The standalone TypeScript compiler now provides localized (translated) messages over npm when using the <code style=\"color: #a31515\">--locale<\/code> flag. Simply pass the appropriate <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/cc233982.aspx?f=255&amp;MSPPError=-2147217396\">language tag<\/a> as an argument to the TypeScript compiler&#8217;s <code style=\"color: #a31515\">--locale<\/code> option. If the language is supported, TypeScript will provide a translated version, and fall back to<\/p>\n<p>This means that you can get messages<\/p>\n<p>in Chinese (Simplified with <code style=\"color: #a31515\">zh-CN<\/code> and Traditional with <code style=\"color: #a31515\">zh-TW<\/code>):<\/p>\n<div>\n<pre>tsc --pretty --locale zh-CN\n\nbar.ts(1,1): error TS2362: \u7b97\u672f\u8fd0\u7b97\u5de6\u4fa7\u5fc5\u987b\u662f \"any\"\u3001\u3001\"number\" \u6216\u679a\u4e3e\u7c7b\u578b\u3002\n\n'hello' * 1\n~~~~~~~<\/pre>\n<\/div>\n<p>in Spanish:<\/p>\n<div class=\"highlight highlight-text-roff\">\n<pre>$ tsc --pretty --locale es\n\nfoo.ts(1,1): error TS2362: La parte izquierda de una operaci\u00f3n aritm\u00e9tica debe ser de tipo \"any\", \"number\" o un tipo enum.\n\n'hello' * 1\n~~~~~~~<\/pre>\n<\/div>\n<p>in Japanese:<\/p>\n<div class=\"highlight highlight-text-roff\">\n<pre>$ tsc --pretty --locale ja\n\nfoo.ts(1,1): error TS2362: \u7b97\u8853\u6f14\u7b97\u306e\u5de6\u8fba\u306b\u306f\u3001'any' \u578b\u3001'number' \u578b\u3001\u307e\u305f\u306f\u5217\u6319\u578b\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n\n'hello' * 1\n~~~~~~~<\/pre>\n<\/div>\n<p>in Russian:<\/p>\n<div class=\"highlight highlight-text-roff\">\n<pre>$ tsc --pretty --locale ru\n\nfoo.ts(1,1): error TS2362: \u041b\u0435\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0442\u0438\u043f any, number \u0438\u043b\u0438 \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.\n\n'hello' * 1\n~~~~~~~<\/pre>\n<\/div>\n<p>and others that you&#8217;ll be able to read about on <a href=\"https:\/\/www.typescriptlang.org\/docs\/handbook\/compiler-options.html\">our compiler options page<\/a>.<\/p>\n<h2>Faster <code style=\"color: #a31515;font-size: 29px\">--watch<\/code> mode<\/h2>\n<p>TypeScript&#8217;s <code style=\"color: #a31515\">--watch<\/code> mode now acts much more incrementally when emitting modules. Given a set of changed files, <code style=\"color: #a31515\">tsc<\/code> will now figure out affected set of files for which a change might be impactful. This means that only that impacted files will undergo a tree transform pass (the process of transforming code from TypeScript to ES2016 to ES2015 to ES5 to ES3), as well as the emit pass (printing out the transformed files themselves). For extremely large codebases that heavily use ECMAScript modules, this can make a significant difference.<\/p>\n<p>If you&#8217;re not using <code style=\"color: #a31515\">--watch<\/code> mode because you rely on another build tool, the good news is that we intend to provide other tools with an API so that they can also get some of the same performance wins from this change. Tools that plug TypeScript into Webpack, Gulp, and others might be able to leverage this API, and we&#8217;re hoping to deliver it in one of our near future releases.<\/p>\n<h2>Error suppression comments with <code style=\"color: #a31515;font-size: 29px\">\/\/ @ts-ignore<\/code><\/h2>\n<p>Historically, we&#8217;ve avoided error suppression within TypeScript because most cases where users have asked for it could be solved through more accurate declaration files or using a type assertion to <code style=\"color: #a31515\">any<\/code>. However, over time, we have seen two motivating examples: migrating from JavaScript to TypeScript, and overcoming type-checks that live in legacy code.<\/p>\n<p>With TypeScript 2.6 we&#8217;re bringing <code style=\"color: #a31515\">\/\/ @ts-ignore<\/code> comments to TypeScript files. These comments are a light-weight way to suppress any error that occurs on the next line. For example, in the following code, TypeScript would ordinarily report an error about the <code style=\"color: #a31515\">console.log<\/code> statement being unreachable. In TypeScript 2.6, the <code style=\"color: #a31515\">\/\/ @ts-ignore<\/code> comment squelches the error entirely.<\/p>\n<div class=\"highlight highlight-source-ts\">\n<pre><span style=\"color: #0000ff\">if<\/span> (<span style=\"color: #0000ff\">false<\/span>) {\n    <span style=\"color: #148A14\">\/\/ @ts-ignore: Unreachable code error<\/span>\n    <span class=\"pl-c1\">console<\/span>.<span class=\"pl-c1\">log<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>hello<span class=\"pl-pds\">\"<\/span><\/span>);\n}<\/pre>\n<\/div>\n<p>While this feature is motivated by pragmatism, we encourage taking type-checking errors seriously. Our guidance here is to use suppression comments <em>very sparingly<\/em>. In situations where you <em>do<\/em> need to use these comments, we suggest leaving a trailing explanation of why the comment is necessary like in the example above.<\/p>\n<h2>Improved tooling support<\/h2>\n<p>Our investment in TypeScript doesn&#8217;t only involve advancing the language and compiler. Improving the language service is core to the TypeScript experience. Here&#8217;s a few improvements you&#8217;ll see soon in editors like Visual Studio and Visual Studio Code.<\/p>\n<h3>Quick fixes for implicit <code style=\"color: #a31515;font-size: 29px\">any<\/code>s<\/h3>\n<p>TypeScript can now look at use-sites to infer types for declarations whose types are implicitly <code style=\"color: #a31515\">any<\/code>.<\/p>\n<h3>Refactor JSDoc to TypeScript annotations<\/h3>\n<p>TypeScript now provides a refactoring to add parameter annotations from JSDoc comments.<\/p>\n<p>When migrating from an older JavaScript codebase, you can use this refactoring together with the implicit <code style=\"color: #a31515\">any<\/code> quick fix to type your codebase even faster.<\/p>\n<p><video width=\"100%\" autoplay muted loop src=\"http:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2017\/10\/inferFromUsageJSdoc2.mp4\">\nAn editor session where two untyped functions are automatically annotated &#8211; the first has its types extracted from its JSDoc, and the other&#8217;s is inferred from usage given the how the first function has been annotated.\n<\/video><\/p>\n<h3>Invoke uncalled decorators<\/h3>\n<p>Occasionally you might try to use a decorator without calling it first.\nThankfully, TypeScript can use some basic heuristics to figure these scenarios out, and can provide a useful error message with a handy quick-fix to correct from something like <code style=\"color: #a31515\">@Input<\/code> to <code style=\"color: #a31515\">@Input()<\/code>.<\/p>\n<p><video width=\"100%\" autoplay muted loop src=\"http:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2017\/10\/uncalledDecorators.mp4\">\n    An editor session where two untyped functions are automatically annotated &#8211; the first has its types extracted from its JSDoc, and the other&#8217;s is inferred from usage given the how the first function has been annotated.\n<\/video><\/p>\n<h3>Auto-install from <code style=\"color: #a31515;font-size: 29px\">@types<\/code><\/h3>\n<p>Editors will soon be able to provide a quick fix to install type declarations for untyped imports!<\/p>\n<p><video width=\"100%\" autoplay muted loop src=\"http:\/\/devblogs.microsoft.com\/typescript\/wp-content\/uploads\/sites\/11\/2017\/10\/autoInstallTypes.mp4\">\nAn editor session where types for the lodash package aren&#8217;t installed, but applying a quick fix makes them appear in <code>node_modules\/@types\/lodash<\/code> which then provides completions.\n<\/video><\/p>\n<h2>Breaking Changes and Deprecations<\/h2>\n<p>There are several minor changes that may impact your codebase. While you can read up more about them in our <a href=\"https:\/\/github.com\/Microsoft\/TypeScript\/wiki\/Breaking-Changes\">Breaking Changes<\/a> section, please keep these in mind when upgrading.<\/p>\n<ul>\n<li>Write only references are now considered unused under <code style=\"color: #a31515\">--noUnusedLocals<\/code> and <code style=\"color: #a31515\">--noUnusedParameters<\/code>.<\/li>\n<li>In ambient contexts (e.g. declaration files, and <code style=\"color: #a31515\">declare module<\/code> blocks), expressions are now disallowed in <code style=\"color: #a31515\">default<\/code>exports.<\/li>\n<li>Uninhabitable types resulting from intersections (<code style=\"color: #a31515\">number &amp; string<\/code>, <code style=\"color: #a31515\">\"foo\" &amp; 42<\/code>, etc.) will simplify to <code style=\"color: #a31515\">never<\/code> when placed in a union.<\/li>\n<li>Various organizational changes have been made to DOM declarations in <code style=\"color: #a31515\">lib.d.ts<\/code>.<\/li>\n<\/ul>\n<p>As for deprecations, the <code style=\"color: #a31515\">getSymbolDisplayBuilder<\/code> API is now deprecated. For simple use cases, you should be able to move to <code style=\"color: #a31515\">TypeChecker#symbolToString<\/code>. For more advanced use cases, we plan to bring <code style=\"color: #a31515\">symbolToString<\/code> fully up to par with <code style=\"color: #a31515\">SymbolDisplayBuilder<\/code> in functionality by TypeScript 2.7. In a release following TypeScript 2.7, we will be be removing <code style=\"color: #a31515\">getSymbolDisplayBuilder<\/code>.<\/p>\n<h2>What&#8217;s next?<\/h2>\n<p>To get a more complete picture of what&#8217;s in TypeScript 2.6, you can check out our <a href=\"https:\/\/github.com\/Microsoft\/TypeScript\/wiki\/What's-new-in-TypeScript\">What&#8217;s New in TypeScript<\/a> wiki page. You can also see what we&#8217;ve got coming up in our release schedule on <a href=\"https:\/\/github.com\/Microsoft\/TypeScript\/wiki\/Roadmap\">the TypeScript Roadmap<\/a>.<\/p>\n<p>It should go without saying, but let us know if you run into any problems <a href=\"https:\/\/github.com\/Microsoft\/TypeScript\/issues\/new\">on our issue tracker<\/a>. And if you&#8217;re enjoying this release, let us know on Twitter by using the <a href=\"https:\/\/twitter.com\/intent\/tweet?text=%23iHeartTypeScript\">#iHeartTypeScript<\/a> hashtag.<\/p>\n<p>We hope that this version of TypeScript is easy to adopt, brings even more type safety, makes you more productive, and is just plain fun to use.<\/p>\n<p>Happy Hacking!\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>TypeScript 2.6 is here in time for Halloween, but have no fear! We&#8217;ve got some great treats for you in this release. If you haven&#8217;t heard of TypeScript, it&#8217;s a language that builds on top of the most up-to-date versions of JavaScript by adding optional static types. These types don&#8217;t just help catch things like [&hellip;]<\/p>\n","protected":false},"author":381,"featured_media":1797,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1215","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-typescript"],"acf":[],"blog_post_summary":"<p>TypeScript 2.6 is here in time for Halloween, but have no fear! We&#8217;ve got some great treats for you in this release. If you haven&#8217;t heard of TypeScript, it&#8217;s a language that builds on top of the most up-to-date versions of JavaScript by adding optional static types. These types don&#8217;t just help catch things like [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts\/1215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/users\/381"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/comments?post=1215"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/posts\/1215\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/media\/1797"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/media?parent=1215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/categories?post=1215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/typescript\/wp-json\/wp\/v2\/tags?post=1215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}