Tag: TypeScript

HomeTagsTypeScript

Become a member

Get related updates from Syskool.

Template Literal Types: Dynamic String Typing

Table of Contents Introduction What Are Template Literal Types? Basic Syntax of Template Literal Types Combining Static and Dynamic Parts in Template Literals Advanced Usage of Template Literals Creating String...

Mapped Types: Creating New Types Dynamically

Table of Contents Introduction What Are Mapped Types? Basic Syntax of Mapped Types Common Use Cases of Mapped Types Creating Read-Only and Writable Types Using Mapped Types with keyof and...

Conditional Types: Extends, Infer, and Distributive Conditions

Table of Contents Introduction What Are Conditional Types in TypeScript? Basic Syntax of Conditional Types Understanding extends in Conditional Types The infer Keyword in Conditional Types Distributive Conditional Types Practical Examples Example...

Using keyof, typeof, and Lookup Types with Generics

Table of Contents Introduction What Are keyof, typeof, and Lookup Types? Why Use keyof, typeof, and Lookup Types with Generics? Understanding keyof with Generics Using typeof with Generics Lookup Types...

Constraints on Generics

Table of Contents Introduction What Are Constraints on Generics? Why Use Constraints? How to Define Constraints on Generics Using extends for Constraints Constraints with Interfaces and Types Multiple Constraints with & Example...

Generic Interfaces and Classes

Table of Contents Introduction What Are Generic Interfaces? Defining a Generic Interface Using Generic Interfaces with Different Types Generic Classes in TypeScript Defining a Generic Class Using Generic Classes with Multiple...

Generic Functions: Flexibility in Parameters

Table of Contents Introduction What Are Generic Functions? Benefits of Generic Functions Syntax of Generic Functions Using Generic Functions with Multiple Parameters Constraints in Generic Functions Example 1: Swapping Two Values Example...

Introduction to Generics in TypeScript

Table of Contents Introduction What Are Generics? Why Use Generics? Basic Syntax of Generics Generic Function Generic Class Working with Multiple Type Parameters Constraints in Generics Using Generics with Interfaces Use Cases for Generics Example...

Getters and Setters in TypeScript Classes

Table of Contents Introduction What Are Getters and Setters? Defining Getters and Setters in TypeScript Accessing Getters and Setters Benefits of Using Getters and Setters Use Cases for Getters and...

Static Methods and Properties Explained in TypeScript

Table of Contents Introduction What Are Static Methods and Properties? Defining Static Methods and Properties Accessing Static Methods and Properties Static vs Instance Methods and Properties Use Cases for Static...

Abstract Classes and Interface Implementation in TypeScript

Table of Contents Introduction What is an Abstract Class? Defining an Abstract Class Abstract Methods in TypeScript When to Use Abstract Classes What is an Interface? Defining an Interface Implementing an Interface When...

Composition over Inheritance in TypeScript

Table of Contents Introduction Understanding Inheritance and Composition Why Prefer Composition Over Inheritance? Composition in TypeScript Using Interfaces and Classes for Composition Composition Example: Combining Behaviors Benefits of Composition When to Use...

Categories