some TypeScript toy codes
- generics, partial fields & pick
- extends 1 add default fields. union string operations,
- another way to do 2
- use
infer
to implementFirstArgument
andSecondArgument
Diff
andFilter
for union string,Omit
for object- a comprehensive example: generic function
- another comprehensive example: generic class
- Intersection Types and
Partial2