About the Instructor
- Frontend Masters instructor for 9 years
- Developer Platform Lead @ Stripe
- Designs Stripe’s API semantics
- Architect responsible for TypeScript projects like node-stripe, Stripe Shell, and Stripe Workbench
Top Goals for this course
- Pass along key knowledge gained through thousands of hours of TypeScript teaching, Q&A and pair programming
- Give you a framework for understanding challenging type information.
- Teach you how to understand and use a wide range of TypeScript’s built-in utility types
This likely is pretty scary right now, but you’ll know what it means by the end of the course
tsTry
// Get keys of type T whose values are assignable to type UtypeFilteredKeys <T ,U > = {[P in keyofT ]:T [P ] extendsU ?P : never}[keyofT ] &keyofT /*** get a subset of Document, consisting only of methods* returning an Element (e.g., querySelector) or an* Element[] (e.g., querySelectorAll)*/typeValueFilteredDoc =Pick <Document ,FilteredKeys <Document ,(...args : any[]) =>Element |Element []>>
What do you assume I already know?
- Modern javascript
- The basics of function, object and array types
- Basic generics (e.g., TypeScript Fundamentals v4 - Generics)
- Index signatures
Also… some practical experience always helps!
Workshop Setup
As long as you can access the following websites, you should require no further setup
If you’d like to follow along with interactive examples, please install Volta
sh
curl https://get.volta.sh | bash # Linux / macOS onlyvolta install node@lts yarn@^3
Make sure to follow the installation instructions for volta
— both what you see on the website and what you see in the CLI console. Next, clone the git repo for this course github.com/mike-north/typescript-courses, enter the directory, and run yarn
to install all dependencies
sh
git clone https://github.com/mike-north/typescript-coursescd typescript-coursesyarn
most of our work today will be in the packages/notes-intermediate-ts-v2
folder
sh
cd packages/notes-intermediate-ts-v2