{"componentChunkName":"component---src-templates-handbook-tsx","path":"/docs/handbook/release-notes/typescript-1-5.html","result":{"data":{"allSitePage":{"nodes":[{"path":"/dev-404-page/"},{"path":"/docs/handbook/advanced-types.html"},{"path":"/docs/handbook/basic-types.html"},{"path":"/docs/handbook/classes.html"},{"path":"/docs/handbook/compiler-options-in-msbuild.html"},{"path":"/docs/handbook/compiler-options.html"},{"path":"/docs/handbook/configuring-watch.html"},{"path":"/docs/handbook/declaration-merging.html"},{"path":"/docs/handbook/decorators.html"},{"path":"/docs/handbook/enums.html"},{"path":"/docs/handbook/functions.html"},{"path":"/docs/handbook/generics.html"},{"path":"/docs/handbook/integrating-with-build-tools.html"},{"path":"/docs/handbook/interfaces.html"},{"path":"/docs/handbook/iterators-and-generators.html"},{"path":"/docs/handbook/jsdoc-supported-types.html"},{"path":"/docs/handbook/jsx.html"},{"path":"/docs/handbook/literal-types.html"},{"path":"/docs/handbook/mixins.html"},{"path":"/docs/handbook/module-resolution.html"},{"path":"/docs/handbook/modules.html"},{"path":"/docs/handbook/namespaces-and-modules.html"},{"path":"/docs/handbook/namespaces.html"},{"path":"/docs/handbook/nightly-builds.html"},{"path":"/docs/handbook/project-references.html"},{"path":"/docs/handbook/symbols.html"},{"path":"/docs/handbook/"},{"path":"/docs/handbook/triple-slash-directives.html"},{"path":"/docs/handbook/type-checking-javascript-files.html"},{"path":"/docs/handbook/type-compatibility.html"},{"path":"/docs/handbook/type-inference.html"},{"path":"/docs/handbook/unions-and-intersections.html"},{"path":"/docs/handbook/utility-types.html"},{"path":"/docs/handbook/variable-declarations.html"},{"path":"/docs/handbook/writing-declaration-files.html"},{"path":"/docs/handbook/declaration-files/by-example.html"},{"path":"/docs/handbook/declaration-files/consumption.html"},{"path":"/docs/handbook/declaration-files/deep-dive.html"},{"path":"/docs/handbook/declaration-files/do-s-and-don-ts.html"},{"path":"/docs/handbook/declaration-files/introduction.html"},{"path":"/docs/handbook/declaration-files/library-structures.html"},{"path":"/docs/handbook/declaration-files/publishing.html"},{"path":"/docs/handbook/declaration-files/templates.html"},{"path":"/docs/handbook/release-notes/typescript-1-1.html"},{"path":"/docs/handbook/release-notes/typescript-1-3.html"},{"path":"/docs/handbook/release-notes/typescript-1-4.html"},{"path":"/docs/handbook/release-notes/typescript-1-5.html"},{"path":"/docs/handbook/release-notes/typescript-1-6.html"},{"path":"/docs/handbook/release-notes/typescript-1-7.html"},{"path":"/docs/handbook/release-notes/typescript-1-8.html"},{"path":"/docs/handbook/release-notes/typescript-2-0.html"},{"path":"/docs/handbook/release-notes/typescript-2-2.html"},{"path":"/docs/handbook/release-notes/typescript-2-1.html"},{"path":"/docs/handbook/release-notes/typescript-2-3.html"},{"path":"/docs/handbook/release-notes/typescript-2-4.html"},{"path":"/docs/handbook/release-notes/typescript-2-5.html"},{"path":"/docs/handbook/release-notes/typescript-2-6.html"},{"path":"/docs/handbook/release-notes/typescript-2-7.html"},{"path":"/docs/handbook/release-notes/typescript-2-8.html"},{"path":"/docs/handbook/release-notes/typescript-2-9.html"},{"path":"/docs/handbook/release-notes/typescript-3-0.html"},{"path":"/docs/handbook/release-notes/typescript-3-1.html"},{"path":"/docs/handbook/release-notes/typescript-3-2.html"},{"path":"/docs/handbook/release-notes/typescript-3-3.html"},{"path":"/docs/handbook/release-notes/typescript-3-4.html"},{"path":"/docs/handbook/release-notes/typescript-3-5.html"},{"path":"/docs/handbook/release-notes/typescript-3-6.html"},{"path":"/docs/handbook/release-notes/typescript-3-7.html"},{"path":"/docs/handbook/release-notes/typescript-3-8.html"},{"path":"/docs/handbook/asp-net-core.html"},{"path":"/docs/handbook/angular.html"},{"path":"/docs/handbook/dom-manipulation.html"},{"path":"/docs/handbook/gulp.html"},{"path":"/docs/handbook/migrating-from-javascript.html"},{"path":"/docs/handbook/react-&-webpack.html"},{"path":"/docs/handbook/react.html"},{"path":"/docs/handbook/typescript-in-5-minutes-func.html"},{"path":"/docs/handbook/typescript-in-5-minutes.html"},{"path":"/docs/handbook/typescript-in-5-minutes-oop.html"},{"path":"/docs/handbook/typescript-from-scratch.html"},{"path":"/docs/handbook/typescript-tooling-in-5-minutes.html"},{"path":"/docs/handbook/tsconfig-json.html"},{"path":"/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/global-plugin-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/global-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-class-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-function-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-plugin-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-d-ts.html"},{"path":"/docs/handbook/release-notes/overview.html"},{"path":"/tsconfig"},{"path":"/en/tsconfig"},{"path":"/ja/tsconfig"},{"path":"/vo/tsconfig"},{"path":"/play"},{"path":"/en/play"},{"path":"/es/play"},{"path":"/vo/play"},{"path":"/zh/play"},{"path":"/ja/play"},{"path":"/play/3-7/fixits/big-number-literals.ts"},{"path":"/play/3-7/fixits/const-to-let.ts"},{"path":"/play/3-7/fixits/infer-from-usage-changes.ts"},{"path":"/play/3-7/syntax-and-messaging/flattened-error-reporting.ts"},{"path":"/play/3-7/syntax-and-messaging/nullish-coalescing.ts"},{"path":"/play/3-7/syntax-and-messaging/optional-chaining.ts"},{"path":"/play/3-7/types-and-code-flow/assertion-functions.ts"},{"path":"/play/3-7/types-and-code-flow/recursive-type-references.ts"},{"path":"/play/3-7/types-and-code-flow/uncalled-function-checks.ts"},{"path":"/play/3-8/breaking-changes/checking-unions-with-index-signatures.ts"},{"path":"/play/3-8/jsdoc-improvements/accessibility-modifiers.js"},{"path":"/play/3-8/syntax-and-messaging/export-modules-from.ts"},{"path":"/play/3-8/syntax-and-messaging/private-class-fields.ts"},{"path":"/play/javascript/external-apis/typescript-with-deno.ts"},{"path":"/play/javascript/external-apis/typescript-with-node.js"},{"path":"/play/javascript/external-apis/typescript-with-web.js"},{"path":"/play/javascript/external-apis/typescript-with-webgl.js"},{"path":"/play/javascript/functions-with-javascript/function-chaining.ts"},{"path":"/play/javascript/functions-with-javascript/generic-functions.ts"},{"path":"/play/javascript/functions-with-javascript/typing-functions.ts"},{"path":"/play/javascript/helping-with-javascript/errors.ts"},{"path":"/play/javascript/helping-with-javascript/quick-fixes.ts"},{"path":"/play/javascript/javascript-essentials/code-flow.ts"},{"path":"/play/javascript/javascript-essentials/functions.ts"},{"path":"/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/play/javascript/modern-javascript/async-await.ts"},{"path":"/play/javascript/modern-javascript/immutability.ts"},{"path":"/play/javascript/modern-javascript/import-export.ts"},{"path":"/play/javascript/modern-javascript/jsdoc-support.js"},{"path":"/play/javascript/working-with-classes/classes-101.ts"},{"path":"/play/javascript/working-with-classes/generic-classes.ts"},{"path":"/play/javascript/working-with-classes/mixins.ts"},{"path":"/play/javascript/working-with-classes/this.ts"},{"path":"/play/playground/config/javascript-playgrounds.js"},{"path":"/play/playground/config/new-compiler-defaults.ts"},{"path":"/play/playground/language/automatic-type-acquisition.ts"},{"path":"/play/playground/language/fixits.ts"},{"path":"/play/playground/tooling/mobile-support.ts"},{"path":"/play/playground/tooling/sharable-urls.ts"},{"path":"/play/playground/tooling/typescript-versions.ts"},{"path":"/play/typescript/language/soundness.ts"},{"path":"/play/typescript/language/structural-typing.ts"},{"path":"/play/typescript/language/type-guards.ts"},{"path":"/play/typescript/language/type-widening-and-narrowing.ts"},{"path":"/play/typescript/language-extensions/enums.ts"},{"path":"/play/typescript/language-extensions/nominal-typing.ts"},{"path":"/play/typescript/language-extensions/types-vs-interfaces.ts"},{"path":"/play/typescript/meta-types/conditional-types.ts"},{"path":"/play/typescript/meta-types/discriminate-types.ts"},{"path":"/play/typescript/meta-types/indexed-types.ts"},{"path":"/play/typescript/meta-types/mapped-types.ts"},{"path":"/play/typescript/primitives/any.ts"},{"path":"/play/typescript/primitives/literals.ts"},{"path":"/play/typescript/primitives/union-and-intersection-types.ts"},{"path":"/play/typescript/primitives/unknown-and-never.ts"},{"path":"/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/play/typescript/type-primitives/nullable-types.ts"},{"path":"/play/typescript/type-primitives/tuples.ts"},{"path":"/es/play/javascript/external-apis/typescript-with-deno.ts"},{"path":"/es/play/javascript/external-apis/typescript-with-node.js"},{"path":"/es/play/javascript/external-apis/typescript-with-web.js"},{"path":"/es/play/javascript/functions-with-javascript/function-chaining.ts"},{"path":"/es/play/javascript/functions-with-javascript/generic-functions.ts"},{"path":"/es/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/es/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/es/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/es/play/typescript/type-primitives/nullable-types.ts"},{"path":"/es/play/typescript/type-primitives/tuples.ts"},{"path":"/ja/play/typescript/language-extensions/enums.ts"},{"path":"/ja/play/typescript/language-extensions/nominal-typing.ts"},{"path":"/ja/play/typescript/language-extensions/types-vs-interfaces.ts"},{"path":"/ja/play/typescript/primitives/any.ts"},{"path":"/ja/play/typescript/primitives/literals.ts"},{"path":"/ja/play/typescript/primitives/union-and-intersection-types.ts"},{"path":"/ja/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/vo/play/javascript/javascript-essentials/code-flow.ts"},{"path":"/vo/play/javascript/javascript-essentials/functions.ts"},{"path":"/vo/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/vo/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/zh/play/javascript/external-apis/typescript-with-deno.ts"},{"path":"/zh/play/javascript/external-apis/typescript-with-node.js"},{"path":"/zh/play/javascript/external-apis/typescript-with-web.js"},{"path":"/zh/play/javascript/external-apis/typescript-with-webgl.js"},{"path":"/zh/play/javascript/functions-with-javascript/function-chaining.ts"},{"path":"/zh/play/javascript/functions-with-javascript/generic-functions.ts"},{"path":"/zh/play/javascript/functions-with-javascript/typing-functions.ts"},{"path":"/zh/play/javascript/helping-with-javascript/errors.ts"},{"path":"/zh/play/javascript/helping-with-javascript/quick-fixes.ts"},{"path":"/zh/play/javascript/javascript-essentials/code-flow.ts"},{"path":"/zh/play/javascript/javascript-essentials/functions.ts"},{"path":"/zh/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/zh/play/javascript/modern-javascript/import-export.ts"},{"path":"/zh/play/javascript/modern-javascript/jsdoc-support.js"},{"path":"/zh/play/javascript/working-with-classes/classes-101.ts"},{"path":"/zh/play/javascript/working-with-classes/generic-classes.ts"},{"path":"/zh/play/javascript/working-with-classes/mixins.ts"},{"path":"/zh/play/javascript/working-with-classes/this.ts"},{"path":"/zh/play/playground/config/javascript-playgrounds.js"},{"path":"/zh/play/playground/config/new-compiler-defaults.ts"},{"path":"/zh/play/playground/language/automatic-type-acquisition.ts"},{"path":"/zh/play/playground/language/fixits.ts"},{"path":"/zh/play/playground/tooling/mobile-support.ts"},{"path":"/zh/play/playground/tooling/sharable-urls.ts"},{"path":"/zh/play/playground/tooling/typescript-versions.ts"},{"path":"/zh/play/typescript/language/soundness.ts"},{"path":"/zh/play/typescript/language/structural-typing.ts"},{"path":"/zh/play/typescript/language/type-guards.ts"},{"path":"/zh/play/typescript/language/type-widening-and-narrowing.ts"},{"path":"/zh/play/typescript/language-extensions/enums.ts"},{"path":"/zh/play/typescript/language-extensions/nominal-typing.ts"},{"path":"/zh/play/typescript/language-extensions/types-vs-interfaces.ts"},{"path":"/zh/play/typescript/meta-types/conditional-types.ts"},{"path":"/zh/play/typescript/meta-types/discriminate-types.ts"},{"path":"/zh/play/typescript/meta-types/indexed-types.ts"},{"path":"/zh/play/typescript/meta-types/mapped-types.ts"},{"path":"/zh/play/typescript/primitives/any.ts"},{"path":"/zh/play/typescript/primitives/literals.ts"},{"path":"/zh/play/typescript/primitives/union-and-intersection-types.ts"},{"path":"/zh/play/typescript/primitives/unknown-and-never.ts"},{"path":"/zh/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/zh/play/typescript/type-primitives/nullable-types.ts"},{"path":"/zh/play/typescript/type-primitives/tuples.ts"},{"path":"/zh/play/javascript/modern-javascript/immutability.ts"},{"path":"/zh/play/javascript/modern-javascript/async-await.ts"},{"path":"/zh/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/community"},{"path":"/es/community"},{"path":"/ja/community"},{"path":"/vo/community"},{"path":"/zh/community"},{"path":"/download"},{"path":"/es/download"},{"path":"/ja/download"},{"path":"/vo/download"},{"path":"/zh/download"},{"path":"/empty"},{"path":"/es/empty"},{"path":"/ja/empty"},{"path":"/vo/empty"},{"path":"/zh/empty"},{"path":"/"},{"path":"/es/"},{"path":"/ja/"},{"path":"/vo/"},{"path":"/zh/"},{"path":"/tools"},{"path":"/es/tools"},{"path":"/ja/tools"},{"path":"/vo/tools"},{"path":"/zh/tools"},{"path":"/why-create-typescript"},{"path":"/es/why-create-typescript"},{"path":"/ja/why-create-typescript"},{"path":"/vo/why-create-typescript"},{"path":"/zh/why-create-typescript"},{"path":"/docs/home"},{"path":"/es/docs/home"},{"path":"/ja/docs/home"},{"path":"/vo/docs/home"},{"path":"/zh/docs/home"},{"path":"/dev/playground-plugins/"},{"path":"/dev/sandbox/"},{"path":"/dev/twoslash/"},{"path":"/dev/typescript-vfs/"}]},"markdownRemark":{"id":"98c3b7e9-c66f-52a4-98f8-9f4e76a5f836","excerpt":"ES6 Modules TypeScript 1.5 supports ECMAScript 6 (ES6) modules.\nES6 modules are effectively TypeScript external modules with a new syntax: ES6 modules are…","html":"<h2 id=\"es6-modules\" style=\"position:relative;\"><a href=\"#es6-modules\" aria-label=\"es6 modules permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>ES6 Modules</h2>\n<p>TypeScript 1.5 supports ECMAScript 6 (ES6) modules.\nES6 modules are effectively TypeScript external modules with a new syntax: ES6 modules are separately loaded source files that possibly import other modules and provide a number of externally accessible exports.\nES6 modules feature several new export and import declarations.\nIt is recommended that TypeScript libraries and applications be updated to use the new syntax, but this is not a requirement.\nThe new ES6 module syntax coexists with TypeScript’s original internal and external module constructs and the constructs can be mixed and matched at will.</p>\n<h4 id=\"export-declarations\" style=\"position:relative;\"><a href=\"#export-declarations\" aria-label=\"export declarations permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Export Declarations</h4>\n<p>In addition to the existing TypeScript support for decorating declarations with <code>export</code>, module members can also be exported using separate export declarations, optionally specifying different names for exports using <code>as</code> clauses.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">interface</span><span style=\"color: #000000\"> Stream { ... }</span>\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> writeToStream(stream: Stream, data: string) { ... }</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> { Stream, writeToStream </span><span style=\"color: #0000FF\">as</span><span style=\"color: #000000\"> write };  </span><span style=\"color: #008000\">// writeToStream exported as write</span></code></div></pre>\n<p>Import declarations, as well, can optionally use <code>as</code> clauses to specify different local names for the imports. For example:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> { read, write, standardOutput </span><span style=\"color: #0000FF\">as</span><span style=\"color: #000000\"> stdout } </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./inout\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> s = read(stdout);</span>\n<span style=\"color: #000000\">write(stdout, s);</span></code></div></pre>\n<p>As an alternative to individual imports, a namespace import can be used to import an entire module:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">*</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">as</span><span style=\"color: #000000\"> io </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./inout\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> s = io.read(io.standardOutput);</span>\n<span style=\"color: #000000\">io.write(io.standardOutput, s);</span></code></div></pre>\n<h4 id=\"re-exporting\" style=\"position:relative;\"><a href=\"#re-exporting\" aria-label=\"re exporting permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Re-exporting</h4>\n<p>Using <code>from</code> clause a module can copy the exports of a given module to the current module without introducing local names.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> { read, write, standardOutput </span><span style=\"color: #0000FF\">as</span><span style=\"color: #000000\"> stdout } </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./inout\"</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p><code>export *</code> can be used to re-export all exports of another module. This is useful for creating modules that aggregate the exports of several other modules.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> transform(s: string): string { ... }</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">*</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./mod1\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">*</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./mod2\"</span><span style=\"color: #000000\">;</span></code></div></pre>\n<h4 id=\"default-export\" style=\"position:relative;\"><a href=\"#default-export\" aria-label=\"default export permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Default Export</h4>\n<p>An export default declaration specifies an expression that becomes the default export of a module:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">default</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> Greeter {</span>\n<span style=\"color: #000000\">    sayHello() {</span>\n<span style=\"color: #000000\">        console.log(</span><span style=\"color: #A31515\">\"Greetings!\"</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Which in turn can be imported using default imports:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> Greeter </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./greeter\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> g = </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> Greeter();</span>\n<span style=\"color: #000000\">g.sayHello();</span></code></div></pre>\n<h4 id=\"bare-import\" style=\"position:relative;\"><a href=\"#bare-import\" aria-label=\"bare import permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Bare Import</h4>\n<p>A “bare import” can be used to import a module only for its side-effects.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./polyfills\"</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p>For more information about module, please see the <a href=\"https://github.com/Microsoft/TypeScript/issues/2242\">ES6 module support spec</a>.</p>\n<h2 id=\"destructuring-in-declarations-and-assignments\" style=\"position:relative;\"><a href=\"#destructuring-in-declarations-and-assignments\" aria-label=\"destructuring in declarations and assignments permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Destructuring in declarations and assignments</h2>\n<p>TypeScript 1.5 adds support to ES6 destructuring declarations and assignments.</p>\n<h4 id=\"declarations\" style=\"position:relative;\"><a href=\"#declarations\" aria-label=\"declarations permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Declarations</h4>\n<p>A destructuring declaration introduces one or more named variables and initializes them with values extracted from properties of an object or elements of an array.</p>\n<p>For example, the following sample declares variables <code>x</code>, <code>y</code>, and <code>z</code>, and initializes them to <code>getSomeObject().x</code>, <code>getSomeObject().y</code> and <code>getSomeObject().z</code> respectively:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> { x, y, z } = getSomeObject();</span></code></div></pre>\n<p>Destructuring declarations also works for extracting values from arrays:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> [x, y, z = </span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\">] = getSomeArray();</span></code></div></pre>\n<p>Similarly, destructuring  can be used in function parameter declarations:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> drawText({ text = </span><span style=\"color: #A31515\">\"\"</span><span style=\"color: #000000\">, location: [x, y] = [</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">], bold = </span><span style=\"color: #0000FF\">false</span><span style=\"color: #000000\"> }) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #008000\">// Draw text</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #008000\">// Call drawText with an object literal</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> item = { text: </span><span style=\"color: #A31515\">\"someText\"</span><span style=\"color: #000000\">, location: [</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">,</span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">,</span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\">], style: </span><span style=\"color: #A31515\">\"italics\"</span><span style=\"color: #000000\"> };</span>\n<span style=\"color: #000000\">drawText(item);</span></code></div></pre>\n<h4 id=\"assignments\" style=\"position:relative;\"><a href=\"#assignments\" aria-label=\"assignments permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Assignments</h4>\n<p>Destructuring patterns can also be used in regular assignment expressions.\nFor instance, swapping two variables can be written as a single destructuring assignment:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> x = </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> y = </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">[x, y] = [y, x];</span></code></div></pre>\n<h2 id=\"namespace-keyword\" style=\"position:relative;\"><a href=\"#namespace-keyword\" aria-label=\"namespace keyword permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>namespace</code> keyword</h2>\n<p>TypeScript used the <code>module</code> keyword to define both “internal modules” and “external modules”;\nthis has been a bit of confusion for developers new to TypeScript.\n“Internal modules” are closer to what most people would call a namespace; likewise, “external modules” in JS speak really just are modules now.</p>\n<blockquote>\n<p>Note: Previous syntax defining internal modules are still supported.</p>\n</blockquote>\n<p><strong>Before</strong>:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">module</span><span style=\"color: #000000\"> Math {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> add(x, y) { ... }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p><strong>After</strong>:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">namespace</span><span style=\"color: #000000\"> Math {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> add(x, y) { ... }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<h2 id=\"let-and-const-support\" style=\"position:relative;\"><a href=\"#let-and-const-support\" aria-label=\"let and const support permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>let</code> and <code>const</code> support</h2>\n<p>ES6 <code>let</code> and <code>const</code> declarations are now supported when targeting ES3 and ES5.</p>\n<h4 id=\"const\" style=\"position:relative;\"><a href=\"#const\" aria-label=\"const permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Const</h4>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> MAX = </span><span style=\"color: #09835A\">100</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #000000\">++MAX; </span><span style=\"color: #008000\">// Error: The operand of an increment or decrement</span>\n<span style=\"color: #000000\">       </span><span style=\"color: #008000\">//        operator cannot be a constant.</span></code></div></pre>\n<h4 id=\"block-scoped\" style=\"position:relative;\"><a href=\"#block-scoped\" aria-label=\"block scoped permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Block scoped</h4>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">) {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> a = </span><span style=\"color: #09835A\">4</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #008000\">// use a</span>\n<span style=\"color: #000000\">}</span>\n<span style=\"color: #0000FF\">else</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> a = </span><span style=\"color: #A31515\">\"string\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #008000\">// use a</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #000000\">alert(a); </span><span style=\"color: #008000\">// Error: a is not defined in this scope.</span></code></div></pre>\n<h2 id=\"forof-support\" style=\"position:relative;\"><a href=\"#forof-support\" aria-label=\"forof support permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>for..of support</h2>\n<p>TypeScript 1.5 adds support to ES6 for..of loops on arrays for ES3/ES5 as well as full support for Iterator interfaces when targeting ES6.</p>\n<h5 id=\"example\" style=\"position:relative;\"><a href=\"#example\" aria-label=\"example permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<p>The TypeScript compiler will transpile for..of arrays to idiomatic ES3/ES5 JavaScript when targeting those versions:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">for</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> v </span><span style=\"color: #0000FF\">of</span><span style=\"color: #000000\"> expr) { }</span></code></div></pre>\n<p>will be emitted as:</p>\n<pre class=\"shiki\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #0000FF\">for</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> _i = </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, _a = expr; _i &lt; _a.length; _i++) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> v = _a[_i];</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<h2 id=\"decorators\" style=\"position:relative;\"><a href=\"#decorators\" aria-label=\"decorators permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Decorators</h2>\n<blockquote>\n<p>TypeScript decorators are based on the <a href=\"https://github.com/wycats/javascript-decorators\">ES7 decorator proposal</a>.</p>\n</blockquote>\n<p>A decorator is:</p>\n<ul>\n<li>an expression</li>\n<li>that evaluates to a function</li>\n<li>that takes the target, name, and property descriptor as arguments</li>\n<li>and optionally returns a property descriptor to install on the target object</li>\n</ul>\n<blockquote>\n<p>For more information, please see the <a href=\"https://github.com/Microsoft/TypeScript/issues/2249\">Decorators</a> proposal.</p>\n</blockquote>\n<h5 id=\"example-1\" style=\"position:relative;\"><a href=\"#example-1\" aria-label=\"example 1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<p>Decorators <code>readonly</code> and <code>enumerable(false)</code> will be applied to the property <code>method</code> before it is installed on class <code>C</code>.\nThis allows the decorator to change the implementation, and in this case, augment the descriptor to be writable: false and enumerable: false.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> C {</span>\n<span style=\"color: #000000\">  @readonly</span>\n<span style=\"color: #000000\">  @enumerable(</span><span style=\"color: #0000FF\">false</span><span style=\"color: #000000\">)</span>\n<span style=\"color: #000000\">  method() { ... }</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> readonly(target, key, descriptor) {</span>\n<span style=\"color: #000000\">    descriptor.writable = </span><span style=\"color: #0000FF\">false</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> enumerable(value) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (target, key, descriptor) {</span>\n<span style=\"color: #000000\">        descriptor.enumerable = value;</span>\n<span style=\"color: #000000\">    };</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<h2 id=\"computed-properties\" style=\"position:relative;\"><a href=\"#computed-properties\" aria-label=\"computed properties permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Computed properties</h2>\n<p>Initializing an object with dynamic properties can be a bit of a burden. Take the following example:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> NeighborMap = { [name: string]: Node };</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> Node = { name: string; neighbors: NeighborMap; };</span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> makeNode(name: string, initialNeighbor: Node): Node {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> neighbors: NeighborMap = {};</span>\n<span style=\"color: #000000\">    neighbors[initialNeighbor.name] = initialNeighbor;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> { name: name, neighbors: neighbors };</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Here we need to create a variable to hold on to the neighbor-map so that we can initialize it.\nWith TypeScript 1.5, we can let the compiler do the heavy lifting:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> makeNode(name: string, initialNeighbor: Node): Node {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">        name: name,</span>\n<span style=\"color: #000000\">        neighbors: {</span>\n<span style=\"color: #000000\">            [initialNeighbor.name]: initialNeighbor</span>\n<span style=\"color: #000000\">        }</span>\n<span style=\"color: #000000\">    };</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<h2 id=\"support-for-umd-and-system-module-output\" style=\"position:relative;\"><a href=\"#support-for-umd-and-system-module-output\" aria-label=\"support for umd and system module output permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Support for <code>UMD</code> and <code>System</code> module output</h2>\n<p>In addition to <code>AMD</code> and <code>CommonJS</code> module loaders, TypeScript now supports emitting modules <code>UMD</code> (<a href=\"https://github.com/umdjs/umd\">Universal Module Definition</a>) and <a href=\"https://github.com/systemjs/systemjs\"><code>System</code></a> module formats.</p>\n<p><strong>Usage</strong>:</p>\n<blockquote>\n<p>tsc —module umd</p>\n</blockquote>\n<p>and</p>\n<blockquote>\n<p>tsc —module system</p>\n</blockquote>\n<h2 id=\"unicode-codepoint-escapes-in-strings\" style=\"position:relative;\"><a href=\"#unicode-codepoint-escapes-in-strings\" aria-label=\"unicode codepoint escapes in strings permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Unicode codepoint escapes in strings</h2>\n<p>ES6 introduces escapes that allow users to represent a Unicode codepoint using just a single escape.</p>\n<p>As an example, consider the need to escape a string that contains the character ’𠮷‘.\nIn UTF-16/UCS2, ’𠮷’ is represented as a surrogate pair, meaning that it’s encoded using a pair of 16-bit code units of values, specifically <code>0xD842</code> and <code>0xDFB7</code>.\nPreviously this meant that you’d have to escape the codepoint as <code>\"\\uD842\\uDFB7\"</code>.\nThis has the major downside that it’s difficult to discern two independent characters from a surrogate pair.</p>\n<p>With ES6’s codepoint escapes, you can cleanly represent that exact character in strings and template strings with a single escape: <code>\"\\u{20bb7}\"</code>.\nTypeScript will emit the string in ES3/ES5 as <code>\"\\uD842\\uDFB7\"</code>.</p>\n<h2 id=\"tagged-template-strings-in-es3es5\" style=\"position:relative;\"><a href=\"#tagged-template-strings-in-es3es5\" aria-label=\"tagged template strings in es3es5 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Tagged template strings in ES3/ES5</h2>\n<p>In TypeScript 1.4, we added support for template strings for all targets, and tagged templates for just ES6.\nThanks to some considerable work done by <a href=\"https://github.com/ivogabe\">@ivogabe</a>, we bridged the gap for for tagged templates in ES3 and ES5.</p>\n<p>When targeting ES3/ES5, the following code</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> oddRawStrings(strs: TemplateStringsArray, n1, n2) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> strs.raw.filter((raw, index) </span><span style=\"color: #0000FF\">=&gt;</span><span style=\"color: #000000\"> index % </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\"> === </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #000000\">oddRawStrings </span><span style=\"color: #A31515\">`Hello \\n</span><span style=\"color: #0000FF\">${</span><span style=\"color: #09835A\">123</span><span style=\"color: #0000FF\">}</span><span style=\"color: #A31515\"> \\t </span><span style=\"color: #0000FF\">${</span><span style=\"color: #09835A\">456</span><span style=\"color: #0000FF\">}</span><span style=\"color: #A31515\">\\n world`</span></code></div></pre>\n<p>will be emitted as</p>\n<pre class=\"shiki\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> oddRawStrings(strs, n1, n2) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> strs.raw.filter(</span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (raw, index) {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> index % </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\"> === </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">    });</span>\n<span style=\"color: #000000\">}</span>\n<span style=\"color: #000000\">(_a = [</span><span style=\"color: #A31515\">\"Hello \\n\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\" \\t \"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"\\n world\"</span><span style=\"color: #000000\">], _a.raw = [</span><span style=\"color: #A31515\">\"Hello \\\\n\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\" \\\\t \"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"\\\\n world\"</span><span style=\"color: #000000\">], oddRawStrings(_a, </span><span style=\"color: #09835A\">123</span><span style=\"color: #000000\">, </span><span style=\"color: #09835A\">456</span><span style=\"color: #000000\">));</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> _a;</span></code></div></pre>\n<h2 id=\"amd-dependency-optional-names\" style=\"position:relative;\"><a href=\"#amd-dependency-optional-names\" aria-label=\"amd dependency optional names permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>AMD-dependency optional names</h2>\n<p><code>/// &#x3C;amd-dependency path=\"x\" /></code> informs the compiler about a non-TS module dependency that needs to be injected in the resulting module’s require call;\nhowever, there was no way to consume this module in the TS code.</p>\n<p>The new <code>amd-dependency name</code> property allows passing an optional name for an amd-dependency:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">/// </span><span style=\"color: #800000\">&lt;amd-dependency</span><span style=\"color: #008000\"> </span><span style=\"color: #DC0000\">path</span><span style=\"color: #000000\">=</span><span style=\"color: #A31515\">\"legacy/moduleA\"</span><span style=\"color: #008000\"> </span><span style=\"color: #DC0000\">name</span><span style=\"color: #000000\">=</span><span style=\"color: #A31515\">\"moduleA\"</span><span style=\"color: #800000\">/&gt;</span>\n<span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> moduleA: MyType;</span>\n<span style=\"color: #000000\">moduleA.callStuff();</span></code></div></pre>\n<p>Generated JS code:</p>\n<pre class=\"shiki\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #000000\">define([</span><span style=\"color: #A31515\">\"require\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"exports\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"legacy/moduleA\"</span><span style=\"color: #000000\">], </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (require, exports, moduleA) {</span>\n<span style=\"color: #000000\">    moduleA.callStuff();</span>\n<span style=\"color: #000000\">});</span></code></div></pre>\n<h2 id=\"project-support-through-tsconfigjson\" style=\"position:relative;\"><a href=\"#project-support-through-tsconfigjson\" aria-label=\"project support through tsconfigjson permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Project support through <code>tsconfig.json</code></h2>\n<p>Adding a <code>tsconfig.json</code> file in a directory indicates that the directory is the root of a TypeScript project.\nThe tsconfig.json file specifies the root files and the compiler options required to compile the project. A project is compiled in one of the following ways:</p>\n<ul>\n<li>By invoking tsc with no input files, in which case the compiler searches for the tsconfig.json file starting in the current directory and continuing up the parent directory chain.</li>\n<li>By invoking tsc with no input files and a -project (or just -p) command line option that specifies the path of a directory containing a tsconfig.json file.</li>\n</ul>\n<h5 id=\"example-2\" style=\"position:relative;\"><a href=\"#example-2\" aria-label=\"example 2 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0451A5\">\"module\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"commonjs\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0451A5\">\"noImplicitAny\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0451A5\">\"sourceMap\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>See the <a href=\"https://github.com/Microsoft/TypeScript/wiki/tsconfig.json\">tsconfig.json wiki page</a> for more details.</p>\n<h2 id=\"--rootdir-command-line-option\" style=\"position:relative;\"><a href=\"#--rootdir-command-line-option\" aria-label=\"  rootdir command line option permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>--rootDir</code> command line option</h2>\n<p>Option <code>--outDir</code> duplicates the input hierarchy in the output.\nThe compiler computes the root of the input files as the longest common path of all input files;\nand then uses that to replicate all its substructure in the output.</p>\n<p>Sometimes this is not desirable, for instance inputs <code>FolderA\\FolderB\\1.ts</code> and <code>FolderA\\FolderB\\2.ts</code> would result in output structure mirroring <code>FolderA\\FolderB\\</code>.\nNow if a new file <code>FolderA\\3.ts</code> is added to the input, the output structure will pop out to mirror <code>FolderA\\</code>.</p>\n<p><code>--rootDir</code> specifies the input directory to be mirrored in output instead of computing it.</p>\n<h2 id=\"--noemithelpers-command-line-option\" style=\"position:relative;\"><a href=\"#--noemithelpers-command-line-option\" aria-label=\"  noemithelpers command line option permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>--noEmitHelpers</code> command line option</h2>\n<p>The TypeSript compiler emits a few helpers like <code>__extends</code> when needed.\nThe helpers are emitted in every file they are referenced in.\nIf you want to consolidate all helpers in one place, or override the default behavior, use <code>--noEmitHelpers</code> to instructs the compiler not to emit them.</p>\n<h2 id=\"--newline-command-line-option\" style=\"position:relative;\"><a href=\"#--newline-command-line-option\" aria-label=\"  newline command line option permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>--newLine</code> command line option</h2>\n<p>By default the output new line character is <code>\\r\\n</code> on Windows based systems and <code>\\n</code> on *nix based systems.\n<code>--newLine</code> command line flag allows overriding this behavior and specifying the new line character to be used in generated output files.</p>\n<h2 id=\"--inlinesourcemap-and-inlinesources-command-line-options\" style=\"position:relative;\"><a href=\"#--inlinesourcemap-and-inlinesources-command-line-options\" aria-label=\"  inlinesourcemap and inlinesources command line options permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>--inlineSourceMap</code> and <code>inlineSources</code> command line options</h2>\n<p><code>--inlineSourceMap</code> causes source map files to be written inline in the generated <code>.js</code> files instead of in a independent <code>.js.map</code> file.\n<code>--inlineSources</code> allows for additionally inlining the source <code>.ts</code> file into the <code>.js</code> file.</p>","headings":[{"value":"ES6 Modules","depth":2},{"value":"Export Declarations","depth":4},{"value":"Re-exporting","depth":4},{"value":"Default Export","depth":4},{"value":"Bare Import","depth":4},{"value":"Destructuring in declarations and assignments","depth":2},{"value":"Declarations","depth":4},{"value":"Assignments","depth":4},{"value":"namespace keyword","depth":2},{"value":"let and const support","depth":2},{"value":"Const","depth":4},{"value":"Block scoped","depth":4},{"value":"for..of support","depth":2},{"value":"Example","depth":5},{"value":"Decorators","depth":2},{"value":"Example","depth":5},{"value":"Computed properties","depth":2},{"value":"Support for UMD and System module output","depth":2},{"value":"Unicode codepoint escapes in strings","depth":2},{"value":"Tagged template strings in ES3/ES5","depth":2},{"value":"AMD-dependency optional names","depth":2},{"value":"Project support through tsconfig.json","depth":2},{"value":"Example","depth":5},{"value":"--rootDir command line option","depth":2},{"value":"--noEmitHelpers command line option","depth":2},{"value":"--newLine command line option","depth":2},{"value":"--inlineSourceMap and inlineSources command line options","depth":2}],"frontmatter":{"permalink":"/docs/handbook/release-notes/typescript-1-5.html","title":"TypeScript 1.5"}}},"pageContext":{"slug":"/docs/handbook/release-notes/typescript-1-5.html","isOldHandbook":true}}}