🔷 TypeScript Programming Fundamentals

Master JavaScript's typed superset for scalable application development

← Back to Programming Courses

TypeScript Programming Curriculum

18
TypeScript Units
~130
Core Concepts
TS 5.3
Latest Version
Type Safe
JavaScript++
1

TypeScript Introduction

Learn the fundamentals of TypeScript and its benefits over JavaScript.

  • What is TypeScript?
  • TypeScript vs JavaScript
  • Static typing benefits
  • TypeScript compiler (tsc)
  • Setting up development environment
  • VS Code integration
  • First TypeScript program
  • Compilation process
2

Basic Types & Annotations

Master TypeScript's type system and type annotations.

  • Basic types (string, number, boolean)
  • Type annotations
  • Type inference
  • Arrays and tuples
  • Enum types
  • Any and unknown types
  • Void and never types
  • Union and intersection types
3

Variables & Functions

Work with typed variables and function declarations.

  • Variable declarations with types
  • Let, const, and var
  • Function type annotations
  • Parameter types
  • Return type annotations
  • Optional parameters
  • Default parameters
  • Rest parameters
4

Objects & Interfaces

Define object shapes and contracts with interfaces.

  • Object type annotations
  • Interface declarations
  • Optional properties
  • Readonly properties
  • Index signatures
  • Interface inheritance
  • Function types in interfaces
  • Hybrid types
5

Classes & Inheritance

Master object-oriented programming with TypeScript classes.

  • Class declarations
  • Constructor functions
  • Access modifiers (public, private, protected)
  • Readonly modifier
  • Inheritance with extends
  • Abstract classes
  • Static members
  • Getters and setters
6

Generics

Create reusable and type-safe code with generic programming.

  • Generic functions
  • Generic interfaces
  • Generic classes
  • Type constraints
  • Multiple type parameters
  • Generic type aliases
  • Conditional types
  • Mapped types
7

Advanced Types

Explore TypeScript's advanced type system features.

  • Union types
  • Intersection types
  • Type guards
  • Discriminated unions
  • Type aliases
  • Literal types
  • Index types
  • Conditional types
8

Modules & Namespaces

Organize code with modules and understand namespaces.

  • ES6 modules
  • Import and export statements
  • Default exports
  • Module resolution
  • Namespaces
  • Triple-slash directives
  • Declaration merging
  • Ambient modules
9

Type Assertions & Guards

Control type flow and make safe type assertions.

  • Type assertions
  • User-defined type guards
  • typeof type guards
  • instanceof type guards
  • in operator
  • Discriminated unions
  • Assertion functions
  • Non-null assertion operator
10

Decorators & Metadata

Use decorators for meta-programming and framework integration.

  • Decorator basics
  • Class decorators
  • Method decorators
  • Property decorators
  • Parameter decorators
  • Decorator factories
  • Reflect metadata
  • Framework decorators (Angular, NestJS)
11

Error Handling & Debugging

Handle errors effectively and debug TypeScript applications.

  • Error types and handling
  • Try-catch with types
  • Custom error classes
  • Compiler error messages
  • Source maps
  • Debugging in VS Code
  • Type checking in runtime
  • Error boundaries
12

Async Programming

Master asynchronous programming with TypeScript.

  • Promises with types
  • Async/await syntax
  • Generic Promise types
  • Error handling in async code
  • Observable types (RxJS)
  • Callback type annotations
  • Event handling
  • Concurrent operations
13

Utility Types

Leverage built-in utility types for type transformations.

  • Partial<T>
  • Required<T>
  • Readonly<T>
  • Pick<T, K>
  • Omit<T, K>
  • Exclude<T, U>
  • Extract<T, U>
  • Record<K, T>
14

Declaration Files

Work with type definitions and create declaration files.

  • Type definition files (.d.ts)
  • DefinitelyTyped repository
  • Creating declaration files
  • Ambient declarations
  • Module augmentation
  • Global augmentation
  • Publishing type definitions
  • Third-party library types
15

Configuration & Compilation

Configure TypeScript compiler and build processes.

  • tsconfig.json configuration
  • Compiler options
  • Project references
  • Build modes
  • Watch mode
  • Incremental compilation
  • Build tools integration
  • Path mapping
16

Testing TypeScript

Test TypeScript applications with various testing frameworks.

  • Jest with TypeScript
  • Mocha and Chai setup
  • Type testing
  • Mocking with types
  • Test-driven development
  • Coverage reports
  • Integration testing
  • E2E testing setup
17

Framework Integration

Integrate TypeScript with popular frameworks and libraries.

  • React with TypeScript
  • Angular TypeScript features
  • Vue.js with TypeScript
  • Node.js applications
  • Express.js typing
  • Database ORM types
  • API client types
  • State management typing
18

Production Deployment

Deploy TypeScript applications to production environments.

  • Build optimization
  • Bundle analysis
  • Production configurations
  • CI/CD integration
  • Docker with TypeScript
  • Performance monitoring
  • Error tracking
  • Deployment strategies

Unit 1: TypeScript Introduction

Learn the fundamentals of TypeScript and its benefits over JavaScript

What is TypeScript?

TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.

