Lets talk about
Typescript type system
TypeScript types
- types
- interfaces
- namespaces
- modules
- enums
Types
Object types
Index types
Interface vs type
- Basically the same
- Only difference is how name collisions resolved
- For interfaces - they are merged, for types - error will be raised
- For ES6 every file is a module, so you don't really care
Window and other global objects
- Sometimes you need to declare something on window
- As window is declared as an interface in typescript - you can just extend it
Generics(Template types)
Useful standard generics
Useful standard generics
- Partial<T>
- Record<K, T>
- Pick<T, K>
Advanced types
Lest build an opposite for Pick
Conclusion
Thanks for coming