0% found this document useful (0 votes)
19 views2 pages

Typescript Generics

Uploaded by

acaua.faria6753
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

Typescript Generics

Uploaded by

acaua.faria6753
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

TypeScript Generics Workshop Welcome

Typing Functions with Generics


Replace the unknown Type with a Generic
Restricting Generic Argument Types
Add Constraints to a Generic
Typing Independent Parameters
Use Multiple Generics with a Function
Approaches for Typing Object Parameters
Approaches for Typing Object Parameters: Solution
Generic Functions in Excalidraw
Generics in Classes
Add Types to a Class
Generic Mapper Function
Add Object Property Constraints to a Generic
The Importance of Generics in TypeScript
Add Type Parameters to a Function
Pass Type Arguments to a Function
Defaults in Type Parameters
Specify a Default Value
Infer Types from Type Arguments
Infer from the Type Arguments of a Class
Strongly Type a Reduce Function
Pass Type Arguments to a Reduce Function
Avoid any Types with Generics
Use Generics to Type a Fetch Request
Passing Type Arguments in cal.com
Improving Code Maintainability
Generics at Different Levels
Represent Generics at the Lowest Level
Typed Object Keys
Two Approaches for Typing Object Keys
Make a Generic Wrapper for a Function
Constrain a Type Argument to a Function
Understand Literal Inference in Generics
Understand Generic Inference When Using Objects as Arguments
Inferring Literal Types from any Basic Type
Accepting Multiple Literal Types
Infer the Type of an Array Member
Constrain to the Array Member, Not the Array
Generics in a Class Names Creator
Two Approaches to Working with Class Names
Generics in React Query
Generics with Conditional Types
Ensure Runtime Level & Type Level Safety with Conditional Types
Fixing Errors in Generic Functions
Fixing the "Not Assignable" Error
Generic Function Currying
Fix Type Inference in Curried Functions
Generic Interfaces with Functions
Understanding Generics at Different Levels of Functions
Spotting Useless Generics
Refactoring Functions with Unnecessary Type Arguments
Spotting Missing Generics
Improving Type Inference with Additional Generics
How tRPC Handles Inheritable Generics
Refactoring Generics for a Cleaner API
Create a Factory Function to Apply Type Arguments to All Child Functions
The Partial Inference Problem
A Workaround for The Lack of Partial Inference
What is a Function Overload?
Understanding Function Overloads
Function Overloads vs. Conditional Types
Match Return Types with Function Overloads
Debugging Overloaded Functions
Specifying Types for an Overloaded Function
Function Overloads vs. Union Types
When to Use Overloads and Unions
Generics in Function Overloads
Typing Different Function Use Cases
Solving an Inference Mystery
The Inference Mystery Solved
Use Function Overloads to Infer Initial Data
Split Functions Into Two Different Call Signatures
The "Instantiated with Subtype" Error
Handling Default Arguments with Function Overloads
Make An Infinite Scroll Function Generic with Correct Type Inference
Introduce a Type Parameter to Ensure Type Consistency
Create a Function with a Dynamic Number of Arguments
Use a Tuple to Represent a Dynamic Number of Arguments
Create a Pick Function
Extracting Object Properties with Reduce and Generics
Create a Form Validation Library
Add Strong Typing and Proper Error Handling to a Form Validator
Improve a Fetch Function to Handle Missing Type Arguments
Modify a Generic Type Default for Improved Error Messages
Typing a Function Composition with Overloads and Generics
Using Overloads and Generics to Type Function Composition
Build an Internationalization Library
Extract Types from Strings for an Internationalization Library

You might also like