{"id":305688,"date":"2020-06-21T15:00:46","date_gmt":"2020-06-21T15:00:46","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=305688"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=305688","title":{"rendered":"\u041a\u0430\u043a \u044f \u0437\u0430\u043a\u0440\u044b\u043b \u0442\u0440\u0435\u0445\u043b\u0435\u0442\u043d\u0438\u0439 issue \u0432 TypeScript"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/507522\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/iw\/u6\/24\/iwu624zqqotvo05frkqgtk1wqjq.jpeg\"><\/p>\n<p>  \u0412\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u043c\u043e\u0435\u0433\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 web worker&#8217;\u0430\u043c\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 TypeScript \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u0438. <\/p>\n<p>  \u042f \u0437\u0430\u0441\u0443\u0447\u0438\u043b \u0440\u0443\u043a\u0430\u0432\u0430 \u0438 \u0440\u0435\u0448\u0438\u043b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0421\u0443\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h2>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u043e\u0440\u043a\u0435\u0440 \u0438 \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0430 \u043d\u0435\u0433\u043e \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043a\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<pre><code class=\"javascript\">new Worker().addEventListener('message', (message) =&gt; {     message \/\/ MessageEvent     message.data \/\/ any }) <\/code><\/pre>\n<p>  \u0412 \u043f\u043e\u043b\u0435 <code>data<\/code> \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0447\u0442\u043e \u0432\u044b, \u0430\u0432\u0442\u043e\u0440 \u043a\u043e\u0434\u0430, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0435. \u0418 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0438\u043f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c.<\/p>\n<h3>\u0418\u0437\u0443\u0447\u0430\u0435\u043c MessageEvent \u043f\u043e\u0431\u043b\u0438\u0436\u0435<\/h3>\n<p>  MessageEvent \u2014 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0432\u043a\u043b\u0430\u0434\u043a\u0430\u043c\u0438, \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u043c\u0438, \u0441\u043e\u043a\u0435\u0442\u0430\u043c\u0438, WebRTC \u043a\u0430\u043d\u0430\u043b\u0430\u043c\u0438 \u0438 \u0442.\u0434. <\/p>\n<p>  \u0412 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0435 TypeScript \u044d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e <code>lib.dom.ts<\/code> \u0438 <code>lib.webworker.d.ts<\/code>, \u0438 \u043e\u043f\u0438\u0441\u0430\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">interface MessageEvent extends Event {     readonly data: any;     readonly lastEventId: string;     readonly origin: string;     readonly ports: ReadonlyArray&lt;MessagePort&gt;;     readonly source: MessageEventSource | null; } <\/code><\/pre>\n<p>  \u041e\u043f\u044b\u0442\u043d\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u0440\u0430\u0437\u0443 \u0443\u0432\u0438\u0434\u044f\u0442 \u0442\u0443\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u042d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0435 <a href=\"https:\/\/www.typescriptlang.org\/docs\/handbook\/generics.html\" rel=\"nofollow\">Generic<\/a> \u2014 \u043f\u043e\u043b\u0435 <code>data<\/code> \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0441\u0442\u0440\u043e\u0433\u043e \u043a\u0430\u043a <b>any<\/b>, \u0438 \u043c\u044b \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043d\u0430 \u044d\u0442\u043e \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u0438\u0437 \u0432\u043d\u0435.<\/p>\n<p>  \u0420\u0435\u0448\u0438\u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 TypeScript \u044f \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0448\u0435\u043b <a href=\"https:\/\/github.com\/microsoft\/TypeScript\/issues\/19370\" rel=\"nofollow\">issue<\/a> \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0418 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u2014 \u0430\u0432\u0442\u043e\u0440 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041d\u043e \u0437\u0430 \u043f\u043e\u0447\u0442\u0438 <b>\u0442\u0440\u0438 \u0433\u043e\u0434\u0430<\/b>, \u043e\u043d\u043e \u0442\u0430\u043a \u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e. \u042f \u0437\u0430\u0441\u0443\u0447\u0438\u043b \u0440\u0443\u043a\u0430\u0432\u0430, \u0438 \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e. <\/p>\n<p>  \u0412\u0441\u0435\u0433\u043e-\u0442\u043e \u0438 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 MessageEvent, \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 <b>lib\/lib.dom.d.ts<\/b> \u0438 <b>lib\/lib.webworker.d.ts<\/b> \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u0432\u0438\u0434\u0443:<\/p>\n<pre><code class=\"javascript\">interface MessageEvent&lt;T = any&gt; extends Event {     readonly data: T;     readonly lastEventId: string;     readonly origin: string;     readonly ports: ReadonlyArray&lt;MessagePort&gt;;     readonly source: MessageEventSource | null; } <\/code><\/pre>\n<p>   \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e.<\/p>\n<h2>\u0418\u0437\u0443\u0447\u0430\u0435\u043c TypeScript Instructions for Contributing Code<\/h2>\n<p>  \u0412 \u043d\u0435\u043c \u0435\u0441\u0442\u044c \u0446\u0435\u043b\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0439 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 <b>lib.d.ts<\/b>. \u041e\u0442\u0442\u0443\u0434\u0430 \u0443\u0437\u043d\u0430\u0451\u043c \u0434\u0432\u0435 \u0432\u0435\u0449\u0438:<\/p>\n<ol>\n<li>\u0424\u0430\u0439\u043b\u044b \u0432 \u043f\u0430\u043f\u043a\u0435 <b>lib\/<\/b> \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f. \u0422\u0430\u043c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f last-known-good \u0432\u0435\u0440\u0441\u0438\u0438 \u0438 \u043e\u043d\u0438 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 <b>src\/lib\/<\/b>. \u0412\u043e\u0442 \u0432 \u043d\u0438\u0445 \u0442\u043e \u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u043a\u0438. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e <b>src\/lib\/dom.generated.d.ts<\/b> \u0438 <b>src\/lib\/webworker.generated.d.ts<\/b><\/li>\n<li>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <b>src\/lib\/<\/b> \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0417\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0445 (<b>.generated.d.ts<\/b>). \u0422\u0430\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b <a href=\"https:\/\/github.com\/microsoft\/TSJS-lib-generator\" rel=\"nofollow\">TSJS-lib-generator<\/a> \u0438 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u043a\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0435\u0451.<\/li>\n<\/ol>\n<p>  <\/p>\n<h3>\u0418\u0437\u0443\u0447\u0430\u0435\u043c TSJS-lib-generator<\/h3>\n<p>  TSJS-lib-generator \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 (\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 TS) \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0441\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 Microsoft Edge \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0438\u0445 \u0432 \u043d\u0430\u0431\u043e\u0440 TypeScript \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435. <\/p>\n<p>  \u0412\u0441\u0435 \u044d\u0442\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 json \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 <b>addedTypes.json<\/b>, <b>overridingTypes.json<\/b> \u0438 <b>removedTypes.json<\/b>.<\/p>\n<h3>\u041f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f MessageEvent<\/h3>\n<p>  \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e <b>\u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439<\/b> \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <b>overridingTypes.json<\/b>. <\/p>\n<p>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043e\u0431 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0435 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438. <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0432 <b>overridingTypes.json<\/b> \u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435 <code>interfaces<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445 \u043b\u0438\u0431\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432:<\/p>\n<pre><code class=\"json\">{   &quot;interfaces&quot;: {     &quot;interface&quot;: {       &quot;MessageEvent&quot;: {}     }   } } <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u043b\u043e\u0441\u044c:<\/p>\n<pre><code class=\"bash\">npm run build <\/code><\/pre>\n<p>  TSJS-lib-generator \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 <b>*.generated.d.ts<\/b> \u0444\u0430\u0439\u043b\u044b. \u0418 \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b <b>*.generated.d.ts<\/b> \u0444\u0430\u0439\u043b\u0430\u043c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 TS.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <code>type-parameters<\/code>, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044f MessageEvent \u0432 Generic:<\/p>\n<pre><code class=\"json\">{   &quot;interfaces&quot;: {     &quot;interface&quot;: {       &quot;MessageEvent&quot;: {         &quot;type-parameters&quot;: [           {             &quot;name&quot;: &quot;T&quot;,             &quot;default&quot;: &quot;any&quot;           }         ]       }     }   } } <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"javascript\">interface MessageEvent&lt;T = any&gt; extends Event {     readonly data: any;     readonly lastEventId: string;     readonly origin: string;     readonly ports: ReadonlyArray&lt;MessagePort&gt;;     readonly source: MessageEventSource | null; } <\/code><\/pre>\n<p>  \u0423\u0436\u0435 \u0431\u043b\u0438\u0436\u0435 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u044b \u0432 \u0438\u0442\u043e\u0433\u0435 \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>data<\/code> \u0438 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"json\">{   &quot;interfaces&quot;: {     &quot;interface&quot;: {       &quot;MessageEvent&quot;: {         &quot;name&quot;: &quot;MessageEvent&quot;,         &quot;type-parameters&quot;: [           {             &quot;name&quot;: &quot;T&quot;,             &quot;default&quot;: &quot;any&quot;           }         ],         &quot;properties&quot;: {           &quot;property&quot;: {             &quot;data&quot;: {               &quot;name&quot;: &quot;data&quot;,               &quot;read-only&quot;: 1,               &quot;override-type&quot;: &quot;T&quot;             }           }         },         &quot;constructor&quot;: {           &quot;override-signatures&quot;: [             &quot;new&lt;T&gt;(type: string, eventInitDict?: MessageEventInit&lt;T&gt;): MessageEvent&lt;T&gt;&quot;           ]         }       }     }   } } <\/code><\/pre>\n<p>  \u0418 \u0432\u0443\u0430\u043b\u044f! \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e. <\/p>\n<pre><code class=\"javascript\">interface MessageEvent&lt;T = any&gt; extends Event {     readonly data: T;     readonly lastEventId: string;     readonly origin: string;     readonly ports: ReadonlyArray&lt;MessagePort&gt;;     readonly source: MessageEventSource | null; } <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0434\u0435\u043b\u043e \u0437\u0430 \u043c\u0430\u043b\u044b\u043c:<\/p>\n<ul>\n<li>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b<\/li>\n<li>\u041e\u0444\u043e\u0440\u043c\u0438\u0442\u044c Pull Request \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 <a href=\"https:\/\/github.com\/microsoft\/TSJS-lib-generator\/tree\/af75df4264964bac7e8acb7f359866b151ec94e4#contribution-guidelines\" rel=\"nofollow\">Contribution Guidelines<\/a><\/li>\n<li>\u0418 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c <a href=\"https:\/\/cla.opensource.microsoft.com\/microsoft\/TSJS-lib-generator?pullRequest=860\" rel=\"nofollow\">CLA<\/a> \u043e\u0442 Microsoft.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>  \u0421\u043f\u0443\u0441\u0442\u044f \u043d\u0435\u0434\u0435\u043b\u044e \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 <a href=\"https:\/\/github.com\/microsoft\/TSJS-lib-generator\/pull\/860\" rel=\"nofollow\">\u043c\u043e\u0439 Pull Request<\/a> \u0431\u044b\u043b \u043f\u0440\u0438\u043d\u044f\u0442. 12.06.2020 \u0431\u044b\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u044b <code><b>src\/lib\/<\/b>dom.generated.d.ts<\/code> \u0438 <code><b>src\/lib\/<\/b>webworker.generated.d.ts<\/code> \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 TypeScript. \u0410 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043d\u044b \u0432 <code><b>lib\/<\/b>lib.dom.ts<\/code> \u0438 <code><b>lib\/<\/b>lib.webworker.d.ts<\/code> \u0438 \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 <a href=\"https:\/\/www.typescriptlang.org\/play\/index.html?ts=Nightly#code\/HYUw7gBA6g9gTgaxHAFAcjQSgHQEMAm+AogG4jAAuAMgJYDOF5y6AtiHXbgOYhoA0EFGw7cQALggBZdpx6lyFADzAAriwBGyANoBdAHyYIAXj0QA3gCgI1iMNkgrNu6Oz5cFXBYC+mIA\" rel=\"nofollow\">TypeScript Nightly<\/a>.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/507522\/\"> https:\/\/habr.com\/ru\/post\/507522\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/507522\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/iw\/u6\/24\/iwu624zqqotvo05frkqgtk1wqjq.jpeg\"><\/p>\n<p>  \u0412\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 \u043c\u043e\u0435\u0433\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 web worker&#8217;\u0430\u043c\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0430 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 TypeScript \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u0438. <\/p>\n<p>  \u042f \u0437\u0430\u0441\u0443\u0447\u0438\u043b \u0440\u0443\u043a\u0430\u0432\u0430 \u0438 \u0440\u0435\u0448\u0438\u043b \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-305688","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305688","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=305688"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305688\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=305688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=305688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}