{"id":1882,"date":"2023-12-15T05:00:00","date_gmt":"2023-12-15T13:00:00","guid":{"rendered":"https:\/\/www.angulartraining.com\/daily-newsletter\/?p=1882"},"modified":"2023-12-14T15:07:39","modified_gmt":"2023-12-14T23:07:39","slug":"typescript-cheatsheet-type","status":"publish","type":"post","link":"https:\/\/www.angulartraining.com\/daily-newsletter\/typescript-cheatsheet-type\/","title":{"rendered":"Typescript Cheatsheet: Type"},"content":{"rendered":"\n<p>A few months back, I shared a cheat sheet for <a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/typescript-cheatsheet-control-flow\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Typescript Control Flow<\/a>. Today, I want to share a cheat sheet on types, which are the main reason why Typescript is so useful.<\/p>\n\n\n\n<p>A few interesting features that aren&#8217;t too well known:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>keyof<\/code> operator and the <code>Type[Property]<\/code> illustrated in the <a href=\"https:\/\/www.typescriptlang.org\/docs\/handbook\/2\/mapped-types.html\" target=\"_blank\" rel=\"noopener\" title=\"\">Mapped Types<\/a> section<\/li>\n\n\n\n<li>One of my favorites: <a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/union-types-in-typescript\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Union types<\/a> and the even more powerful Template Union Types (bottom right corner of the cheat sheet)<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.typescriptlang.org\/static\/TypeScript%20Types-ae199d69aeecf7d4a2704a528d0fd3f9.png\" alt=\"\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>You can <a href=\"https:\/\/www.typescriptlang.org\/static\/TypeScript%20Types-ae199d69aeecf7d4a2704a528d0fd3f9.png\" target=\"_blank\" rel=\"noopener\" title=\"\">click here to see the full-size cheatsheet<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few months back, I shared a cheat sheet for Typescript Control Flow. Today, I want to share a cheat sheet on types, which are the main reason why Typescript is so useful. A few interesting features that aren&#8217;t too well known: You can click here to see the full-size cheatsheet.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1882","post","type-post","status-publish","format-standard","hentry","category-typescript"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/1882","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/comments?post=1882"}],"version-history":[{"count":2,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/1882\/revisions"}],"predecessor-version":[{"id":1884,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/1882\/revisions\/1884"}],"wp:attachment":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/media?parent=1882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/categories?post=1882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/tags?post=1882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}