Introduction to TypeScript


Course Number: SCRPT-194
Duration: 2 days (13 hours)
Format: Live, hands-on

TypeScript Training Overview

This Introduction to TypeScript training course teaches attendees the fundamentals of the TypeScript language. Discover the powerful and expressive type system that TypeScript provides as well as TypeScript tooling (including the type checker, editor plugins, compiler, and more).

Location and Pricing

Accelebrate offers instructor-led enterprise training for groups of 3 or more online or at your site. Most Accelebrate classes can be flexibly scheduled for your group, including delivery in half-day segments across a week or set of weeks. To receive a customized proposal and price quote for private corporate training on-site or online, please contact us.

In addition, some courses are available as live, instructor-led training from one of our partners.

Objectives

  • Write and deploy type-safe server and client-side applications using TypeScript
  • Interface with existing TypeScript libraries
  • Use TypeScript’s powerful type system to improve existing JavaScript code and increase type safety
  • Understand warnings and errors reported by the TypeScript compiler/type-checker (tsc) and take action to resolve them
  • Go beyond basic type annotations, instead learning to represent real-world application state in a type-safe way

Prerequisites

  • Proficiency/experience in at least one modern object-oriented programming language, preferably a statically-typed language (e.g., C# or Java)
  • Previous experience with JavaScript either as a frontend web developer or backend Node.js developer

Outline

Expand All | Collapse All

Introduction
Basic Types and Variable Declarations
Primitives and Non-Primitives
Typing Function Arguments and Return Types
Basic Type Inference
Generics and Type Parameters
Any
Unions
More Advanced Generics
Any vs. Unknown
Type Guards and Narrowing
Interfaces vs. Type Aliases
Intersection Types
Modules and Exporting Type Aliases
Ways to Break Type Guarantees
  • any
  • foo as Bar
  • Function or Object or object in certain cases
  • Non-null assertion operator foo!.bar
Using as to tell TypeScript “trust me”
Discriminated unions (tagged unions)
Creating Custom Type Guards
Literal Types
Enums and Const Enums
Building a Validator using Custom Type Guards
Using Runtypes or Zod to Validate Data
Declaration Files and DefinitelyTyped Repository of Community Types
Recursive Types
Typing JSON
Utility Types
Generics with Constraints
Advanced Types (typeof, keyof)
Making a Property Read-only
Conditional Types
Making a Type or Interface Read-Only (the hard way)
Runtime Manifestation (type position vs. value position)
Mapped Types (using a key in to modify an object type or interface)
ReadonlyArray (and the read-only modifier for object properties)
Declaration Merging
Adding Types to Existing Code
Declaration Files
  • Shipped with the package from the library author
  • Decl Files written by the community
  • Write your own and put it in global.d.ts
  • If it is your own library, then you can add JSDoc annotations, then you don’t need a d.ts file
  • If you have a JS file with JSDoc annotations then you can auto-generate the d.ts for export (such as if you’re a library author)
Conclusion

Training Materials

All TypeScript training attendees receive comprehensive courseware.

Software Requirements

  • Google Chrome and/or Firefox
  • Other modern browsers as desired
  • IDE/development environment of your choice
  • Other free software and lab files that Accelebrate would specify


Learn faster

Our live, instructor-led lectures are far more effective than pre-recorded classes

Satisfaction guarantee

If your team is not 100% satisfied with your training, we do what's necessary to make it right

Learn online from anywhere

Whether you are at home or in the office, we make learning interactive and engaging

Multiple Payment Options

We accept check, ACH/EFT, major credit cards, and most purchase orders



Recent Training Locations

Alabama

Birmingham

Huntsville

Montgomery

Alaska

Anchorage

Arizona

Phoenix

Tucson

Arkansas

Fayetteville

Little Rock

California

Los Angeles

Oakland

Orange County

Sacramento

San Diego

San Francisco

San Jose

Colorado

Boulder

Colorado Springs

Denver

Connecticut

Hartford

DC

Washington

Florida

Fort Lauderdale

Jacksonville

Miami

Orlando

Tampa

Georgia

Atlanta

Augusta

Savannah

Hawaii

Honolulu

Idaho

Boise

Illinois

Chicago

Indiana

Indianapolis

Iowa

Cedar Rapids

Des Moines

Kansas

Wichita

Kentucky

Lexington

Louisville

Louisiana

New Orleans

Maine

Portland

Maryland

Annapolis

Baltimore

Frederick

Hagerstown

Massachusetts

Boston

Cambridge

Springfield

Michigan

Ann Arbor

Detroit

Grand Rapids

Minnesota

Minneapolis

Saint Paul

Mississippi

Jackson

Missouri

Kansas City

St. Louis

Nebraska

Lincoln

Omaha

Nevada

Las Vegas

Reno

New Jersey

Princeton

New Mexico

Albuquerque

New York

Albany

Buffalo

New York City

White Plains

North Carolina

Charlotte

Durham

Raleigh

Ohio

Akron

Canton

Cincinnati

Cleveland

Columbus

Dayton

Oklahoma

Oklahoma City

Tulsa

Oregon

Portland

Pennsylvania

Philadelphia

Pittsburgh

Rhode Island

Providence

South Carolina

Charleston

Columbia

Greenville

Tennessee

Knoxville

Memphis

Nashville

Texas

Austin

Dallas

El Paso

Houston

San Antonio

Utah

Salt Lake City

Virginia

Alexandria

Arlington

Norfolk

Richmond

Washington

Seattle

Tacoma

West Virginia

Charleston

Wisconsin

Madison

Milwaukee

Alberta

Calgary

Edmonton

British Columbia

Vancouver

Manitoba

Winnipeg

Nova Scotia

Halifax

Ontario

Ottawa

Toronto

Quebec

Montreal

Puerto Rico

San Juan