ããã«ã¡ã¯ã½ã¦ã¾ã¦ç¤¾ãª@vvakameã§ãã TypeScript 2.8.1ãã¢ãã¦ã³ã¹ããã¾ããã What's new in TypeScriptãæ´æ°ããã¦ããããã§ãã ç ´å£çå¤æ´ããããï¼ ä»åãããã®è¾ºã«åã試ããæã®ã³ã¼ããæãã¦ãããã¨ã«ãã¾ããã å¤æ´ç¹ã¾ã¨ã Conditional typesï¼æ¡ä»¶ä»ãã®åï¼ Conditional types T extends U ? X : Y ã¿ãããªã®æ¸ãã Conditional typesã§ã®åæ¨è« Type inference in conditional types infer ã®å°å ¥ ããåã«å¼ãå½ã¦ã¯ããçµæãå¾ãããåæ¨è«ã®åãæ°ããªåãã©ã¡ã¿ã¨ãã¦å©ç¨å¯è½ type ReturnType<T> = T extends (...args: any[]) => infer R ? R : T; ãããã R ãæ°
{{#tags}}- {{label}}
{{/tags}}