TypeScript In-Depth: Intro

Слайд 2

Course Overview Intro Interfaces Generics Types Decorators Classes Functions Modules Asynchronous Patterns

Course Overview

Intro

Interfaces

Generics

Types

Decorators

Classes

Functions

Modules

Asynchronous Patterns

Слайд 3

2012 Anders Hejlsberg (TypeScript, Delphi, C#) Microsoft Open Source Flexibility and High Performance History

2012
Anders Hejlsberg (TypeScript, Delphi, C#)
Microsoft
Open Source
Flexibility and High Performance

History

Слайд 4

TypeScript

TypeScript

Слайд 5

TypeScript – language with static type checking and compilation to JavaScript

TypeScript – language with static type checking and compilation to JavaScript
We

can set JavaScript version in TypeScript configuration (tsconfig.json: --target)
TypeScript supports compilation to the following JavaScript versions:
ESNext
ES2015 - ES2018
ES5
ES3 (default)

How It Works

Слайд 6

TYPESCRIPT COMPILER first.ts first.js var x: number; class HelloWorld {} var x; function HelloWorld {}

TYPESCRIPT COMPILER

first.ts

first.js

var x: number;
class HelloWorld {}

var x;
function HelloWorld {}

Слайд 7

var Greeter = (function() { function Greeter(message) { this.greeting = message;


var Greeter = (function() {
function Greeter(message) {
this.greeting = message;
}
Greeter.prototype.greet = function()

{
return “Hello, ” + this.greeting;
};
return Greeter;
})();
class Greeter {
greeting: string;
constructor (message: string) {
this.greeting = message;
}
greet() {
return “Hello, ” + this.greeting;
}
}

TypeScript

JavaScript (ES5)

TypeScript → JavaScript

Encapsulation

Static Typing

Слайд 8

Get TypeScript

Get TypeScript

Слайд 9

IDE with TypeScript Support

IDE with TypeScript Support

Слайд 10

WHAT IS TSLINT?

WHAT IS TSLINT?

Слайд 11

Conceptually similar to popular JavaScript linters JSLint ESLint Installed with npm

Conceptually similar to popular JavaScript linters
JSLint
ESLint
Installed with npm
Rules stored in tslint.json

file
Executed from a command line
TSLint extension available for Visual Studio Code
Plugins are available for other editors

What is TSLint?

Слайд 12

HOW TO INSTALL, CONFIGURE AND USE TSLINT

HOW TO INSTALL, CONFIGURE AND USE TSLINT

Слайд 13

TSLint Install Website: https://palantir.github.io/tslint/ Global installation $ npm install tslint –g

TSLint Install

Website:
https://palantir.github.io/tslint/
Global installation
$ npm install tslint –g
Configuration
tslint --init
Use it
tslint [options]

[file…]
gulp-tslint
Слайд 14

EXTENSION FOR VISUAL STUDIO CODE

EXTENSION FOR VISUAL STUDIO CODE