{"id":472728,"date":"2025-08-31T15:00:26","date_gmt":"2025-08-31T15:00:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=472728"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=472728","title":{"rendered":"<span>\u041e\u0441\u043e\u0437\u043d\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 TypeScript: \u0421\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u0445\u0434\u043e\u043b\u0433\u0430 \u0434\u043b\u044f \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 TypeScript \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u043e\u043b\u0433 \u2014 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 (\u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0438\u0441\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443. \u041e\u0441\u043e\u0437\u043d\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430, \u0447\u0442\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044e \u043d\u043e\u0432\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043a\u0443. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"typescript\">\/\/ \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u0430\u043a \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 const segmentTypes = [   'line',   'quadratic', ] as const; type SegmentType = typeof segmentTypes[number]; \/\/ Union-\u0442\u0438\u043f: 'line' | 'quadratic'  \/\/ \u0423\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0439 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 (discriminated \u043f\u043e T) type SegmentCoords&lt;T extends SegmentType&gt; =   T extends 'line' ? [x: number, y: number] :  \/\/ \u0414\u043b\u044f 'line' \u2014 \u0434\u0432\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b   T extends 'quadratic' ? [controlX: number, controlY: number, x: number, y: number] :  \/\/ \u0414\u043b\u044f 'quadratic' \u2014 \u0447\u0435\u0442\u044b\u0440\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b <\/code><\/pre>\n<p>\u042d\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0430\u0442 \u0431\u0430\u0437\u043e\u0439 \u0434\u043b\u044f \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 <code>PathSegment<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0440\u0430\u0437\u0431\u0435\u0440\u0443 \u043d\u0438\u0436\u0435.<\/p>\n<h3>\u041e\u0431\u0437\u043e\u0440 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432<\/h3>\n<h4>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 1: Mapped Types \u0441 Indexed Access<\/h4>\n<p>\u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 mapped types \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0433\u0434\u0435 \u043a\u043b\u044e\u0447\u0438 \u2014 \u0442\u0438\u043f\u044b \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u2014 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c type \u0438 coords. Indexed access \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 discriminated union. \u041f\u043e\u0434\u0445\u043e\u0434 \u043e\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u043f\u043f\u0438\u043d\u0433 TypeScript, \u0433\u0434\u0435 \u0442\u0438\u043f\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e union, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u0433\u0443\u044e \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 type \u0438 coords \u0431\u0435\u0437 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"typescript\">\/\/ Mapped type: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e T \u0432 SegmentType \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 { type: T; coords: SegmentCoords&lt;T&gt; } type PathSegment1 = {   [T in SegmentType]: {  \/\/ \u0418\u0442\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u043e union SegmentType     type: T;  \/\/ Discriminant: \u0441\u0442\u0440\u043e\u043a\u0430-\u043b\u0438\u0442\u0435\u0440\u0430\u043b \u0434\u043b\u044f \u0441\u0443\u0436\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430     coords: SegmentCoords&lt;T&gt;;  O\/\/ \u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u043e\u0442 T   }; }[SegmentType];  \/\/ Indexed access: union \u0432\u0441\u0435\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 mapped type <\/code><\/pre>\n<p>\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u043b\u043d\u043e\u0435 \u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430: TypeScript \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 coords \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 type, \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0434\u043b\u044f &#8216;line&#8217;. \u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442 \u0438\u0437-\u0437\u0430 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 mapped types, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 TypeScript, \u043d\u043e \u044d\u0442\u043e \u043e\u043a\u0443\u043f\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0433\u0434\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0438\u043f\u043e\u0432 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 union. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0442\u0438\u043f\u043e\u0432 \u0438\u0437-\u0437\u0430 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430, \u043d\u043e runtime \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442\u0430, \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0442\u0435\u0445\u0434\u043e\u043b\u0433 \u0432 \u0434\u043e\u043b\u0433\u043e\u0441\u0440\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0442\u0438\u043f\u0430\u0445, \u043d\u043e \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445 \u0441 \u0434\u0436\u0443\u043d\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u044e\u044e \u0432\u043e\u0437\u043d\u044e, \u043f\u0440\u0438\u0432\u043e\u0434\u044f \u043a \u0444\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e any \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u043f\u043e\u043b\u043d\u043e\u0435 \u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435 (\u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u0430\u0432\u0442\u043e-\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f union)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u0412\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435 (\u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0435\u0442)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c runtime<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u043d\u0435\u0442 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0424\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f juniors<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435 (\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 \u0437\u043d\u0430\u043d\u0438\u0439)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 2: Record Utility Type<\/h4>\n<p>\u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 Record \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430-\u0442\u0438\u043f\u0430 \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0438\u0437 SegmentType \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u0449\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u043d\u043e \u0441 coords, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u043c\u0438 \u043e\u0442 SegmentType (union). Union \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 keyof. \u042d\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 mapped types \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u043d\u043e Record \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044e, \u043d\u043e \u0436\u0435\u0440\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u043e\u0441\u0442\u044c\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0431\u0435\u0437 \u0441\u0442\u0440\u043e\u0433\u043e\u0433\u043e \u0441\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"typescript\">\/\/ Record: \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 SegmentType \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 {type: SegmentType; coords: SegmentCoords&lt;SegmentType&gt;} type PathSegmentRecord = Record&lt;SegmentType, {  \/\/ \u041a\u043b\u044e\u0447\u0438 \u2014 'line' | 'quadratic'   type: SegmentType;  \/\/ Union \u0434\u043b\u044f type, \u0431\u0435\u0437 \u0441\u0442\u0440\u043e\u0433\u043e\u0433\u043e \u0441\u0443\u0436\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 Record   coords: SegmentCoords&lt;SegmentType&gt;;  \/\/ Union coords, \u043c\u0435\u043d\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u0438\u0439 }&gt;; type PathSegment2 = PathSegmentRecord[keyof PathSegmentRecord];  \/\/ Union \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 Record <\/code><\/pre>\n<p>\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043d\u0438\u0436\u0435, \u0447\u0435\u043c \u0432 mapped types, \u0438\u0437-\u0437\u0430 union \u0432 coords \u0432\u043d\u0443\u0442\u0440\u0438 Record, \u0447\u0442\u043e \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u043e\u0441\u0442\u044c \u0441\u0443\u0436\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b Record, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u0432\u0443\u0445 \u0448\u0430\u0433\u043e\u0432 (Record + keyof), \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u0435. \u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 segmentTypes \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f, \u043d\u043e \u0440\u043e\u0441\u0442 union \u0432 coords \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0438\u0441\u043a\u0438. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0434\u043b\u044f \u043c\u0430\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0442\u0438\u043f\u043e\u0432, runtime \u0431\u0435\u0437 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432.<\/p>\n<p>\u0414\u043b\u044f \u043c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442\u0430 \u044d\u0442\u043e \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0442\u0435\u0445\u0434\u043e\u043b\u0433 \u0432 \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0433\u0440\u0435\u0439\u0434\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445, \u043d\u043e \u043f\u0440\u0438 \u0447\u0430\u0441\u0442\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0442\u0438\u043f\u043e\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0435\u0441\u0442\u044c \u0436\u0435\u0440\u0442\u0432\u0430 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0440\u0438\u0432\u043e\u0434\u044f \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c, \u0442\u0430\u043a\u0438\u043c \u043a\u0430\u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0438\u043f\u043e\u0432. \u0414\u0436\u0443\u043d\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f \u0441 keyof, \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044f \u0435\u0433\u043e \u043a\u0430\u043a &#171;\u043c\u0430\u0433\u0438\u044e&#187;, \u0447\u0442\u043e \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0444\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044e.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 union)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435 (\u0434\u0432\u0430 \u0448\u0430\u0433\u0430 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 segmentTypes)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u0412\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c runtime<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u0447\u0438\u0441\u0442\u0430\u044f \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044f)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0424\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f juniors<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (keyof \u0441\u043b\u043e\u0436\u0435\u043d \u0434\u043b\u044f \u0434\u0436\u0443\u043d\u043e\u0432)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 3: Generic Type with Default<\/h4>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 generics \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0433\u0434\u0435 PathSegment \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f. Default T=SegmentType \u0441\u043e\u0437\u0434\u0430\u0435\u0442 union. \u0410\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 generics, \u0433\u0434\u0435 \u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0447\u0435\u0440\u0435\u0437 conditional types \u0432 SegmentCoords, \u0431\u0435\u0437 \u044f\u0432\u043d\u043e\u0433\u043e union.<\/p>\n<pre><code class=\"typescript\">\/\/ Generic: T constrained SegmentType, default \u2014 union type PathSegment5&lt;T extends SegmentType = SegmentType&gt; = {  \/\/ Parameterized, default union   type: T;  \/\/ Discriminant \u0441 generic T   coords: SegmentCoords&lt;T&gt;;  \/\/ \u0417\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 coords }; <\/code><\/pre>\n<p>\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u0430 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f generics, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u043c \u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u044f\u0432\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f T. \u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0430 \u0438\u0437-\u0437\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b generics, \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 \u043c\u043d\u043e\u0433\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 segmentTypes \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 default union, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0431\u044b\u0441\u0442\u0440\u0430\u044f, runtime \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u044c.<\/p>\n<p>\u041c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442\u0443 \u044d\u0442\u043e \u0432\u044b\u0433\u043e\u0434\u043d\u043e \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0441\u043d\u0438\u0436\u0430\u044f \u0442\u0435\u0445\u0434\u043e\u043b\u0433. \u0414\u0436\u0443\u043d\u044b \u043c\u0435\u043d\u044c\u0448\u0435 \u0444\u0440\u0443\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0442\u0430\u043a \u043a\u0430\u043a generics \u2014 \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 generics)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u043f\u0440\u043e\u0441\u0442\u044b\u0435 generics)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (default union)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u0412\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u0431\u044b\u0441\u0442\u0440\u044b\u0435 generics)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c runtime<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u0431\u0435\u0437 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0424\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f juniors<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435 (\u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0435 generics)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 4: Interface Inheritance<\/h4>\n<p>\u041c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 interface \u0441 type, \u0437\u0430\u0442\u0435\u043c extends \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c type \u0438 coords. Union \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b. \u0423\u043f\u043e\u0440 \u043d\u0430 \u041e\u041e\u041f-\u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 TypeScript, \u0433\u0434\u0435 \u044f\u0432\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0447\u0435\u0442\u043a\u043e\u0435 \u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u0447\u0435\u0440\u0435\u0437 discriminant.<\/p>\n<pre><code class=\"typescript\">\/\/ Base: \u043e\u0431\u0449\u0438\u0439 type interface BaseSegment {   type: SegmentType;  \/\/ Union discriminant } \/\/ Line: extends \u0441 override type \u0438 specific coords interface LineSegment extends BaseSegment {   type: 'line';  \/\/ \u041b\u0438\u0442\u0435\u0440\u0430\u043b \u0434\u043b\u044f \u0441\u0443\u0436\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430   coords: [x: number, y: number];  \/\/ \u0414\u0432\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b } \/\/ Quadratic: \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e interface QuadraticSegment extends BaseSegment {   type: 'quadratic';  \/\/ \u041b\u0438\u0442\u0435\u0440\u0430\u043b   coords: [controlX: number, controlY: number, x: number, y: number];  \/\/ \u0427\u0435\u0442\u044b\u0440\u0435 } type PathSegment4 = LineSegment | QuadraticSegment;  \/\/ \u042f\u0432\u043d\u044b\u0439 union <\/code><\/pre>\n<p>\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044f\u0432\u043d\u043e\u043c\u0443 \u0441\u0443\u0436\u0435\u043d\u0438\u044e \u0442\u0438\u043f\u0430. \u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u0430 \u0438\u0437-\u0437\u0430 \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e, \u043d\u043e \u0442\u0440\u0443\u0434\u043e\u0435\u043c\u043a\u043e. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0430, runtime \u0438\u0434\u0435\u0430\u043b\u0435\u043d.<\/p>\n<p>\u0414\u043b\u044f \u043c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442\u0430 \u044d\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0442\u0435\u0445\u0434\u043e\u043b\u0433, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0436\u0443\u043d\u044b \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u0431\u0430\u0437\u0430, \u0447\u0435\u043c generics, \u043d\u043e \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e, \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430\u043c \u043f\u0440\u0438 \u0441\u043b\u0438\u044f\u043d\u0438\u0438.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u044f\u0432\u043d\u043e\u0435 \u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u043d\u043e\u0432\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u0412\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c runtime<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044f)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0424\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f juniors<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0438\u0437\u043a\u043e (\u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0412\u0430\u0440\u0438\u0430\u043d\u0442<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041f\u0430\u0442\u0442\u0435\u0440\u043d<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0421\u0443\u043c\u043c\u0430\u0440\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Mapped Types with Indexed Access<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">12<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">Record Utility Type<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">10<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Generic Discriminated Union<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">12<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">Interface Inheritance<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">14<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437<\/h3>\n<p><strong>\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/strong>: \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b 4 (Interface Inheritance) \u0438 1 (Mapped Types with Indexed Access) \u043b\u0443\u0447\u0448\u0438\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u0442\u0440\u043e\u0433\u043e\u043c\u0443 \u0441\u0443\u0436\u0435\u043d\u0438\u044e \u0442\u0438\u043f\u0430. \u0412\u0430\u0440\u0438\u0430\u043d\u0442 4 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044f\u0432\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0430\u043c\u0438, \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f type \u0438 coords. \u0412\u0430\u0440\u0438\u0430\u043d\u0442 1 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 \u0442\u043e\u0433\u043e \u0436\u0435 \u0447\u0435\u0440\u0435\u0437 mapped types, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u044f type \u0441 SegmentCoords.<\/p>\n<p><strong>\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c<\/strong>: \u0412\u0430\u0440\u0438\u0430\u043d\u0442 4 (Interface Inheritance) \u043b\u0443\u0447\u0448\u0438\u0439 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u041e\u041e\u041f-\u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c\u0443 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u043c\u0443 \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u044b\u043c \u0434\u0430\u043b\u0435\u043a\u0438\u043c \u043b\u0435\u0439\u043c\u0430\u043c.<\/p>\n<p><strong>\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/strong>: \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b 1 (Mapped Types with Indexed Access), 2 (Record Utility Type) \u0438 3 (Generic Discriminated Union) \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432 segmentTypes \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u0435 (mapped types, Record, default union). \u0412\u0430\u0440\u0438\u0430\u043d\u0442 4 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u043a\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0443\u043a \u0438 \u0440\u0443\u0442\u0438\u043d\u044b.<\/p>\n<h3>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044e<\/h3>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441 junior-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 4 (Interface Inheritance) \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u2014 \u043e\u043d \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0444\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u0438 \u0442\u0435\u0445\u0434\u043e\u043b\u0433. \u0412 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445 \u0441 \u043e\u043f\u044b\u0442\u043d\u044b\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 1 (Mapped Types \u0441 Indexed Access) \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u0435\u043d \u0438\u0437-\u0437\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0434\u043b\u044f \u0444\u0435\u0442\u0438\u0448\u0438\u0441\u0442\u043e\u0432 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 3 (Generic Type with Default). \u0412\u0430\u0440\u0438\u0430\u043d\u0442 2 \u044d\u0442\u043e \u043f\u043e\u0434\u043b\u0438\u0432\u0430 \u0432 \u0431\u0435\u043b\u044b\u0435 \u0442\u0440\u0443\u0441\u044b, \u043a\u0430\u043a \u0438 \u043b\u044e\u0431\u044b\u0435 \u0444\u043e\u043a\u0443\u0441\u044b \u0441 Utility Types.<\/p>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442 1 (Mapped Types with Indexed Access), \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u0431\u043e\u0442. \u042f \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u0441\u043f\u0435\u0448\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043c\u0435\u043d\u044f \u043d\u0435 \u0432\u043e\u043b\u043d\u0443\u0435\u0442. \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u043e \u044f \u0432\u043a\u043b\u044e\u0447\u0443 \u0435\u043c\u0443 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e &#171;\u0414\u0430\u0432\u0430\u0439! \u0434\u0430\u0432\u0430\u0439 \u0434\u0430\u0432\u0430\u0439 \u0434\u0430\u0432\u0430\u0439 \u0434\u0430\u0432\u0430\u0439 \u0434\u0430\u0432\u0430\u0439\u2764\ufe0f \u0442\u044b \u0441\u043c\u043e\u0436\u0435\u0448\u044c\ud83e\udd17\u0432\u0435\u0440\u044c \u0432 \u0441\u0435\u0431\u044f\ud83d\ude4f\u0437\u0430\u0439\u043a\u0430\ud83e\udd7a\u0432\u0435\u0440\u044c\ud83d\udc98\u0434\u0430\u0432\u0430\u0439 \u0434\u0430\u0432\u0430\u0439!! \u043f\u043e\u0434\u043d\u0430\u0436\u043c\u0438)) \u261d\ud83c\udffc\u0435\u0449\u0435 \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c&#8230;\u043f\u0440\u043e\u0448\u0443 \u0442\u0435\u0431\u044f\ud83d\ude15\u043d\u0435 \u0437\u0434\u0430\u0432\u0430\u0439\u0441\u044f\ud83d\ude18\u043f\u043e\u0434\u043d\u0430\u0436\u043c\u0438\ud83d\ude09\u0442\u044b \u0432\u0441\u0435 \u0441\u043c\u043e\u0436\u0435\u0448\u044c!! \ud83d\ude2d&#187;.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/942458\/\"> https:\/\/habr.com\/ru\/articles\/942458\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 TypeScript \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u043e\u043b\u0433 \u2014 \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u0438\u0435 \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 (\u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0438\u0441\u043a\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443. \u041e\u0441\u043e\u0437\u043d\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430, \u0447\u0442\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044e \u043d\u043e\u0432\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043e\u0442\u043b\u0430\u0434\u043a\u0443. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"typescript\">\/\/ \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u0430\u043a \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 const segmentTypes = [   'line',   'quadratic', ] as const; type SegmentType = typeof segmentTypes[number]; \/\/ Union-\u0442\u0438\u043f: 'line' | 'quadratic'  \/\/ \u0423\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0439 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430 (discriminated \u043f\u043e T) type SegmentCoords&lt;T extends SegmentType&gt; =   T extends 'line' ? [x: number, y: number] :  \/\/ \u0414\u043b\u044f 'line' \u2014 \u0434\u0432\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b   T extends 'quadratic' ? [controlX: number, controlY: number, x: number, y: number] :  \/\/ \u0414\u043b\u044f 'quadratic' \u2014 \u0447\u0435\u0442\u044b\u0440\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b <\/code><\/pre>\n<p>\u042d\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0430\u0442 \u0431\u0430\u0437\u043e\u0439 \u0434\u043b\u044f \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 <code>PathSegment<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0440\u0430\u0437\u0431\u0435\u0440\u0443 \u043d\u0438\u0436\u0435.<\/p>\n<h3>\u041e\u0431\u0437\u043e\u0440 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432<\/h3>\n<h4>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 1: Mapped Types \u0441 Indexed Access<\/h4>\n<p>\u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 mapped types \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0433\u0434\u0435 \u043a\u043b\u044e\u0447\u0438 \u2014 \u0442\u0438\u043f\u044b \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u2014 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c type \u0438 coords. Indexed access \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 discriminated union. \u041f\u043e\u0434\u0445\u043e\u0434 \u043e\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u043f\u043f\u0438\u043d\u0433 TypeScript, \u0433\u0434\u0435 \u0442\u0438\u043f\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e union, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u0433\u0443\u044e \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 type \u0438 coords \u0431\u0435\u0437 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"typescript\">\/\/ Mapped type: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e T \u0432 SegmentType \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 { type: T; coords: SegmentCoords&lt;T&gt; } type PathSegment1 = {   [T in SegmentType]: {  \/\/ \u0418\u0442\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u043e union SegmentType     type: T;  \/\/ Discriminant: \u0441\u0442\u0440\u043e\u043a\u0430-\u043b\u0438\u0442\u0435\u0440\u0430\u043b \u0434\u043b\u044f \u0441\u0443\u0436\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430     coords: SegmentCoords&lt;T&gt;;  O\/\/ \u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u043e\u0442 T   }; }[SegmentType];  \/\/ Indexed access: union \u0432\u0441\u0435\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 mapped type <\/code><\/pre>\n<p>\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u043b\u043d\u043e\u0435 \u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430: TypeScript \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 coords \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 type, \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0434\u043b\u044f &#8216;line&#8217;. \u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442 \u0438\u0437-\u0437\u0430 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 mapped types, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 TypeScript, \u043d\u043e \u044d\u0442\u043e \u043e\u043a\u0443\u043f\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u0433\u0434\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0438\u043f\u043e\u0432 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 union. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0442\u0438\u043f\u043e\u0432 \u0438\u0437-\u0437\u0430 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430, \u043d\u043e runtime \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442\u0430, \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0442\u0435\u0445\u0434\u043e\u043b\u0433 \u0432 \u0434\u043e\u043b\u0433\u043e\u0441\u0440\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0442\u0438\u043f\u0430\u0445, \u043d\u043e \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445 \u0441 \u0434\u0436\u0443\u043d\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u044e\u044e \u0432\u043e\u0437\u043d\u044e, \u043f\u0440\u0438\u0432\u043e\u0434\u044f \u043a \u0444\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e any \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u043f\u043e\u043b\u043d\u043e\u0435 \u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435 (\u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u0430\u0432\u0442\u043e-\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f union)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u0412\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435 (\u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0435\u0442)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c runtime<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u043d\u0435\u0442 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0424\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f juniors<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435 (\u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445 \u0437\u043d\u0430\u043d\u0438\u0439)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 2: Record Utility Type<\/h4>\n<p>\u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 Record \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430-\u0442\u0438\u043f\u0430 \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0438\u0437 SegmentType \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u0449\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u043d\u043e \u0441 coords, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u043c\u0438 \u043e\u0442 SegmentType (union). Union \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 keyof. \u042d\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 mapped types \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u043d\u043e Record \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044e, \u043d\u043e \u0436\u0435\u0440\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u043e\u0441\u0442\u044c\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0431\u0435\u0437 \u0441\u0442\u0440\u043e\u0433\u043e\u0433\u043e \u0441\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"typescript\">\/\/ Record: \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 SegmentType \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 {type: SegmentType; coords: SegmentCoords&lt;SegmentType&gt;} type PathSegmentRecord = Record&lt;SegmentType, {  \/\/ \u041a\u043b\u044e\u0447\u0438 \u2014 'line' | 'quadratic'   type: SegmentType;  \/\/ Union \u0434\u043b\u044f type, \u0431\u0435\u0437 \u0441\u0442\u0440\u043e\u0433\u043e\u0433\u043e \u0441\u0443\u0436\u0435\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 Record   coords: SegmentCoords&lt;SegmentType&gt;;  \/\/ Union coords, \u043c\u0435\u043d\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u0438\u0439 }&gt;; type PathSegment2 = PathSegmentRecord[keyof PathSegmentRecord];  \/\/ Union \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 Record <\/code><\/pre>\n<p>\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043d\u0438\u0436\u0435, \u0447\u0435\u043c \u0432 mapped types, \u0438\u0437-\u0437\u0430 union \u0432 coords \u0432\u043d\u0443\u0442\u0440\u0438 Record, \u0447\u0442\u043e \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u043e\u0441\u0442\u044c \u0441\u0443\u0436\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b Record, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u0432\u0443\u0445 \u0448\u0430\u0433\u043e\u0432 (Record + keyof), \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0432\u043e\u0441\u043f\u0440\u0438\u044f\u0442\u0438\u0435. \u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 segmentTypes \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f, \u043d\u043e \u0440\u043e\u0441\u0442 union \u0432 coords \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0438\u0441\u043a\u0438. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0434\u043b\u044f \u043c\u0430\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0442\u0438\u043f\u043e\u0432, runtime \u0431\u0435\u0437 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432.<\/p>\n<p>\u0414\u043b\u044f \u043c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442\u0430 \u044d\u0442\u043e \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0442\u0435\u0445\u0434\u043e\u043b\u0433 \u0432 \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0433\u0440\u0435\u0439\u0434\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445, \u043d\u043e \u043f\u0440\u0438 \u0447\u0430\u0441\u0442\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0442\u0438\u043f\u043e\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0435\u0441\u0442\u044c \u0436\u0435\u0440\u0442\u0432\u0430 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0440\u0438\u0432\u043e\u0434\u044f \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c, \u0442\u0430\u043a\u0438\u043c \u043a\u0430\u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0438\u043f\u043e\u0432. \u0414\u0436\u0443\u043d\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f \u0441 keyof, \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044f \u0435\u0433\u043e \u043a\u0430\u043a &#171;\u043c\u0430\u0433\u0438\u044e&#187;, \u0447\u0442\u043e \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0444\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044e.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 union)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435 (\u0434\u0432\u0430 \u0448\u0430\u0433\u0430 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 segmentTypes)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u0412\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c runtime<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u0447\u0438\u0441\u0442\u0430\u044f \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044f)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0424\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f juniors<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (keyof \u0441\u043b\u043e\u0436\u0435\u043d \u0434\u043b\u044f \u0434\u0436\u0443\u043d\u043e\u0432)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 3: Generic Type with Default<\/h4>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 generics \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0433\u0434\u0435 PathSegment \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f. Default T=SegmentType \u0441\u043e\u0437\u0434\u0430\u0435\u0442 union. \u0410\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 generics, \u0433\u0434\u0435 \u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0447\u0435\u0440\u0435\u0437 conditional types \u0432 SegmentCoords, \u0431\u0435\u0437 \u044f\u0432\u043d\u043e\u0433\u043e union.<\/p>\n<pre><code class=\"typescript\">\/\/ Generic: T constrained SegmentType, default \u2014 union type PathSegment5&lt;T extends SegmentType = SegmentType&gt; = {  \/\/ Parameterized, default union   type: T;  \/\/ Discriminant \u0441 generic T   coords: SegmentCoords&lt;T&gt;;  \/\/ \u0417\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 coords }; <\/code><\/pre>\n<p>\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u0430 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f generics, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u043c \u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u044f\u0432\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f T. \u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0430 \u0438\u0437-\u0437\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b generics, \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 \u043c\u043d\u043e\u0433\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0432 segmentTypes \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 default union, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0431\u044b\u0441\u0442\u0440\u0430\u044f, runtime \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u044c.<\/p>\n<p>\u041c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442\u0443 \u044d\u0442\u043e \u0432\u044b\u0433\u043e\u0434\u043d\u043e \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0441\u043d\u0438\u0436\u0430\u044f \u0442\u0435\u0445\u0434\u043e\u043b\u0433. \u0414\u0436\u0443\u043d\u044b \u043c\u0435\u043d\u044c\u0448\u0435 \u0444\u0440\u0443\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0442\u0430\u043a \u043a\u0430\u043a generics \u2014 \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 generics)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u043f\u0440\u043e\u0441\u0442\u044b\u0435 generics)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (default union)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u0412\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u0431\u044b\u0441\u0442\u0440\u044b\u0435 generics)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c runtime<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u0431\u0435\u0437 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0424\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f juniors<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435 (\u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0435 generics)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 4: Interface Inheritance<\/h4>\n<p>\u041c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 interface \u0441 type, \u0437\u0430\u0442\u0435\u043c extends \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c type \u0438 coords. Union \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b. \u0423\u043f\u043e\u0440 \u043d\u0430 \u041e\u041e\u041f-\u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 TypeScript, \u0433\u0434\u0435 \u044f\u0432\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0447\u0435\u0442\u043a\u043e\u0435 \u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 \u0447\u0435\u0440\u0435\u0437 discriminant.<\/p>\n<pre><code class=\"typescript\">\/\/ Base: \u043e\u0431\u0449\u0438\u0439 type interface BaseSegment {   type: SegmentType;  \/\/ Union discriminant } \/\/ Line: extends \u0441 override type \u0438 specific coords interface LineSegment extends BaseSegment {   type: 'line';  \/\/ \u041b\u0438\u0442\u0435\u0440\u0430\u043b \u0434\u043b\u044f \u0441\u0443\u0436\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430   coords: [x: number, y: number];  \/\/ \u0414\u0432\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b } \/\/ Quadratic: \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e interface QuadraticSegment extends BaseSegment {   type: 'quadratic';  \/\/ \u041b\u0438\u0442\u0435\u0440\u0430\u043b   coords: [controlX: number, controlY: number, x: number, y: number];  \/\/ \u0427\u0435\u0442\u044b\u0440\u0435 } type PathSegment4 = LineSegment | QuadraticSegment;  \/\/ \u042f\u0432\u043d\u044b\u0439 union <\/code><\/pre>\n<p>\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044f\u0432\u043d\u043e\u043c\u0443 \u0441\u0443\u0436\u0435\u043d\u0438\u044e \u0442\u0438\u043f\u0430. \u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u0430 \u0438\u0437-\u0437\u0430 \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e, \u043d\u043e \u0442\u0440\u0443\u0434\u043e\u0435\u043c\u043a\u043e. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0430, runtime \u0438\u0434\u0435\u0430\u043b\u0435\u043d.<\/p>\n<p>\u0414\u043b\u044f \u043c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442\u0430 \u044d\u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0442\u0435\u0445\u0434\u043e\u043b\u0433, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0436\u0443\u043d\u044b \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c\u0438 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u0431\u043e\u043b\u0435\u0435 \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u0431\u0430\u0437\u0430, \u0447\u0435\u043c generics, \u043d\u043e \u043f\u0440\u0438 \u0440\u043e\u0441\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e, \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430\u043c \u043f\u0440\u0438 \u0441\u043b\u0438\u044f\u043d\u0438\u0438.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u044f\u0432\u043d\u043e\u0435 \u0441\u0443\u0436\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u043d\u043e\u0432\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u0412\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u0446\u0435\u043d\u043a\u0430 (\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e (\u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c runtime<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e (\u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044f)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0424\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f juniors<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0438\u0437\u043a\u043e (\u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0412\u0430\u0440\u0438\u0430\u043d\u0442<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041f\u0430\u0442\u0442\u0435\u0440\u043d<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0421\u0443\u043c\u043c\u0430\u0440\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">Mapped Types with Indexed Access<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">12<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">2<\/p>\n<\/td>\n<td>\n<p align=\"left\">Record Utility Type<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0441\u0440\u0435\u0434\u043d\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">10<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">3<\/p>\n<\/td>\n<td>\n<p align=\"left\">Generic Discriminated Union<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">12<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">4<\/p>\n<\/td>\n<td>\n<p align=\"left\">Interface Inheritance<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0432\u044b\u0441\u043e\u043a\u043e<\/p>\n<\/td>\n<td>\n<p align=\"left\">14<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437<\/h3>\n<p><strong>\u0422\u0438\u043f\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/strong>: \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b 4 (Interface Inheritance) \u0438 1 (Mapped Types with Indexed Access) \u043b\u0443\u0447\u0448\u0438\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u0442\u0440\u043e\u0433\u043e\u043c\u0443 \u0441\u0443\u0436\u0435\u043d\u0438\u044e \u0442\u0438\u043f\u0430. \u0412\u0430\u0440\u0438\u0430\u043d\u0442 4 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044f\u0432\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u0430\u043c\u0438, \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f type \u0438 coords. \u0412\u0430\u0440\u0438\u0430\u043d\u0442 1 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 \u0442\u043e\u0433\u043e \u0436\u0435 \u0447\u0435\u0440\u0435\u0437 mapped types, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u044f type \u0441 SegmentCoords.<\/p>\n<p><strong>\u0427\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c<\/strong>: \u0412\u0430\u0440\u0438\u0430\u043d\u0442 4 (Interface Inheritance) \u043b\u0443\u0447\u0448\u0438\u0439 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u041e\u041e\u041f-\u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c\u0443 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0443 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u043c\u0443 \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u044b\u043c \u0434\u0430\u043b\u0435\u043a\u0438\u043c \u043b\u0435\u0439\u043c\u0430\u043c.<\/p>\n<p><strong>\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/strong>: \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b 1 (Mapped Types with Indexed Access), 2 (Record Utility Type) \u0438 3 (Generic Discriminated Union) \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432 segmentTypes \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u0435 (mapped types, Record, default union). \u0412\u0430\u0440\u0438\u0430\u043d\u0442 4 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u043a\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u0440\u0443\u043a \u0438 \u0440\u0443\u0442\u0438\u043d\u044b.<\/p>\n<h3>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044e<\/h3>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441 junior-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 4 (Interface Inheritance) \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u2014 \u043e\u043d \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0444\u0440\u0443\u0441\u0442\u0440\u0430\u0446\u0438\u044e \u0438 \u0442\u0435\u0445\u0434\u043e\u043b\u0433. \u0412 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445 \u0441 \u043e\u043f\u044b\u0442\u043d\u044b\u043c\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 1 (Mapped Types \u0441 Indexed Access) \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u0435\u043d \u0438\u0437-\u0437\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0434\u043b\u044f \u0444\u0435\u0442\u0438\u0448\u0438\u0441\u0442\u043e\u0432 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 3 (Generic Type with Default). \u0412\u0430\u0440\u0438\u0430\u043d\u0442 2 \u044d\u0442\u043e \u043f\u043e\u0434\u043b\u0438\u0432\u0430 \u0432 \u0431\u0435\u043b\u044b\u0435 \u0442\u0440\u0443\u0441\u044b, \u043a\u0430\u043a \u0438 \u043b\u044e\u0431\u044b\u0435 \u0444\u043e\u043a\u0443\u0441\u044b \u0441 Utility Types.<\/p>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442 1 (Mapped Types with Indexed Access), \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u0431\u043e\u0442. \u042f \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u0441\u043f\u0435\u0448\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-472728","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/472728","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=472728"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/472728\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=472728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=472728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=472728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}