Practical Type Operations of TypeScript
I often use
Overload



Moment
React


Generic
Like parameters of type ?





Constraints


Constraints

Index
Interface

Mapped Types




Conditional Type




Type Utilities
Partial<T>


Required<T>


Readonly<T>


NonNullable<T>


ReturnType<T>


Parameters<T>


Record<Keys, Type>


Exclude<Type, Other>


Extract<Type, Other>


Pick<Keys, Type>


Omit<Keys, Type>


Infer


Example 1
Get event type by corresponding handler name



Get event handlers

Get event handler by name




Get event by name


Example 2
From LeetCode frontend JD





Only pick functions


Extract promise & action

Combine extractors


Template literal types
Key Augment
v4.1
2020-11-17










References
Q & A
Practical Type Operations of TypeScript - I often use
By jjaayy
Practical Type Operations of TypeScript - I often use
- 519