Sé que hay una función de selección en texto mecanografiado, así
type Article = { title: string; body: string; image: string; } type ArticlePreview = Pick<Article, 'title'>pero en realidad puedes acceder a la propiedad
type ArticleTitle = Article['title']¿Cuál es la ventaja de usar Pick? Veo que la segunda opción es más simple y directa.
Calcula un tipo diferente, los dos tipos tienen un uso diferente ( ArticlePreview vs ArticleTitle ).
type ArticlePreview = Pick<Article, 'title'>; // equivalent to: type ArticlePreview = { title: string }; // or to: type ArticlePreview = { title: Article['title'] }; // You could pick more properties using union inside the generic type ArticlePreview2 = Pick<Article, 'title' | 'image'> // While type ArticleTitle = Article['title'] // is equivalent to: type ArticleTitle = string