{"id":215386,"date":"2021-04-08T09:00:02","date_gmt":"2021-04-08T01:00:02","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=215386"},"modified":"2021-03-30T16:26:29","modified_gmt":"2021-03-30T08:26:29","slug":"typescript-42-release","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/typescript-42-release.html","title":{"rendered":"TypeScript 4.2\u8fd9\u4e9b\u65b0\u7279\u6027\u4f60\u8981\u77e5\u9053"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nTypeScript 4.2 \u53d1\u5e03\u4e86\uff01\u5bf9\u4e8e\u4e0d\u719f\u6089 TypeScript \u7684\u4eba\u6765\u8bf4\uff0cTypeScript \u5c31\u662f\u589e\u52a0\u4e86\u9759\u6001\u7c7b\u578b\u548c\u7c7b\u578b\u68c0\u67e5\u7684javaScript\u3002\u6709\u4e86\u7c7b\u578b\u9650\u5236\uff0c\u4f60\u5c31\u53ef\u4ee5\u7cbe\u786e\u7684\u8868\u8fbe\u4f60\u7684\u51fd\u6570\u9700\u8981\u4ec0\u4e48\u7c7b\u578b\u7684\u53c2\u6570\u4ee5\u53ca\u8fd4\u56de\u4ec0\u4e48\u7c7b\u578b\u7684\u7ed3\u679c\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

TypeScript 4.2 \u53d1\u5e03\u4e86\uff01\u5bf9\u4e8e\u4e0d\u719f\u6089 TypeScript \u7684\u4eba\u6765\u8bf4\uff0cTypeScript \u5c31\u662f\u589e\u52a0\u4e86\u9759\u6001\u7c7b\u578b\u548c\u7c7b\u578b\u68c0\u67e5\u7684 JavaScript\u3002\u6709\u4e86\u7c7b\u578b\u9650\u5236\uff0c\u4f60\u5c31\u53ef\u4ee5\u7cbe\u786e\u7684\u8868\u8fbe\u4f60\u7684\u51fd\u6570\u9700\u8981\u4ec0\u4e48\u7c7b\u578b\u7684\u53c2\u6570\u4ee5\u53ca\u8fd4\u56de\u4ec0\u4e48\u7c7b\u578b\u7684\u7ed3\u679c\u3002<\/p>\n

\u540c\u65f6\uff0c\u5229\u7528 TypeScript \u7684\u7c7b\u578b\u68c0\u67e5\uff0c\u4f60\u53ef\u4ee5\u5f88\u5bb9\u6613\u907f\u514d\u4e00\u4e9b\u5e38\u89c1\u9519\u8bef\uff0c\u4f8b\u5982\u62fc\u5199\u9519\u8bef\u6216\u8005\u5fd8\u8bb0\u5904\u7406 null \u548c undefined\u3002\u56e0\u4e3a TypeScript \u4ee3\u7801\u770b\u8d77\u6765\u5c31\u50cf\u662f\u589e\u52a0\u4e86\u7c7b\u578b\u7684 JavaScript\uff0c\u6240\u4ee5\u4f60\u5bf9 JavaScript \u6240\u77e5\u7684\u4e00\u5207\u77e5\u8bc6\u4f9d\u7136\u9002\u7528\u4e8e TypeScript\u3002\u5728\u9700\u8981\u7684\u65f6\u5019\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5265\u79bb\u7c7b\u578b\uff0c\u4ece\u800c\u83b7\u5f97\u7eaf\u51c0\u3001\u53ef\u8bfb\u5e76\u4e14\u5728\u4efb\u4f55\u5730\u65b9\u53ef\u4ee5\u8fd0\u884c\u7684 JavaScript \u4ee3\u7801\u3002<\/p>\n

\u5f00\u59cb\u4f7f\u7528 TypeScript 4.2\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7 NuGet\u5b89\u88c5\uff0c\u6216\u4f7f\u7528 npm \u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

npm install typescript \r\n<\/pre>\n

\u8ba9\u6211\u4eec\u9884\u89c8\u4e00\u4e0b TypeScript 4.2 \u7684\u65b0\u7279\u6027\uff1a<\/p>\n

    \n
  • \u66f4\u667a\u80fd\u7684\u7c7b\u578b\u522b\u540d\u4fdd\u6301<\/li>\n
  • \u5143\u7ec4\u7c7b\u578b\u4e2d\u7684\u524d\u7f6e\/\u4e2d\u7f6e\u7684\u6269\u5c55\u5143\u7d20<\/li>\n
  • \u66f4\u4e25\u683c\u7684 in \u8fd0\u7b97\u7b26\u68c0\u67e5<\/li>\n
  • --noPropertyAccessFromIndexSignature<\/li>\n
  • \u62bd\u8c61\u6784\u5efa\u7b7e\u540d<\/li>\n
  • \u901a\u8fc7 --explainFiles \u4e86\u89e3\u4f60\u7684\u9879\u76ee\u7ed3\u6784<\/li>\n
  • \u6539\u8fdb\u903b\u8f91\u8868\u8fbe\u5f0f\u4e2d\u975e\u6267\u884c\u51fd\u6570\u7684\u68c0\u67e5<\/li>\n
  • \u53ef\u4ee5\u5c06\u89e3\u6784\u53d8\u91cf\u660e\u786e\u6807\u8bb0\u4e3a\u672a\u4f7f\u7528<\/li>\n
  • \u5728\u53ef\u9009\u5c5e\u6027\u548c\u5b57\u7b26\u4e32\u7d22\u5f15\u7b7e\u540d\u4e4b\u95f4\u5bbd\u677e\u7684\u89c4\u5219<\/li>\n
  • \u58f0\u660e\u7f3a\u5c11\u7684\u5e2e\u52a9\u51fd\u6570<\/li>\n
  • \u7834\u574f\u6027\u53d8\u5316<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"

    TypeScript 4.2 \u53d1\u5e03\u4e86\uff01\u5bf9\u4e8e\u4e0d\u719f\u6089 TypeScript \u7684\u4eba\u6765\u8bf4\uff0cTypeScript \u5c31\u662f\u589e […]<\/p>\n","protected":false},"author":317,"featured_media":35645,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-215386","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/215386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/317"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=215386"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/215386\/revisions"}],"predecessor-version":[{"id":215390,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/215386\/revisions\/215390"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/35645"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=215386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=215386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=215386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}