{"id":344212,"date":"2023-01-19T21:01:39","date_gmt":"2023-01-19T21:01:39","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=344212"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=344212","title":{"rendered":"<span>\u0418\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u043e \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438: TypeScript Utility Types<\/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<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0427\u0442\u043e \u0432\u044b \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442\u0435 \u043e\u0442 \u043f\u043e\u0437\u043d\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e? \u0417\u0430 \u0441\u0435\u0431\u044f \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0432 \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0441\u0432\u0435\u0442\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u043d\u044f \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0435\u043f\u043e\u0434\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0434\u0435\u0442\u0441\u043a\u0430\u044f \u0440\u0430\u0434\u043e\u0441\u0442\u044c \u043e\u0442 \u0441\u0432\u0435\u0440\u0448\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f. \u0416\u0430\u043b\u044c, \u0447\u0442\u043e \u044d\u0442\u0438\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u043c\u0435\u043d\u044c\u0448\u0435. \u041a \u0447\u0435\u043c\u0443 \u044f \u044d\u0442\u043e? \u041a\u043e\u0433\u0434\u0430 \u043c\u043d\u0435 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u0430 \u043c\u044b\u0441\u043b\u044c \u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443, \u044f \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b \u0442\u043e \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0437\u0440\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u044b\u0442\u0430\u043b \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f Utility Types. \u0412\u0441\u0451 \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0442\u0430\u043b\u043e \u043d\u0430 \u0441\u0432\u043e\u0438 \u043c\u0435\u0441\u0442\u0430, \u0438 \u044f \u043f\u043e\u043d\u044f\u043b \u043a\u0430\u043a\u043e\u0433\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u0430 \u043f\u0430\u0437\u043b\u0430 \u043c\u043d\u0435 \u0432\u0441\u0451 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e. \u0418\u043c\u0435\u043d\u043d\u043e \u043e \u043d\u0451\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>TypeScript Utility Types &#8212; \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u0434\u0435. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<h2>Awaited<\/h2>\n<p><code>Awaited&lt;T><\/code> &#8212; \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d \u0438\u0437 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.  <\/p>\n<pre><code class=\"typescript\">async function getData(): Promise&lt;string> {     return 'hello'; }  let awaitedData: Awaited&lt;ReturnType&lt;typeof getData>>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c awaitedData \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c 'hello'<\/code><\/pre>\n<h2>Partial<\/h2>\n<p><code>Partial&lt;T><\/code> &#8212; \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 T \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438.  <\/p>\n<pre><code class=\"typescript\">interface Person {   name: string;   age: number; }  let partialPerson: Partial&lt;Person>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c partialPerson \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c { name?: string; age?: number; }<\/code><\/pre>\n<h2>Required<\/h2>\n<p><code>Required&lt;T><\/code> &#8212; \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 T \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438.<\/p>\n<pre><code class=\"typescript\">interface Person {   name?: string;   age?: number; }  let requiredPerson: Required&lt;Person>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c requiredPerson \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c { name: string; age: number; }<\/code><\/pre>\n<h2>Readonly<\/h2>\n<p><code>Readonly&lt;T><\/code> &#8212; \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 T \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"typescript\">interface Point {   x: number;   y: number; }  let readonlyPoint: Readonly&lt;Point>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c readonlyPoint \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c { readonly x: number; readonly y: number; }<\/code><\/pre>\n<h2>Record<\/h2>\n<p><code>Record&lt;Keys, Type><\/code> &#8212; \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c\u044e \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435, \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0442\u0438\u043f\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435.<\/p>\n<pre><code class=\"typescript\">type Keys = 'a' | 'b' | 'c'; type RecordType = Record&lt;Keys, number>;  let record: RecordType; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c record \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c { a: number, b: number, c: number }<\/code><\/pre>\n<h2>Pick<\/h2>\n<p><code>Pick&lt;T, K extends keyof T><\/code> &#8212; \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 T \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 K.  <\/p>\n<pre><code class=\"typescript\">interface Person {   name: string;   age: number; }  let pickedPerson: Pick&lt;Person, 'name'>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c pickedPerson \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c { name: string; }<\/code><\/pre>\n<h2>Omit<\/h2>\n<p><code>Omit&lt;T, K extends keyof T><\/code> &#8212; \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 T, \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044f \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432 K<\/p>\n<pre><code class=\"typescript\">interface Person {   name: string;   age: number; }  let omittedPerson: Omit&lt;Person, 'age'>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c omittedPerson \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c { name: string; }<\/code><\/pre>\n<h2>Exclude<\/h2>\n<p><code>Exclude&lt;UnionType, ExcludedMembers><\/code> &#8212; \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0438\u0437 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<pre><code class=\"typescript\">type A = 'a' | 'b' | 'c'; type B = Exclude&lt;A, 'a' | 'b'>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c B \u044d\u0442\u043e 'c'<\/code><\/pre>\n<h2>Extract<\/h2>\n<p><code>Extract&lt;Type, Union><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0438\u0437 \u0442\u0438\u043f\u0430 Type \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0442\u0438\u043f\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 Union.<\/p>\n<pre><code class=\"typescript\">type A = 'a' | 'b' | 'c'; type B = 'a' | 'b'; type C = Extract&lt;A, B>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c C \u044d\u0442\u043e 'a' | 'b'<\/code><\/pre>\n<h2>NonNullable<\/h2>\n<p><code>NonNullable&lt;Type><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u0438\u043f \u0438\u0437 Type, \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044f null \u0438 undefined.<\/p>\n<pre><code class=\"typescript\">let value: string | null | undefined; let nonNullableValue: NonNullable&lt;typeof value>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c nonNullableValue \u044d\u0442\u043e string<\/code><\/pre>\n<h2>Parameters<\/h2>\n<p><code>Parameters&lt;Type><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u0438\u043f\u044b \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Type.<\/p>\n<pre><code class=\"typescript\">function foo(a: string, b: number) {} type FooParameters = Parameters&lt;typeof foo>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c FooParameters \u044d\u0442\u043e [string, number]<\/code><\/pre>\n<h2>ConstructorParameters<\/h2>\n<p><code>ConstructorParameters&lt;Type><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u0438\u043f\u044b \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 Type.<\/p>\n<pre><code class=\"typescript\">class Foo {     constructor(a: string, b: number) {} } type FooConstructorParameters = ConstructorParameters&lt;typeof Foo>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c FooConstructorParameters \u044d\u0442\u043e [string, number]<\/code><\/pre>\n<h2>ReturnType<\/h2>\n<p><code>ReturnType&lt;Type><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u0438\u043f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Type.<\/p>\n<pre><code class=\"typescript\">function foo(): string { return 'hello'; } type FooReturnType = ReturnType&lt;typeof foo>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c FooReturnType \u044d\u0442\u043e string<\/code><\/pre>\n<h2>InstanceType<\/h2>\n<p><code>InstanceType&lt;Type><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u0438\u043f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 Type.<\/p>\n<pre><code class=\"typescript\">class Foo { x: number } type FooInstance = InstanceType&lt;typeof Foo>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c FooInstance \u044d\u0442\u043e { x: number }<\/code><\/pre>\n<h2>ThisParameterType<\/h2>\n<p><code>ThisParameterType&lt;Type><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u0438\u043f <code>this<\/code> \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Type.<\/p>\n<pre><code class=\"typescript\">class Foo {     x: number;     method(this: this): void { } } type ThisType = ThisParameterType&lt;Foo[\"method\"]>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c ThisType \u044d\u0442\u043e Foo<\/code><\/pre>\n<h2>OmitThisParameter<\/h2>\n<p><code>OmitThisParameter&lt;Type><\/code> &#8212; \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0431\u0435\u0437 \u0442\u0438\u043f\u0430 <code>this<\/code>.<\/p>\n<pre><code class=\"typescript\">class Foo {     x: number;     method(this: this): void { } } type MethodType = OmitThisParameter&lt;Foo[\"method\"]>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c MethodType \u044d\u0442\u043e () => void<\/code><\/pre>\n<h2>ThisType<\/h2>\n<p><code>ThisType&lt;Type><\/code> &#8212; \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0438\u043f <code>this<\/code> \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Type.<\/p>\n<pre><code class=\"typescript\">class Foo {     x: number;     method(): void { } } type MethodType = ThisType&lt;Foo[\"method\"]>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c MethodType \u044d\u0442\u043e (this: Foo) => void<\/code><\/pre>\n<h2>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u043c<\/h2>\n<p><code>Uppercase&lt;StringType><\/code>, <code>Lowercase&lt;StringType><\/code>, <code>Capitalize&lt;StringType><\/code>, <code>Uncapitalize&lt;StringType><\/code> &#8212; \u044d\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u043b\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0438\u0445 \u0438\u043c\u0435\u043d\u0435\u043c.  <\/p>\n<pre><code class=\"typescript\">type Uppercased = Uppercase&lt;'hello'>; \/\/ 'HELLO' type Lowercased = Lowercase&lt;'Hello'>; \/\/ 'hello' type Capitalized = Capitalize&lt;'hello'>; \/\/ 'Hello' type Uncapitalized = Uncapitalize&lt;'Hello'>; \/\/ 'hello'<\/code><\/pre>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041a\u0442\u043e-\u0442\u043e \u0441\u043a\u0430\u0436\u0435\u0442: &#171;\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435&#187; &#8212; \u0438 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0430\u0432, \u0447\u0435\u043c \u043d\u0435 \u043f\u0440\u0430\u0432. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0448\u043b\u0451\u043f\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u044b \u0438\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c CRUD&#8217;\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0443\u0433\u043b\u0443\u0431\u043b\u0451\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0442\u0438\u043f\u043e\u0432, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043a\u043e\u043c\u043f\u0435\u0442\u0435\u043d\u0446\u0438\u0439 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430\u0445.<\/p>\n<p>\u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0441\u0435\u0439 \u043c\u043e\u0435\u0439 \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043b\u0435\u0436\u0438\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0432 \u043c\u0438\u0440 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043e\u0442\u0432\u0435\u0442\u044b. \u041e\u0442\u0442\u0443\u0434\u0430 \u044f \u0438 \u0432\u0435\u0449\u0430\u044e \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c \u043a\u0430\u043d\u0430\u043b\u0435.<\/p>\n<p>\u0412\u0430\u0448 <a href=\"https:\/\/t.me\/+fMbzj2rrEtA4NGYy\" rel=\"noopener noreferrer nofollow\">\u0425\u0440\u0435\u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442<\/a><\/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\/post\/711686\/\"> https:\/\/habr.com\/ru\/post\/711686\/<\/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<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0427\u0442\u043e \u0432\u044b \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442\u0435 \u043e\u0442 \u043f\u043e\u0437\u043d\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e? \u0417\u0430 \u0441\u0435\u0431\u044f \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0432 \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u043e\u0441\u0432\u0435\u0442\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u043d\u044f \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0435\u043f\u043e\u0434\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0434\u0435\u0442\u0441\u043a\u0430\u044f \u0440\u0430\u0434\u043e\u0441\u0442\u044c \u043e\u0442 \u0441\u0432\u0435\u0440\u0448\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f. \u0416\u0430\u043b\u044c, \u0447\u0442\u043e \u044d\u0442\u0438\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u043c\u0435\u043d\u044c\u0448\u0435. \u041a \u0447\u0435\u043c\u0443 \u044f \u044d\u0442\u043e? \u041a\u043e\u0433\u0434\u0430 \u043c\u043d\u0435 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u0430 \u043c\u044b\u0441\u043b\u044c \u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443, \u044f \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b \u0442\u043e \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0437\u0440\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u044b\u0442\u0430\u043b \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f Utility Types. \u0412\u0441\u0451 \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0442\u0430\u043b\u043e \u043d\u0430 \u0441\u0432\u043e\u0438 \u043c\u0435\u0441\u0442\u0430, \u0438 \u044f \u043f\u043e\u043d\u044f\u043b \u043a\u0430\u043a\u043e\u0433\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u0430 \u043f\u0430\u0437\u043b\u0430 \u043c\u043d\u0435 \u0432\u0441\u0451 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e. \u0418\u043c\u0435\u043d\u043d\u043e \u043e \u043d\u0451\u043c \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>TypeScript Utility Types &#8212; \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u0434\u0435. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<h2>Awaited<\/h2>\n<p><code>Awaited&lt;T><\/code> &#8212; \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d \u0438\u0437 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.  <\/p>\n<pre><code class=\"typescript\">async function getData(): Promise&lt;string> {     return 'hello'; }  let awaitedData: Awaited&lt;ReturnType&lt;typeof getData>>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c awaitedData \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c 'hello'<\/code><\/pre>\n<h2>Partial<\/h2>\n<p><code>Partial&lt;T><\/code> &#8212; \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 T \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438.  <\/p>\n<pre><code class=\"typescript\">interface Person {   name: string;   age: number; }  let partialPerson: Partial&lt;Person>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c partialPerson \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c { name?: string; age?: number; }<\/code><\/pre>\n<h2>Required<\/h2>\n<p><code>Required&lt;T><\/code> &#8212; \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 T \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438.<\/p>\n<pre><code class=\"typescript\">interface Person {   name?: string;   age?: number; }  let requiredPerson: Required&lt;Person>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c requiredPerson \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c { name: string; age: number; }<\/code><\/pre>\n<h2>Readonly<\/h2>\n<p><code>Readonly&lt;T><\/code> &#8212; \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 T \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"typescript\">interface Point {   x: number;   y: number; }  let readonlyPoint: Readonly&lt;Point>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c readonlyPoint \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c { readonly x: number; readonly y: number; }<\/code><\/pre>\n<h2>Record<\/h2>\n<p><code>Record&lt;Keys, Type><\/code> &#8212; \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c\u044e \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435, \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0442\u0438\u043f\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435.<\/p>\n<pre><code class=\"typescript\">type Keys = 'a' | 'b' | 'c'; type RecordType = Record&lt;Keys, number>;  let record: RecordType; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c record \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c { a: number, b: number, c: number }<\/code><\/pre>\n<h2>Pick<\/h2>\n<p><code>Pick&lt;T, K extends keyof T><\/code> &#8212; \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 T \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 K.  <\/p>\n<pre><code class=\"typescript\">interface Person {   name: string;   age: number; }  let pickedPerson: Pick&lt;Person, 'name'>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c pickedPerson \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c { name: string; }<\/code><\/pre>\n<h2>Omit<\/h2>\n<p><code>Omit&lt;T, K extends keyof T><\/code> &#8212; \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 T, \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044f \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432 K<\/p>\n<pre><code class=\"typescript\">interface Person {   name: string;   age: number; }  let omittedPerson: Omit&lt;Person, 'age'>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c omittedPerson \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c { name: string; }<\/code><\/pre>\n<h2>Exclude<\/h2>\n<p><code>Exclude&lt;UnionType, ExcludedMembers><\/code> &#8212; \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0438\u0437 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<pre><code class=\"typescript\">type A = 'a' | 'b' | 'c'; type B = Exclude&lt;A, 'a' | 'b'>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c B \u044d\u0442\u043e 'c'<\/code><\/pre>\n<h2>Extract<\/h2>\n<p><code>Extract&lt;Type, Union><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0438\u0437 \u0442\u0438\u043f\u0430 Type \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0442\u0438\u043f\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 Union.<\/p>\n<pre><code class=\"typescript\">type A = 'a' | 'b' | 'c'; type B = 'a' | 'b'; type C = Extract&lt;A, B>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c C \u044d\u0442\u043e 'a' | 'b'<\/code><\/pre>\n<h2>NonNullable<\/h2>\n<p><code>NonNullable&lt;Type><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u0438\u043f \u0438\u0437 Type, \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044f null \u0438 undefined.<\/p>\n<pre><code class=\"typescript\">let value: string | null | undefined; let nonNullableValue: NonNullable&lt;typeof value>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c nonNullableValue \u044d\u0442\u043e string<\/code><\/pre>\n<h2>Parameters<\/h2>\n<p><code>Parameters&lt;Type><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u0438\u043f\u044b \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Type.<\/p>\n<pre><code class=\"typescript\">function foo(a: string, b: number) {} type FooParameters = Parameters&lt;typeof foo>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c FooParameters \u044d\u0442\u043e [string, number]<\/code><\/pre>\n<h2>ConstructorParameters<\/h2>\n<p><code>ConstructorParameters&lt;Type><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u0438\u043f\u044b \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 Type.<\/p>\n<pre><code class=\"typescript\">class Foo {     constructor(a: string, b: number) {} } type FooConstructorParameters = ConstructorParameters&lt;typeof Foo>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c FooConstructorParameters \u044d\u0442\u043e [string, number]<\/code><\/pre>\n<h2>ReturnType<\/h2>\n<p><code>ReturnType&lt;Type><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u0438\u043f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Type.<\/p>\n<pre><code class=\"typescript\">function foo(): string { return 'hello'; } type FooReturnType = ReturnType&lt;typeof foo>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c FooReturnType \u044d\u0442\u043e string<\/code><\/pre>\n<h2>InstanceType<\/h2>\n<p><code>InstanceType&lt;Type><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u0438\u043f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 Type.<\/p>\n<pre><code class=\"typescript\">class Foo { x: number } type FooInstance = InstanceType&lt;typeof Foo>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c FooInstance \u044d\u0442\u043e { x: number }<\/code><\/pre>\n<h2>ThisParameterType<\/h2>\n<p><code>ThisParameterType&lt;Type><\/code> &#8212; \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0442\u0438\u043f <code>this<\/code> \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Type.<\/p>\n<pre><code class=\"typescript\">class Foo {     x: number;     method(this: this): void { } } type ThisType = ThisParameterType&lt;Foo[\"method\"]>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c ThisType \u044d\u0442\u043e Foo<\/code><\/pre>\n<h2>OmitThisParameter<\/h2>\n<p><code>OmitThisParameter&lt;Type><\/code> &#8212; \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0431\u0435\u0437 \u0442\u0438\u043f\u0430 <code>this<\/code>.<\/p>\n<pre><code class=\"typescript\">class Foo {     x: number;     method(this: this): void { } } type MethodType = OmitThisParameter&lt;Foo[\"method\"]>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c MethodType \u044d\u0442\u043e () => void<\/code><\/pre>\n<h2>ThisType<\/h2>\n<p><code>ThisType&lt;Type><\/code> &#8212; \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0438\u043f <code>this<\/code> \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Type.<\/p>\n<pre><code class=\"typescript\">class Foo {     x: number;     method(): void { } } type MethodType = ThisType&lt;Foo[\"method\"]>; \/\/ \u0442\u0435\u043f\u0435\u0440\u044c MethodType \u044d\u0442\u043e (this: Foo) => void<\/code><\/pre>\n<h2>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u043c<\/h2>\n<p><code>Uppercase&lt;StringType><\/code>, <code>Lowercase&lt;StringType><\/code>, <code>Capitalize&lt;StringType><\/code>, <code>Uncapitalize&lt;StringType><\/code> &#8212; \u044d\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u043b\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0438\u0445 \u0438\u043c\u0435\u043d\u0435\u043c.  <\/p>\n<pre><code class=\"typescript\">type Uppercased = Uppercase&lt;'hello'>; \/\/ 'HELLO' type Lowercased = Lowercase&lt;'Hello'>; \/\/ 'hello' type Capitalized = Capitalize&lt;'hello'>; \/\/ 'Hello' type Uncapitalized = Uncapitalize&lt;'Hello'>; \/\/ 'hello'<\/code><\/pre>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041a\u0442\u043e-\u0442\u043e \u0441\u043a\u0430\u0436\u0435\u0442: &#171;\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435&#187; &#8212; \u0438 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0430\u0432, \u0447\u0435\u043c \u043d\u0435 \u043f\u0440\u0430\u0432. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0448\u043b\u0451\u043f\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u044b \u0438\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c CRUD&#8217;\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0443\u0433\u043b\u0443\u0431\u043b\u0451\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0442\u0438\u043f\u043e\u0432, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043a\u043e\u043c\u043f\u0435\u0442\u0435\u043d\u0446\u0438\u0439 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430\u0445.<\/p>\n<p>\u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0441\u0435\u0439 \u043c\u043e\u0435\u0439 \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043b\u0435\u0436\u0438\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0432 \u043c\u0438\u0440 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043e\u0442\u0432\u0435\u0442\u044b. \u041e\u0442\u0442\u0443\u0434\u0430 \u044f \u0438 \u0432\u0435\u0449\u0430\u044e \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c \u043a\u0430\u043d\u0430\u043b\u0435.<\/p>\n<p>\u0412\u0430\u0448 <a href=\"https:\/\/t.me\/+fMbzj2rrEtA4NGYy\" rel=\"noopener noreferrer nofollow\">\u0425\u0440\u0435\u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442<\/a><\/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\/post\/711686\/\"> https:\/\/habr.com\/ru\/post\/711686\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-344212","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/344212","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=344212"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/344212\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=344212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=344212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=344212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}