DEV Community

Notes on TypeScript: Type Level Programming Part 1

A. Sharif on February 09, 2019

Introduction These notes should help in better understanding TypeScript and might be helpful when needing to lookup up how leverage Type...
Collapse
 
cezarneaga profile image
Cezar Neaga

nice one as always Ali!

found some typos i think:

// Test MakePick
type NewProfile = MakePick<Profile, "id" | "title">;

/*
type NewUserProfile = { // this should be NewProfile?

and

We can replace our previously defined MakePick and MakeExclude with Pick and Extract that come with TypeScript.

Extract should be Exclude?

Collapse
 
busypeoples profile image
A. Sharif

Thanks Cezar!

Updated the post.

Collapse
 
faiwer profile image
Stepan Zubashev

Hi. Probably I found one mistake or type in the article. "type NonExistentKeys" will be "url" instead of "name", because "Profile" doesn't contain field "name", and U is for Profile's keys.

typescriptlang.org /play/#code/C4TwDgpgBAqgzhATlAvFA3lAlgEwFxQB2ArgLYBGSA3EQIakQFzCJaEDmNwWwANo1GasONAL5UAUKEhQACogD2AMyz9UGbPiJlKiLj35MWbTlGKJeR4afFTw0ALK0A1hACiADwDGvYjggAPAAqADSwAHzqMFAQHsAQhDhwUEFQAPxEEABuSFAEMJLS0AByCoTqTq6ePn6BriDKsAiIYfWN8sqqEOFAA