Key Benefits: Static typing, Better IDE support, Early error detection, Enhanced refactoring

TypeScript Compiler

The TypeScript compiler (tsc) transforms TypeScript code into JavaScript.

TypeScript Source (.ts)
TypeScript Compiler (tsc)
JavaScript Output (.js)

Development Environment

Setting up your TypeScript development environment.

Node.js & npm Installation
TypeScript Compiler (npm install -g typescript)
VS Code Extensions

First TypeScript Program

Write and compile your first TypeScript application.

function greet(name: string): string { return `Hello, ${name}!`; } const message = greet("TypeScript"); console.log(message);
Click 'Compile & Run' to see output

Unit 2: Basic Types & Annotations

Master TypeScript's type system and type annotations

Basic Types

TypeScript's fundamental data types for type safety.

string number boolean array tuple enum any unknown

Type Annotations

Explicitly specify types for variables and functions.

Click to see type annotations

Type Inference

TypeScript automatically infers types when not explicitly provided.

TypeScript can infer types from initial values and usage patterns

Union Types

Variables that can hold values of multiple types.

Use | operator to create union types: string | number

Unit 3: Variables & Functions

Work with typed variables and function declarations

Variable Declarations

Declaring variables with explicit types in TypeScript.

let count: number = 0; const name: string = "TypeScript"; var isActive: boolean = true;

Function Types

Adding type annotations to function parameters and return values.

Function signatures include parameter types and return types

Optional Parameters

Making function parameters optional with the ? operator.

function greet(name: string, title?: string): string

Rest Parameters

Handling variable number of arguments with rest parameters.

Rest parameters must be the last parameter in function signature

Unit 4: Objects & Interfaces

Define object shapes and contracts with interfaces

Object Types

Defining the shape of objects with type annotations.

let person: { name: string; age: number } = { name: "John", age: 30 };

Interface Declarations

Creating reusable object type definitions with interfaces.

Click to see interface example

Optional Properties

Making object properties optional with the ? modifier.

Optional properties may or may not be present in the object

Index Signatures

Defining objects with dynamic property names.

[key: string]: any allows for dynamic property access

Unit 5: Classes & Inheritance

Master object-oriented programming with TypeScript classes

Class Declarations

Creating classes with typed properties and methods.

Click to see class definition

Access Modifiers

Controlling access to class members with modifiers.

public private protected readonly

Inheritance

Creating class hierarchies with extends keyword.

Animal (Base Class)
Dog extends Animal

Abstract Classes

Defining base classes that cannot be instantiated directly.

Abstract classes provide a common interface for derived classes

Unit 6: Generics

Create reusable and type-safe code with generic programming

Generic Functions

Creating functions that work with multiple types.

Click to see generic function

Generic Interfaces

Defining interfaces with type parameters.

Generic interfaces allow for flexible, reusable type definitions

Type Constraints

Limiting generic types with extends keyword.

Constraints ensure generic types have specific properties or methods

Mapped Types

Creating new types by transforming existing types.

Mapped types iterate over properties of existing types

Unit 7: Advanced Types

Explore TypeScript's advanced type system features

Union Types

Types that can be one of several possible types.

function formatValue(value: string | number): string { return typeof value === "string" ? value : value.toString(); }

Type Guards

Narrowing types within conditional blocks.

Type guards help TypeScript understand type narrowing in runtime checks

Discriminated Unions

Union types with a common discriminant property.

Discriminated unions enable exhaustive pattern matching

Conditional Types

Types that depend on a condition.

Conditional types enable advanced type-level programming

Unit 8: Modules & Namespaces

Organize code with modules and understand namespaces

ES6 Modules

Using import and export statements for code organization.

Click to see module syntax

Module Resolution

How TypeScript resolves module imports.

Relative imports: ./module
Absolute imports: node_modules

Namespaces

Organizing code with TypeScript namespaces.

Namespaces provide a way to group related functionality

Declaration Merging

Combining multiple declarations into a single definition.

Declaration merging allows extending existing types and modules

Unit 9: Type Assertions & Guards

Control type flow and make safe type assertions

Type Assertions

Telling TypeScript about the type of a value.

let value: unknown = "Hello World"; let length = (value as string).length; // or let length2 = (<string>value).length;

User-Defined Type Guards

Creating functions that act as type guards.

Type guard functions return a type predicate

Built-in Type Guards

Using typeof and instanceof for type narrowing.

typeof, instanceof, and in operator for type checking

Non-null Assertion

Using the ! operator to assert non-null values.

Use non-null assertion sparingly and only when certain of non-null value

Unit 10: Decorators & Metadata

Use decorators for meta-programming and framework integration

Decorator Basics

Understanding decorator syntax and usage.

Click to see decorator syntax

Class Decorators

Decorators that modify or replace class constructors.

@Component - Angular decorator
@Entity - Database decorator

Method Decorators

Decorators applied to class methods.

Method decorators can modify method behavior or add metadata

Reflect Metadata

Using reflection to access decorator metadata at runtime.

Reflect.defineMetadata and Reflect.getMetadata for runtime access

Unit 11: Error Handling & Debugging

Handle errors effectively and debug TypeScript applications

Error Types

Different types of errors in TypeScript applications.