Set up the server In project.json add another entry in "dependencies":
Mappings Compiler Option MSBuild Property Name Allowed Values -
Initialize the project Now we’ll turn this folder into an npm package. npm
Module Resolution Strategies There are two possible module resolution strategies: Node and Classic. You can use the --moduleResolution
Using a class as an interface As we said in the previous section, a class declaration creates two things: a type representing instances of the
Watchify We’ll start with Watchify to provide background compilation: npm
Symbol.replace A regular expression method that replaces matched substrings of a string. Called by the String.prototype
Write a simple example Let’s write a Hello World program. In src, create the file main.ts:
Overloads JavaScript is inherently a very dynamic language. It’s not uncommon for a single JavaScript function to return different types of
Generic Types In previous sections, we created generic identity functions that worked over a range of types. In this section, we’ll explore
Page 25 of 29