{"id":24820,"date":"2022-06-11T17:00:40","date_gmt":"2022-06-11T12:30:40","guid":{"rendered":"https:\/\/parspack.com\/blog\/?p=24820"},"modified":"2024-08-23T17:59:15","modified_gmt":"2024-08-23T13:29:15","slug":"how-use-interfaces-in-typescript","status":"publish","type":"post","link":"https:\/\/parspack.com\/blog\/cms\/how-use-interfaces-in-typescript","title":{"rendered":"\u0622\u0645\u0648\u0632\u0634 \u0633\u0627\u062e\u062a \u0648 \u0628\u0647\u200c\u06a9\u0627\u0631\u06af\u06cc\u0631\u06cc \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062f\u0631 Typescript"},"content":{"rendered":"<p style=\"text-align: justify;\">\u062a\u0627\u06cc\u067e\u200c\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a (TypeScript) \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u0641\u0632\u0648\u0646\u0647\u200c\u0647\u0627\u06cc \u062c\u0627\u0648\u0627\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0627\u0633\u062a \u06a9\u0647 \u0627\u0632 \u0645\u062d\u06cc\u0637 \u0627\u062c\u0631\u0627\u06cc \u062c\u0627\u0648\u0627\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0628\u0647\u200c\u0647\u0645\u0631\u0627\u0647 Type Checker \u0632\u0645\u0627\u0646 \u06a9\u0627\u0645\u067e\u0627\u06cc\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f. TypeScript \u0631\u0648\u0634\u200c\u0647\u0627\u06cc \u0645\u062a\u0639\u062f\u062f\u06cc \u0628\u0631\u0627\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u0634\u06cc\u0627\u0621 \u0631\u0627 \u062f\u0631\u0627\u062e\u062a\u06cc\u0627\u0631\u062a\u0627\u0646 \u0642\u0631\u0627\u0631 \u0645\u06cc\u200c\u062f\u0647\u062f \u06a9\u0647 \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u06cc\u0646 \u0631\u0648\u0634\u200c\u0647\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 (Interface) \u0627\u0633\u062a.<\/p>\n<p style=\"text-align: justify;\">\u062f\u0631 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647\u060c \u062f\u0631 \u067e\u0644\u0627\u06af\u06cc\u0646 TypeScript \u06cc\u06a9 Interface \u0627\u06cc\u062c\u0627\u062f \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f \u0648 \u06cc\u0627\u062f \u0645\u06cc\u200c\u06af\u06cc\u0631\u06cc\u0645 \u06a9\u0647 \u0686\u06af\u0648\u0646\u0647 \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u0645 \u0648 \u0628\u0647\u200c\u0633\u0627\u062f\u06af\u06cc \u062a\u0641\u0627\u0648\u062a \u0628\u06cc\u0646 Interface \u0648 Type \u0645\u0639\u0645\u0648\u0644\u06cc \u0631\u0627 \u062a\u0634\u062e\u06cc\u0635 \u062f\u0647\u06cc\u0645.<\/p>\n<h2 style=\"text-align: justify;\"><span style=\"color: #3366ff;\">\u06a9\u0627\u0631\u0628\u0631\u062f\u0647\u0627\u06cc \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062f\u0631 Typescript<\/span><\/h2>\n<ol>\n<li style=\"text-align: justify;\">\u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0622\u0646\u200c\u0647\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0642\u0631\u0627\u0631\u062f\u0627\u062f\u06cc \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u062a\u0645\u0627\u0645\u06cc \u06a9\u0644\u0627\u0633\u200c\u0647\u0627 \u0628\u0627\u06cc\u062f \u0627\u0632 \u0622\u0646\u200c \u062a\u0628\u0639\u06cc\u062a \u06a9\u0646\u0646\u062f.<\/li>\n<li style=\"text-align: justify;\">\u062f\u0631 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc\u062a\u0627\u0646 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 Type\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/li>\n<\/ol>\n<p style=\"text-align: justify;\">\u0627\u062d\u062a\u0645\u0627\u0644\u0627\u064b \u0645\u062a\u0648\u062c\u0647 \u0634\u062f\u0647\u200c\u0627\u06cc\u062f \u06a9\u0647 \u0647\u0645 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627 \u0648 \u0647\u0645 \u062a\u0627\u06cc\u067e\u200c\u0647\u0627 \u06a9\u0627\u0631\u0628\u0631\u062f\u0647\u0627\u06cc \u0645\u0634\u0627\u0628\u0647\u06cc \u062f\u0627\u0631\u0646\u062f. \u062f\u0631\u0648\u0627\u0642\u0639\u060c \u0628\u0633\u06cc\u0627\u0631\u06cc \u0627\u0632 \u06a9\u0627\u0631\u0628\u0631\u0627\u0646 \u0627\u06cc\u0646 \u062f\u0648 \u0645\u0648\u0636\u0648\u0639 \u0631\u0627 \u0628\u0627\u200c\u0647\u0645 \u0627\u0634\u062a\u0628\u0627\u0647 \u0645\u06cc\u200c\u06af\u06cc\u0631\u0646\u062f \u0648 \u0628\u0647\u200c\u062c\u0627\u06cc \u06cc\u06a9\u062f\u06cc\u06af\u0631 \u0627\u0632 \u0622\u0646\u200c\u0647\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u0646\u062f. \u062a\u0646\u0647\u0627 \u062a\u0641\u0627\u0648\u062a \u0645\u0648\u062c\u0648\u062f \u0627\u06cc\u0646 \u0627\u0633\u062a \u06a9\u0647 \u062f\u0631 Interface\u0647\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u06cc\u0634 \u0627\u0632 \u06cc\u06a9 \u062a\u0639\u0631\u06cc\u0641 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f. \u0633\u067e\u0633\u060c \u062e\u0648\u062f\u0650 TypeScript \u0627\u06cc\u0646 \u062a\u0639\u0627\u0631\u06cc\u0641 \u0631\u0627 \u0628\u0627\u200c\u0647\u0645 \u0627\u062f\u063a\u0627\u0645 \u0645\u06cc\u200c\u06a9\u0646\u062f\u061b \u0627\u0645\u0627 Type\u0647\u0627 \u0641\u0642\u0637 \u06cc\u06a9 \u0628\u0627\u0631 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u0646\u062f \u062a\u0639\u0631\u06cc\u0641 \u0634\u0648\u0646\u062f. \u062a\u0641\u0627\u0648\u062a \u062f\u06cc\u06af\u0631 \u0627\u06cc\u0646 \u0627\u0633\u062a \u06a9\u0647 \u0627\u0632 Type \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0647\u200c\u0645\u0646\u0638\u0648\u0631 \u0645\u0639\u0631\u0641\u06cc \u0646\u0627\u0645 \u0645\u0633\u062a\u0639\u0627\u0631 \u0628\u0631\u0627\u06cc \u0627\u0646\u0648\u0627\u0639 \u062f\u0627\u062f\u0647\u200c\u0647\u0627\u06cc \u0627\u0648\u0644\u06cc\u0647 \u0645\u062b\u0644 Boolean \u0648 String \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<p style=\"text-align: justify;\">\u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627\u06cc \u062a\u0627\u06cc\u067e\u200c\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u06cc\u06a9\u06cc \u0627\u0632 \u0631\u0648\u0634\u200c\u0647\u0627\u06cc \u06a9\u0627\u0631\u0622\u0645\u062f \u0628\u0631\u0627\u06cc \u0645\u0639\u0631\u0641\u06cc \u0633\u0627\u062e\u062a\u0627\u0631\u0647\u0627\u06cc Type \u0647\u0633\u062a\u0646\u062f. \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062f\u0631 Typescript\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u0633\u0627\u062e\u062a\u0627\u0631\u0647\u0627\u06cc Type \u062f\u0631\u0628\u0631\u0627\u0628\u0631 \u062a\u063a\u06cc\u06cc\u0631 \u0645\u062d\u0627\u0641\u0638\u062a \u0648 \u0647\u0645\u200c\u0632\u0645\u0627\u0646 \u0628\u0631\u0627\u06cc \u0622\u0646\u200c\u0647\u0627 \u0645\u0633\u062a\u0646\u062f\u0633\u0627\u0632\u06cc \u06a9\u0646\u06cc\u062f. \u0627\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u0628\u0627\u0639\u062b \u062e\u0648\u0627\u0647\u062f \u0634\u062f \u06a9\u0647 \u062a\u062c\u0631\u0628\u0647 \u0628\u0647\u062a\u0631\u06cc \u0627\u0632 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0646\u0648\u06cc\u0633\u06cc \u06a9\u0633\u0628 \u06a9\u0646\u06cc\u062f.<\/p>\n<h2 style=\"text-align: justify;\"><span style=\"color: #3366ff;\">\u0627\u06cc\u062c\u0627\u062f \u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Interface \u062f\u0631 TypeScript<\/span><\/h2>\n<p style=\"text-align: justify;\">\u0628\u0647\u200c\u0645\u0646\u0638\u0648\u0631 \u0627\u06cc\u062c\u0627\u062f \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062f\u0631 TypeScript\u060c \u0627\u0632 \u06a9\u0644\u0645\u0647 \u06a9\u0644\u06cc\u062f\u06cc Interface \u0628\u0647\u200c\u0647\u0645\u0631\u0627\u0647 \u0627\u0633\u0645 \u062f\u0644\u062e\u0648\u0627\u0647 \u0628\u0631\u0627\u06cc Interface \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f \u0648 \u0633\u067e\u0633 \u06a9\u062f\u0647\u0627\u06cc \u0645\u062f\u0646\u0638\u0631 \u0631\u0627 \u062f\u0627\u062e\u0644 {} \u0642\u0631\u0627\u0631 \u062e\u0648\u0627\u0647\u06cc\u0645 \u062f\u0627\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface Logger {\r\nlog: (message: string) =&gt; void;\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u0645\u0627\u0646\u0646\u062f \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u0627\u0632 Type \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645\u060c \u062a\u0645\u0627\u0645\u06cc \u06a9\u062f\u0647\u0627\u06cc \u0645\u062f\u0646\u0638\u0631 \u0628\u0627\u06cc\u062f \u062f\u0627\u062e\u0644 {} \u0642\u0631\u0627\u0631 \u0628\u06af\u06cc\u0631\u0646\u062f. \u062f\u0631 \u06a9\u062f \u0628\u0627\u0644\u0627\u060c \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0644\u0627\u06af\u0631 \u0646\u0634\u0627\u0646\u200c\u062f\u0647\u0646\u062f\u0647 \u0634\u06cc\u0626\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0639\u0646\u0635\u0631\u06cc \u0628\u0647 \u0646\u0627\u0645 log \u062f\u0627\u0631\u062f. \u062f\u0631\u0648\u0627\u0642\u0639\u060c \u0627\u06cc\u0646 \u0639\u0646\u0635\u0631 \u062a\u0627\u0628\u0639\u06cc \u0627\u0633\u062a \u06a9\u0647 \u067e\u0627\u0631\u0627\u0645\u062a\u0631\u06cc \u0627\u0632 \u0646\u0648\u0639 String \u0631\u0627 \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u0645\u0642\u062f\u0627\u0631 void \u0631\u0627 \u0628\u0627\u0632\u06af\u0634\u062a \u0645\u06cc\u200c\u062f\u0647\u062f.<\/p>\n<p style=\"text-align: justify;\">\u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Logger \u0645\u0627\u0646\u0646\u062f \u0647\u0631 Type \u062f\u06cc\u06af\u0631\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f. \u0645\u062b\u0627\u0644 \u0632\u06cc\u0631\u060c \u0646\u0645\u0648\u0646\u0647\u200c\u0627\u06cc \u0627\u0632 \u0627\u06cc\u062c\u0627\u062f \u0634\u06cc\u0626\u06cc \u0627\u0633\u062a \u06a9\u0647 \u062f\u0642\u06cc\u0642\u0627\u064b \u0645\u0634\u0627\u0628\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Logger \u0627\u0633\u062a:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface Logger {\r\nlog: (message: string) =&gt; void;\r\n}\r\n\r\nconst logger: Logger = {\r\nlog: (message) =&gt; console.log(message),\r\n};<\/pre>\n<p style=\"text-align: justify;\">\u0645\u0642\u0627\u062f\u06cc\u0631\u06cc \u06a9\u0647 \u062f\u0631 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Logger \u0628\u0647\u200c\u062c\u0627\u06cc Type \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u0646\u062f\u060c \u0628\u0627\u06cc\u062f \u0647\u0645\u0627\u0646 \u0627\u0639\u0636\u0627\u06cc\u06cc \u0631\u0627 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u0646\u062f \u06a9\u0647 \u0647\u0646\u06af\u0627\u0645 \u062a\u0639\u0631\u06cc\u0641 Interface \u0645\u0639\u0631\u0641\u06cc \u0634\u062f\u0647\u200c\u0627\u0646\u062f\u061b \u0627\u0644\u0628\u062a\u0647 \u0627\u0639\u0636\u0627\u06cc \u0627\u062e\u062a\u06cc\u0627\u0631\u06cc \u0631\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u062d\u0630\u0641 \u06a9\u0646\u06cc\u062f \u0648 \u0628\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0622\u0646\u200c\u0647\u0627 \u0646\u06cc\u0627\u0632\u06cc \u0646\u062e\u0648\u0627\u0647\u06cc\u062f \u062f\u0627\u0634\u062a. \u0647\u0645\u0686\u0646\u06cc\u0646\u060c \u0627\u0632\u0622\u0646\u200c\u062c\u0627\u200c\u06a9\u0647 \u0645\u0642\u0627\u062f\u06cc\u0631 \u062f\u0642\u06cc\u0642\u0627\u064b \u0628\u0627\u06cc\u062f \u0686\u06cc\u0632\u06cc \u0628\u0627\u0634\u0646\u062f \u06a9\u0647 \u062f\u0631 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0645\u0639\u0631\u0641\u06cc \u0634\u062f\u0647\u200c\u0627\u0646\u062f\u060c \u0627\u0636\u0627\u0641\u0647\u200c\u06a9\u0631\u062f\u0646 \u0641\u06cc\u0644\u062f\u0647\u0627\u06cc \u062c\u062f\u06cc\u062f \u0628\u0627\u0639\u062b \u062f\u0631\u06cc\u0627\u0641\u062a \u062e\u0637\u0627\u06cc \u06a9\u0627\u0645\u067e\u0627\u06cc\u0644 \u062e\u0648\u0627\u0647\u062f \u0634\u062f.<\/p>\n<p style=\"text-align: justify;\">\u062f\u0631 \u0645\u062b\u0627\u0644 \u0632\u06cc\u0631\u060c \u062f\u0631 \u0642\u0633\u0645\u062a \u0645\u0639\u0631\u0641\u06cc \u0634\u06cc\u0621 \u0648\u06cc\u0698\u06af\u06cc \u062c\u062f\u06cc\u062f\u06cc \u0627\u0636\u0627\u0641\u0647 \u06a9\u0631\u062f\u0647\u200c\u0627\u06cc\u0645 \u06a9\u0647 \u062f\u0631 \u0632\u0645\u0627\u0646 \u062a\u0639\u0631\u06cc\u0641 Interface \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0634\u062a:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface Logger {\r\nlog: (message: string) =&gt; void;\r\n}\r\n\r\nconst logger: Logger = {\r\nlog: (message) =&gt; console.log(message),\r\notherProp: true,\r\n};<\/pre>\n<p style=\"text-align: justify;\">\u062f\u0631 \u0627\u06cc\u0646 \u0646\u0645\u0648\u0646\u0647\u060c \u0634\u0645\u0627 \u062e\u0637\u0627\u06cc \u06f2\u06f3\u06f2\u06f2 \u0631\u0627 \u062f\u0631\u06cc\u0627\u0641\u062a \u062e\u0648\u0627\u0647\u06cc\u062f \u06a9\u0631\u062f\u061b \u0632\u06cc\u0631\u0627 \u062f\u0631 \u0632\u0645\u0627\u0646 \u062a\u0639\u0631\u06cc\u0641 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062f\u0631 Typescript\u060c \u0645\u0634\u062e\u0635\u0647 otherProp \u062a\u0639\u0631\u06cc\u0641 \u0646\u0634\u062f\u0647 \u0627\u0633\u062a:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Output\r\nType '{ log: (message: string) =&gt; void; otherProp: boolean; }' is not assignable to type 'Logger'.\r\nObject literal may only specify known properties, and 'otherProp' does not exist in type 'Logger'. (2322)<\/pre>\n<p style=\"text-align: justify;\">\u0645\u0627\u0646\u0646\u062f \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 Type \u0633\u0627\u062f\u0647\u200c\u0627\u06cc \u0631\u0627 \u062a\u0639\u0631\u06cc\u0641 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f\u060c \u0628\u0627 \u0627\u0636\u0627\u0641\u0647\u200c\u06a9\u0631\u062f\u0646 \u0639\u0644\u0627\u0645\u062a \u0633\u0624\u0627\u0644 \u0628\u0647 \u0627\u0633\u0645 \u0645\u0634\u062e\u0635\u0647\u200c\u0647\u0627\u060c \u0622\u0646\u200c\u0647\u0627 \u0631\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0647 \u0645\u0634\u062e\u0635\u0647\u200c\u0627\u06cc \u0627\u062e\u062a\u06cc\u0627\u0631\u06cc \u062a\u0628\u062f\u06cc\u0644 \u06a9\u0646\u06cc\u062f.<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" data-loaded=\"true\" src=\"https:\/\/parspack.com\/blog\/wp-content\/uploads\/2022\/06\/typescript1.jpg\" class=\"wp-image-24842 size-full\" alt=\"Interface \u062f\u0631 \u062a\u0627\u06cc\u067e \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a\" title=\"\u0627\u06cc\u062c\u0627\u062f  Interface \u0647\u0627 \u0631\u0627 \u062f\u0631 \u062a\u0627\u06cc\u067e \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a\"       width=\"750\" height=\"475\" srcset=\"https:\/\/parspack.com\/blog\/wp-content\/uploads\/2022\/06\/typescript1.jpg 750w, https:\/\/parspack.com\/blog\/wp-content\/uploads\/2022\/06\/typescript1-300x190.jpg 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><figcaption class=\"text-subtitle-5 text-gray-9 text-center mt-2\" >\u0686\u06af\u0648\u0646\u0647 Interface \u0647\u0627 \u0631\u0627 \u062f\u0631 \u062a\u0627\u06cc\u067e \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0627\u06cc\u062c\u0627\u062f \u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u0645\u061f<\/figcaption><\/figure>\n<h2 style=\"text-align: justify;\"><span style=\"color: #3366ff;\">\u0627\u0641\u0632\u0627\u06cc\u0634 \u06a9\u0627\u0631\u0628\u0631\u062f Type\u0647\u0627<\/span><\/h2>\n<p style=\"text-align: justify;\">\u0648\u0642\u062a\u06cc Interface \u062a\u0639\u0631\u06cc\u0641 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f\u060c \u0627\u0632 \u0627\u0646\u0648\u0627\u0639 \u0627\u0634\u06cc\u0627\u0621 \u0645\u062e\u062a\u0644\u0641 \u0647\u0645 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0641\u0631\u0627\u062a\u0631 \u0628\u0631\u0648\u06cc\u062f \u0648 \u062a\u0645\u0627\u0645\u06cc \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u062a\u0627\u06cc\u067e\u200c\u0647\u0627\u06cc \u06af\u0633\u062a\u0631\u0634\u200c\u062f\u0627\u062f\u0647\u200c\u0634\u062f\u0647 \u0631\u0627 \u0646\u06cc\u0632 \u062f\u0631 \u0622\u0646\u200c\u0647\u0627 \u0628\u06af\u0646\u062c\u0627\u0646\u06cc\u062f. \u0628\u0627 \u0627\u06cc\u0646 \u06a9\u0627\u0631\u060c \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0641\u06cc\u0644\u062f\u0647\u0627\u06cc \u0645\u062a\u062f\u0627\u0648\u0644 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627\u06cc \u06a9\u0648\u0686\u06a9\u06cc \u0627\u06cc\u062c\u0627\u062f \u0648 \u0627\u0632 \u0622\u0646\u200c\u0647\u0627 \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627\u06cc \u062c\u062f\u06cc\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<p style=\"text-align: justify;\">\u062a\u0635\u0648\u0631 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u06cc \u0628\u0647\u200c\u0634\u06a9\u0644 \u0632\u06cc\u0631 \u062f\u0627\u0631\u06cc\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface Clearable {\r\nclear: () =&gt; void;\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u0633\u067e\u0633\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062c\u062f\u06cc\u062f\u06cc \u0628\u0633\u0627\u0632\u06cc\u062f \u06a9\u0647 \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0642\u0628\u0644\u06cc \u062a\u0648\u0633\u0639\u0647 \u06cc\u0627\u0641\u062a\u0647 \u0627\u0633\u062a \u0648 \u062a\u0645\u0627\u0645\u06cc \u0641\u06cc\u0644\u062f\u0647\u0627\u06cc \u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0642\u0628\u0644\u06cc \u0631\u0627 \u062f\u0627\u0631\u062f. \u062f\u0631 \u0645\u062b\u0627\u0644 \u0632\u06cc\u0631\u060c \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Logger \u062f\u0631\u0648\u0627\u0642\u0639 \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Clearable \u062a\u0648\u0633\u0639\u0647 \u06cc\u0627\u0641\u062a\u0647 \u0627\u0633\u062a. \u0628\u0647 \u062e\u0637\u200c\u0647\u0627\u06cc \u0628\u0648\u0644\u062f\u200c\u0634\u062f\u0647\u200c \u062f\u0642\u062a \u06a9\u0646\u06cc\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface Clearable {\r\nclear: () =&gt; void;\r\n}\r\n\r\ninterface Logger extends Clearable {\r\nlog: (message: string) =&gt; void;\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Logger \u0639\u0636\u0648\u06cc \u0628\u0647 \u0646\u0627\u0645 Clear \u062f\u0627\u0631\u062f \u06a9\u0647 \u0647\u06cc\u0686 \u0645\u0642\u062f\u0627\u0631 \u062c\u062f\u06cc\u062f\u06cc \u0631\u0627 \u0642\u0628\u0648\u0644 \u0646\u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u0645\u0642\u062f\u0627\u0631 void \u0631\u0627 \u0628\u0631\u0645\u06cc\u200c\u06af\u0631\u062f\u0627\u0646\u062f. \u0627\u06cc\u0646 \u0639\u0636\u0648 \u062c\u062f\u06cc\u062f \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Clearable \u0628\u0647\u200c\u0627\u0631\u062b \u0628\u0631\u062f\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a \u0648 \u06a9\u0627\u0631\u0628\u0631\u062f \u0622\u0646 \u062f\u0642\u06cc\u0642\u0627\u064b \u0634\u0628\u06cc\u0647 \u0648\u0642\u062a\u06cc \u0627\u0633\u062a \u06a9\u0647 \u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u0645\u06cc\u200c\u0646\u0648\u06cc\u0633\u06cc\u0645:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface Logger {\r\nlog: (message: string) =&gt; void;\r\nclear: () =&gt; void;\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u0642\u0631\u0627\u0631 \u0627\u0633\u062a \u0686\u0646\u062f\u06cc\u0646 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0631\u0627 \u0628\u0627 \u0645\u062c\u0645\u0648\u0639\u0647 \u0641\u06cc\u0644\u062f\u0647\u0627\u06cc \u0645\u0634\u062a\u0631\u06a9 \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f\u060c \u0641\u06cc\u0644\u062f\u0647\u0627\u06cc \u0645\u0634\u062a\u0631\u06a9 \u0631\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u062f\u0631 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u06cc \u062c\u062f\u0627\u06af\u0627\u0646\u0647 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f \u0648 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627\u06cc \u0628\u0639\u062f\u06cc \u0631\u0627 \u0627\u0632 \u0647\u0645\u06cc\u0646 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062c\u062f\u06cc\u062f \u062a\u0648\u0633\u0639\u0647 \u062f\u0647\u06cc\u062f.<\/p>\n<p style=\"text-align: justify;\">\u0628\u0647 \u0645\u062b\u0627\u0644 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Clearable \u0628\u0631\u0645\u06cc\u200c\u06af\u0631\u062f\u06cc\u0645 \u06a9\u0647 \u062f\u0631 \u0628\u062e\u0634 \u0642\u0628\u0644\u06cc \u0646\u0648\u0634\u062a\u06cc\u0645. \u062a\u0635\u0648\u0631 \u06a9\u0646\u06cc\u062f \u0628\u0631\u0646\u0627\u0645\u0647 \u0634\u0645\u0627 \u0628\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062c\u062f\u06cc\u062f\u06cc \u0645\u062b\u0644 StringList \u0646\u06cc\u0627\u0632 \u062f\u0627\u0631\u062f \u062a\u0627 \u0633\u0627\u062e\u062a\u0627\u0631 \u062f\u0627\u062f\u0647 \u062d\u0627\u0648\u06cc \u0686\u0646\u062f \u0631\u0634\u062a\u0647 \u0645\u062e\u062a\u0644\u0641 \u0631\u0627 \u0646\u0645\u0627\u06cc\u0634 \u062f\u0647\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface StringList {\r\npush: (value: string) =&gt; void;\r\nget: () =&gt; string[];\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u0627\u06af\u0631 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 StringList \u0631\u0627 \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Clearable \u062a\u0648\u0633\u0639\u0647 \u062f\u0647\u06cc\u062f\u060c \u0645\u0634\u062e\u0635 \u062e\u0648\u0627\u0647\u06cc\u062f \u06a9\u0631\u062f \u06a9\u0647 \u0627\u06cc\u0646 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062a\u0645\u0627\u0645\u06cc \u0627\u0639\u0636\u0627\u06cc \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Clearable \u0631\u0627 \u0647\u0645 \u062f\u0627\u0631\u062f \u0648 \u0645\u0634\u062e\u0635\u0647 Clear \u0631\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0647 \u0622\u0646 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface StringList extends Clearable {\r\npush: (value: string) =&gt; void;\r\nget: () =&gt; string[];\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627 \u0631\u0627 \u0627\u0632 \u0627\u0646\u0648\u0627\u0639 \u0627\u0634\u06cc\u0627\u0621 \u0645\u062b\u0644 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627 \u0648 \u062a\u0627\u06cc\u067e\u200c\u0647\u0627\u06cc \u0645\u0639\u0645\u0648\u0644\u06cc \u0648 \u062d\u062a\u06cc \u06a9\u0644\u0627\u0633\u200c\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u062a\u0648\u0633\u0639\u0647 \u062f\u0647\u06cc\u062f.<\/p>\n<h2 style=\"text-align: justify;\"><span style=\"color: #3366ff;\">\u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627\u06cc \u062f\u0627\u0631\u0627\u06cc Callable Signature<\/span><\/h2>\n<p style=\"text-align: justify;\">\u062f\u0631\u0635\u0648\u0631\u062a\u06cc\u200c\u06a9\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u06cc \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u062f\u0646\u06cc (Callable) \u0628\u0627\u0634\u062f\u060c \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u0628\u062e\u0634 \u062a\u0639\u0631\u06cc\u0641 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0631\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627 \u0627\u06cc\u062c\u0627\u062f \u0627\u0645\u0636\u0627\u06cc \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u062f\u0646\u06cc \u0627\u0646\u062a\u0642\u0627\u0644 \u062f\u0647\u06cc\u062f. \u0627\u0645\u0636\u0627\u0647\u0627\u06cc \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u062f\u0646\u06cc \u0628\u0627 \u0627\u0636\u0627\u0641\u0647\u200c\u06a9\u0631\u062f\u0646 \u062a\u0639\u0631\u06cc\u0641 \u062a\u0627\u0628\u0639 \u062f\u0627\u062e\u0644 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc\u200c\u0634\u0648\u0646\u062f. \u0647\u0645\u0686\u0646\u06cc\u0646\u060c \u0628\u0647\u200c\u062c\u0627\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 =&gt;\u060c \u062f\u0631 \u0632\u0645\u0627\u0646 \u062a\u0646\u0638\u06cc\u0645 \u0646\u0648\u0639 \u0628\u0627\u0632\u06af\u0634\u062a\u06cc \u0627\u0632 : \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f.<\/p>\n<p style=\"text-align: justify;\">\u0628\u0631\u0627\u06cc \u0645\u062b\u0627\u0644\u060c \u0642\u0633\u0645\u062a \u0628\u0648\u0644\u062f\u0634\u062f\u0647 \u06a9\u062f \u0632\u06cc\u0631 \u0627\u0645\u0636\u0627\u06cc\u06cc \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u062f\u0646\u06cc \u0631\u0627 \u0628\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Logger \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface Logger {\r\n(message: string): void;\r\nlog: (message: string) =&gt; void;\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u0627\u06af\u0631 \u062f\u0642\u062a \u06a9\u0631\u062f\u0647 \u0628\u0627\u0634\u06cc\u062f\u060c \u0646\u062d\u0648\u0647 \u062a\u0639\u0631\u06cc\u0641 \u0627\u0645\u0636\u0627\u0647\u0627\u06cc \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u062f\u0646\u06cc \u0634\u0628\u06cc\u0647 \u062a\u0639\u0631\u06cc\u0641 \u062a\u0648\u0627\u0628\u0639 \u0646\u0627\u0634\u0646\u0627\u0633 \u0627\u0633\u062a\u061b \u0627\u0645\u0627 \u062f\u0631 \u0632\u0645\u0627\u0646 \u062a\u0639\u0631\u06cc\u0641 \u0646\u0648\u0639 \u0628\u0627\u0632\u06af\u0634\u062a\u06cc\u060c \u0628\u0647\u200c\u062c\u0627\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 =&gt;\u060c \u0627\u0632 \u0639\u0644\u0627\u0645\u062a : \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645. \u0627\u06cc\u0646 \u06cc\u0639\u0646\u06cc \u0647\u0631 \u0645\u0642\u062f\u0627\u0631 \u0645\u062a\u0639\u0644\u0642 \u0628\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0644\u0627\u06af\u0631 \u0631\u0627 \u0645\u0633\u062a\u0642\u06cc\u0645\u0627\u064b \u0628\u0647\u200c\u0639\u0646\u0648\u0627\u0646 \u062a\u0627\u0628\u0639 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u06cc \u06a9\u0646\u06cc\u062f. \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u0645\u0642\u0627\u062f\u06cc\u0631\u06cc \u06a9\u0647 \u0628\u0627 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0644\u0627\u06af\u0631 \u0634\u0645\u0627 \u0647\u0645\u200c\u062e\u0648\u0627\u0646\u06cc \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u0646\u062f\u060c \u0628\u0627\u06cc\u062f \u0628\u0647 \u0627\u06cc\u0646 \u0646\u06cc\u0627\u0632\u0645\u0646\u062f\u06cc\u200c\u0647\u0627\u06cc Interface \u062a\u0648\u062c\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"text-align: justify;\">\u0628\u0627\u06cc\u062f \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u062f\u0646\u06cc \u0628\u0627\u0634\u062f.<\/li>\n<li style=\"text-align: justify;\">\u0628\u0627\u06cc\u062f \u0645\u0634\u062e\u0635\u0647\u200c\u0627\u06cc \u0628\u0647 \u0646\u0627\u0645 log \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f. \u0627\u06cc\u0646 \u0645\u0634\u062e\u0635\u0647 \u062a\u0627\u0628\u0639\u06cc \u0627\u0633\u062a \u06a9\u0647 \u067e\u0627\u0631\u0627\u0645\u062a\u0631\u06cc \u0627\u0632 \u0646\u0648\u0639 String \u0631\u0627 \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\u062f\u0631 \u0645\u062b\u0627\u0644 \u0632\u06cc\u0631\u060c \u0645\u062a\u063a\u06cc\u0631\u06cc \u0628\u0647 \u0646\u0627\u0645 \u0644\u0627\u06af\u0631 \u0631\u0627 \u0645\u0639\u0631\u0641\u06cc \u062e\u0648\u0627\u0647\u06cc\u0645 \u06a9\u0631\u062f \u06a9\u0647 \u0628\u0647 Type \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0644\u0627\u06af\u0631 \u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u0627\u062e\u062a\u0635\u0627\u0635 \u06cc\u0627\u0628\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface Logger {\r\n  (message: string): void;\r\n  log: (message: string) =&gt; void;\r\n}\r\n\r\nconst logger: Logger = (message: string) =&gt; {\r\n  console.log(message);\r\n}\r\nlogger.log = (message: string) =&gt; {\r\n  console.log(message);\r\n}\r\n<\/pre>\n<p style=\"text-align: justify;\">\u0628\u0631\u0627\u06cc \u0647\u0645\u200c\u062e\u0648\u0627\u0646\u06cc \u0628\u0627 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Logger\u060c \u0645\u0642\u062f\u0627\u0631 \u0645\u062f\u0646\u0638\u0631 \u0628\u0627\u06cc\u062f \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u062f\u0646\u06cc \u0628\u0627\u0634\u062f\u061b \u0628\u0647\u200c\u0647\u0645\u06cc\u0646\u200c\u062f\u0644\u06cc\u0644\u060c \u0645\u062a\u063a\u06cc\u0631 Logger \u0631\u0627 \u0628\u0647 \u0628\u0627\u06cc\u062f \u06cc\u06a9 \u062a\u0627\u0628\u0639 \u0627\u062e\u062a\u0635\u0627\u0635 \u062f\u0647\u06cc\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface Logger {\r\n(message: string): void;\r\nlog: (message: string) =&gt; void;\r\n}\r\n\r\nconst logger: Logger = (message: string) =&gt; {\r\nconsole.log(message);\r\n}\r\nlogger.log = (message: string) =&gt; {\r\nconsole.log(message);\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u0633\u067e\u0633\u060c \u0645\u0634\u062e\u0635\u0647 log \u0631\u0627 \u0628\u0647 \u062a\u0627\u0628\u0639 Logger \u0628\u0627\u06cc\u062f \u0627\u062e\u062a\u0635\u0627\u0635 \u062f\u0647\u06cc\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface Logger {\r\n(message: string): void;\r\nlog: (message: string) =&gt; void;\r\n}\r\n\r\nconst logger: Logger = (message: string) =&gt; {\r\nconsole.log(message);\r\n}\r\nlogger.log = (message: string) =&gt; {\r\nconsole.log(message);\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u0627\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Logger \u0636\u0631\u0648\u0631\u06cc \u0627\u0633\u062a. \u0627\u0641\u0632\u0648\u0646\u200c\u0628\u0631\u0627\u06cc\u0646\u060c \u0645\u0642\u0627\u062f\u06cc\u0631\u06cc \u06a9\u0647 \u0628\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Logger \u0627\u062e\u062a\u0635\u0627\u0635 \u0645\u06cc\u200c\u06cc\u0627\u0628\u0646\u062f\u060c \u0628\u0627\u06cc\u062f \u0645\u0634\u062e\u0635\u0647\u200c\u0627\u06cc \u0628\u0627 \u0639\u0646\u0648\u0627\u0646 log \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u0646\u062f. \u0627\u06cc\u0646 \u0645\u0634\u062e\u0635\u0647 \u0646\u06cc\u0632 \u062a\u0627\u0628\u0639\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0631\u0634\u062a\u0647\u200c\u0627\u06cc \u0631\u0627 \u0628\u0647\u200c\u0639\u0646\u0648\u0627\u0646 \u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u0645\u0642\u062f\u0627\u0631 void \u0631\u0627 \u0628\u0627\u0632\u06af\u0634\u062a \u0645\u06cc\u200c\u062f\u0647\u062f.<\/p>\n<p style=\"text-align: justify;\">\u062f\u0631\u0635\u0648\u0631\u062a\u06cc\u200c\u06a9\u0647 \u0645\u0634\u062e\u0635\u0647 log \u0631\u0627 \u0648\u0627\u0631\u062f \u0646\u06a9\u0646\u06cc\u062f\u060c \u06a9\u0627\u0645\u067e\u0627\u06cc\u0644\u0631 TypeScript \u0627\u0631\u0648\u0631 \u06f2\u06f7\u06f4\u06f1 \u0631\u0627 \u0628\u0647 \u0634\u0645\u0627 \u0646\u0645\u0627\u06cc\u0634 \u0645\u06cc\u200c\u062f\u0647\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Output\r\nProperty 'log' is missing in type '(message: string) =&gt; void' but required in type 'Logger'. (2741)<\/pre>\n<p style=\"text-align: justify;\">\u0647\u0645\u0686\u0646\u06cc\u0646\u060c \u0627\u06af\u0631 \u0645\u0634\u062e\u0635\u0647 log \u062f\u0631 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Logger \u0627\u0645\u0636\u0627\u06cc Type \u0646\u0627\u0633\u0627\u0632\u06af\u0627\u0631\u06cc \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f\u060c \u067e\u06cc\u063a\u0627\u0645 \u062e\u0637\u0627\u06cc \u0645\u0634\u0627\u0628\u0647\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062e\u0648\u0627\u0647\u06cc\u062f \u06a9\u0631\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface Logger {\r\n(message: string): void;\r\nlog: (message: string) =&gt; void;\r\n}\r\n\r\nconst logger: Logger = (message: string) =&gt; {\r\nconsole.log(message);\r\n}\r\nlogger.log = true;<\/pre>\n<p style=\"text-align: justify;\">\u062f\u0631 \u0627\u06cc\u0646 \u0646\u0645\u0648\u0646\u0647\u060c \u06a9\u0627\u0645\u067e\u0627\u06cc\u0644\u0631 \u06a9\u062f \u062e\u0637\u0627\u06cc \u06f2\u06f3\u06f2\u06f2 \u0631\u0627 \u0646\u0645\u0627\u06cc\u0634 \u0645\u06cc\u200c\u062f\u0647\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Output\r\nType 'boolean' is not assignable to type '(message: string) =&gt; void'. (2322)<\/pre>\n<p style=\"text-align: justify;\">\u06cc\u06a9\u06cc \u0627\u0632 \u0648\u06cc\u0698\u06af\u06cc\u200c\u0647\u0627\u06cc \u0645\u062b\u0628\u062a \u0627\u06cc\u0646 \u0627\u0633\u062a \u06a9\u0647 \u0645\u062a\u063a\u06cc\u0631\u0647\u0627 \u0628\u0627\u06cc\u062f \u062a\u0627\u06cc\u067e \u0645\u0634\u062e\u0635\u06cc \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u0646\u062f \u06a9\u0647 \u062f\u0631 \u0645\u062b\u0627\u0644 \u0628\u0627\u0644\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0622\u0646\u200c\u0647\u0627 \u0631\u0627 \u0645\u0634\u0627\u0647\u062f\u0647 \u06a9\u0646\u06cc\u062f. \u062f\u0631 \u0627\u06cc\u0646 \u0645\u062b\u0627\u0644\u060c \u0645\u062a\u063a\u06cc\u0631 Logger \u0628\u0647\u200c\u06af\u0648\u0646\u0647\u200c\u0627\u06cc \u062a\u0646\u0638\u06cc\u0645 \u0634\u062f\u0647 \u0627\u0633\u062a \u06a9\u0647 \u062a\u0627\u06cc\u067e \u0622\u0646 \u0627\u0632 \u0646\u0648\u0639 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Logger \u0628\u0627\u0634\u062f. \u0628\u0627 \u0627\u06cc\u0646 \u06a9\u0627\u0631\u060c \u062a\u0627\u06cc\u067e\u200c\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u0646\u0648\u0639 \u062a\u0648\u0627\u0628\u0639 Logger \u0648 \u062a\u0627\u0628\u0639 \u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u0645\u0634\u062e\u0635\u0647 log \u0631\u0627 \u0628\u0647\u200c\u0633\u0627\u062f\u06af\u06cc \u062a\u0634\u062e\u06cc\u0635 \u062f\u0647\u062f.<\/p>\n<p style=\"text-align: justify;\">\u0634\u0645\u0627 \u0627\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u0631\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627 \u062d\u0630\u0641 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 Type \u0627\u0632 \u0622\u0631\u06af\u0648\u0645\u0627\u0646\u200c\u0647\u0627\u06cc \u0647\u0631 \u062f\u0648 \u062a\u0627\u0628\u0639 \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u062f. \u0627\u06af\u0631 \u062f\u0642\u062a \u06a9\u0646\u06cc\u062f\u060c \u062f\u0631 \u0642\u0633\u0645\u062a\u200c\u0647\u0627\u06cc \u0628\u0648\u0644\u062f\u0634\u062f\u0647 \u06a9\u062f \u0632\u06cc\u0631\u060c \u067e\u0627\u0631\u0627\u0645\u062a\u0631\u0647\u0627\u06cc Message \u0647\u06cc\u0686 \u0646\u0648\u0639 \u062e\u0627\u0635\u06cc \u0646\u062f\u0627\u0631\u0646\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface Logger {\r\n(message: string): void;\r\nlog: (message: string) =&gt; void;\r\n}\r\n\r\nconst logger: Logger = (message) =&gt; {\r\nconsole.log(message);\r\n}\r\nlogger.log = (message) =&gt; {\r\nconsole.log(message);\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u062f\u0631 \u0647\u0631 \u062f\u0648 \u0646\u0645\u0648\u0646\u0647\u060c \u0648\u06cc\u0631\u0627\u06cc\u0634\u06af\u0631 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u062a\u0634\u062e\u06cc\u0635 \u062f\u0647\u062f \u06a9\u0647 \u0646\u0648\u0639 \u067e\u0627\u0631\u0627\u0645\u062a\u0631 String \u0627\u0633\u062a. \u062f\u0631\u0648\u0627\u0642\u0639\u060c String \u0647\u0645\u0627\u0646 \u0646\u0648\u0639 \u062f\u0627\u062f\u0647\u200c\u0627\u06cc \u0645\u062d\u0633\u0648\u0628 \u0645\u06cc\u200c\u0634\u0648\u062f \u06a9\u0647 \u062f\u0631 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Logger \u0645\u0648\u0631\u062f\u0627\u0646\u062a\u0638\u0627\u0631 \u0627\u0633\u062a.<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" data-loaded=\"true\" src=\"https:\/\/parspack.com\/blog\/wp-content\/uploads\/2022\/06\/typescript2.jpg\" class=\"wp-image-24841 size-full\" alt=\"\u062f\u0644\u06cc\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 interface\" title=\"\u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627\u06cc \u062f\u0627\u0631\u0627\u06cc Callable Signature\"       width=\"750\" height=\"299\" srcset=\"https:\/\/parspack.com\/blog\/wp-content\/uploads\/2022\/06\/typescript2.jpg 750w, https:\/\/parspack.com\/blog\/wp-content\/uploads\/2022\/06\/typescript2-300x120.jpg 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><figcaption class=\"text-subtitle-5 text-gray-9 text-center mt-2\" >\u0622\u0645\u0648\u0632\u0634 typescript \u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627\u06cc \u062f\u0627\u0631\u0627\u06cc Callable Signature<\/figcaption><\/figure>\n<h2 style=\"text-align: justify;\"><span style=\"color: #3366ff;\">\u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627\u06cc \u062f\u0627\u0631\u0627\u06cc Index Signature<\/span><\/h2>\n<p style=\"text-align: justify;\">\u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627\u06cc \u062e\u0648\u062f\u062a\u0627\u0646 \u0627\u0645\u0636\u0627\u06cc \u0634\u0627\u062e\u0635 (Index Signature) \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f. \u0628\u062f\u06cc\u0646\u200c\u062a\u0631\u062a\u06cc\u0628\u060c \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u0646\u062f \u062a\u0639\u062f\u0627\u062f \u0628\u06cc\u200c\u0646\u0647\u0627\u06cc\u062a\u06cc \u0627\u0632 \u0645\u0634\u062e\u0635\u0647\u200c\u0647\u0627 \u0631\u0627 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u0646\u062f. \u0628\u0631\u0627\u06cc \u0645\u062b\u0627\u0644\u060c \u0627\u06af\u0631 \u0645\u06cc\u200c\u062e\u0648\u0627\u0647\u06cc\u062f \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 DataRecord \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u062a\u0639\u062f\u0627\u062f \u0628\u06cc\u200c\u0646\u0647\u0627\u06cc\u062a\u06cc \u0627\u0632 \u0641\u06cc\u0644\u062f\u0647\u0627\u06cc String \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f\u060c \u0627\u0632 \u0627\u0645\u0636\u0627\u06cc \u0634\u0627\u062e\u0635 \u0628\u0647\u200c\u0634\u06a9\u0644 \u0632\u06cc\u0631 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface DataRecord {\r\n[key: string]: string;\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u0633\u067e\u0633\u060c \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 DataRecord \u0628\u0631\u0627\u06cc \u062a\u0646\u0638\u06cc\u0645 \u062a\u0627\u06cc\u067e \u0639\u0646\u0627\u0635\u0631\u06cc \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0686\u0646\u062f\u06cc\u0646 \u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u0627\u0632 \u0646\u0648\u0639 String \u062f\u0627\u0631\u0646\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface DataRecord {\r\n[key: string]: string;\r\n}\r\n\r\nconst data: DataRecord = {\r\nfieldA: \"valueA\",\r\nfieldB: \"valueB\",\r\nfieldC: \"valueC\",\r\n\/\/ ...\r\n};<\/pre>\n<p style=\"text-align: justify;\">\u062f\u0631 \u0627\u06cc\u0646 \u0628\u062e\u0634\u060c \u062a\u0648\u0627\u0646\u0633\u062a\u06cc\u0645 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0642\u0627\u0628\u0644\u06cc\u062a\u200c\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 TypeScript \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u0645. \u0647\u0645\u0686\u0646\u06cc\u0646\u060c \u0622\u0645\u0648\u062e\u062a\u06cc\u0645 \u06a9\u0647 \u0686\u06af\u0648\u0646\u0647 \u0627\u0632 Interface\u0647\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u0645. \u062f\u0631\u0627\u062f\u0627\u0645\u0647\u060c \u0628\u0627 \u062a\u0641\u0627\u0648\u062a Type \u0648 Interface \u0628\u06cc\u0634\u062a\u0631 \u0622\u0634\u0646\u0627 \u062e\u0648\u0627\u0647\u06cc\u0645 \u0634\u062f \u0648 \u0646\u062d\u0648\u0647 \u0627\u062f\u063a\u0627\u0645 \u062a\u0639\u0627\u0631\u06cc\u0641 \u0648 \u0627\u062f\u063a\u0627\u0645 \u0645\u0627\u0698\u0648\u0644\u200c\u0647\u0627 \u0631\u0627 \u06cc\u0627\u062f \u062e\u0648\u0627\u0647\u06cc\u0645 \u06af\u0631\u0641\u062a.<\/p>\n<h2 style=\"text-align: justify;\"><span style=\"color: #3366ff;\">\u062a\u0641\u0627\u0648\u062a Type \u0648 Interface<\/span><\/h2>\n<p style=\"text-align: justify;\">\u062a\u0627 \u0627\u06cc\u0646\u200c\u062c\u0627 \u062f\u06cc\u062f\u06cc\u0645 \u06a9\u0647 \u0646\u062d\u0648\u0647 \u0645\u0639\u0631\u0641\u06cc Type \u0648 Interface \u06a9\u0627\u0645\u0644\u0627\u064b \u0634\u0628\u06cc\u0647 \u0628\u0647\u200c\u0647\u0645 \u0627\u0633\u062a \u0648 \u0647\u0631 \u062f\u0648 \u067e\u0627\u0631\u0627\u0645\u062a\u0631\u0647\u0627\u06cc \u0645\u0634\u0627\u0628\u0647\u06cc \u062f\u0627\u0631\u0646\u062f. \u0628\u0631\u0627\u06cc \u0645\u062b\u0627\u0644\u060c \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u06cc \u0628\u0627 \u0627\u0633\u0645 Logger \u0627\u06cc\u062c\u0627\u062f \u06a9\u0631\u062f\u06cc\u0645 \u06a9\u0647 \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Clearable \u06af\u0633\u062a\u0631\u0634 \u06cc\u0627\u0641\u062a\u0647 \u0628\u0648\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface Clearable {\r\nclear: () =&gt; void;\r\n}\r\n\r\ninterface Logger extends Clearable {\r\nlog: (message: string) =&gt; void;\r\n}\r\n<\/pre>\n<p style=\"text-align: justify;\">\u0647\u0645\u06cc\u0646 \u06a9\u0627\u0631 \u0631\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Type \u0647\u0645 \u062a\u0639\u0631\u06cc\u0641 \u06a9\u0646\u06cc\u0645:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">type Clearable = {\r\nclear: () =&amp;gt; void;\r\n}\r\n\r\ntype Logger = Clearable &amp;amp; {\r\nlog: (message: string) =&amp;gt; void;\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u0647\u0645\u0627\u0646\u200c\u0637\u0648\u0631\u200c\u06a9\u0647 \u062f\u0631 \u0628\u062e\u0634 \u0642\u0628\u0644\u06cc \u062f\u06cc\u062f\u06cc\u0645\u060c \u0627\u0632 \u0646\u062d\u0648\u0647 \u062a\u0639\u0631\u06cc\u0641 Type \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u0645 \u0628\u0631\u0627\u06cc \u0645\u0639\u0631\u0641\u06cc \u0645\u062c\u0645\u0648\u0639\u0647\u200c\u0627\u06cc \u0627\u0632 \u0639\u0646\u0627\u0635\u0631 \u0627\u0632 \u062a\u0648\u0627\u0628\u0639 \u06af\u0631\u0641\u062a\u0647 \u062a\u0627 \u0627\u0634\u06cc\u0627\u06cc \u067e\u06cc\u0686\u06cc\u062f\u0647 \u0628\u0627 \u0645\u062c\u0645\u0648\u0639\u0647\u200c\u0627\u06cc \u0627\u0632 \u0639\u0646\u0627\u0635\u0631 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u0645. \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Type \u0646\u06cc\u0632 \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0648 Type\u0647\u0627 \u0631\u0627 \u0627\u0632 Type\u0647\u0627\u06cc \u062f\u06cc\u06af\u0631 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u0645 \u06af\u0633\u062a\u0631\u0634 \u062f\u0647\u06cc\u0645.<\/p>\n<p style=\"text-align: justify;\">\u0627\u0632\u0622\u0646\u200c\u062c\u0627\u200c\u06a9\u0647 \u0646\u062d\u0648\u0647 \u0645\u0639\u0631\u0641\u06cc Type \u0628\u0627 \u0646\u062d\u0648\u0647 \u0645\u0639\u0631\u0641\u06cc Interface \u0634\u0628\u06cc\u0647 \u0628\u0647\u200c\u0647\u0645 \u0627\u0633\u062a\u060c \u0628\u0627\u06cc\u062f \u0628\u0647 \u0642\u0627\u0628\u0644\u06cc\u062a\u200c\u0647\u0627\u06cc \u0648\u06cc\u0698\u0647\u200c\u0627\u06cc \u062a\u0648\u062c\u0647 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0628\u0647 \u0647\u0631\u06a9\u062f\u0627\u0645 \u0645\u0646\u062d\u0635\u0631 \u0647\u0633\u062a\u0646\u062f \u0648 \u062f\u0631 \u06a9\u062f \u062e\u0648\u062f\u062a\u0627\u0646 \u0631\u0648\u0634 \u062b\u0627\u0628\u062a\u06cc \u0631\u0627 \u062f\u0631 \u067e\u06cc\u0634 \u0628\u06af\u06cc\u0631\u06cc\u062f. \u0627\u0632 \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u06cc\u0646 \u062f\u0648 \u0628\u0631\u0627\u06cc \u0645\u0639\u0631\u0641\u06cc \u062a\u0627\u06cc\u067e \u062f\u0631 \u06a9\u062f\u0647\u0627\u06cc \u062e\u0648\u062f\u062a\u0627\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f \u0648 \u0627\u0632 \u062f\u06cc\u06af\u0631\u06cc \u0641\u0642\u0637 \u0648\u0642\u062a\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0645\u06cc\u200c\u062e\u0648\u0627\u0647\u06cc\u062f \u0627\u0632 \u0642\u0627\u0628\u0644\u06cc\u062a\u200c\u0647\u0627\u06cc \u0648\u06cc\u0698\u0647 \u0622\u0646 \u0628\u0647\u0631\u0647 \u0628\u0628\u0631\u06cc\u062f. \u0628\u0647\u200c\u0639\u0646\u0648\u0627\u0646 \u0645\u062b\u0627\u0644\u060c \u062f\u0631 \u0632\u0645\u0627\u0646 \u062a\u0639\u0631\u06cc\u0641 Type \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u0628\u0631\u062e\u06cc \u0642\u0627\u0628\u0644\u06cc\u062a\u200c\u0647\u0627\u06cc\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u062f\u0631 \u062a\u0639\u0631\u06cc\u0641 Interface \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0631\u062f. \u0628\u0631\u0627\u06cc \u0646\u0645\u0648\u0646\u0647\u060c \u062f\u0631 \u062a\u0639\u0631\u06cc\u0641 Type \u0642\u0627\u0628\u0644\u06cc\u062a\u200c\u0647\u0627\u06cc \u0632\u06cc\u0631 \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f:<\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"text-align: justify;\">Union types<\/li>\n<li style=\"text-align: justify;\">Mapped types<\/li>\n<li style=\"text-align: justify;\">Alias to primitive types<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\u06cc\u06a9\u06cc \u0627\u0632 \u0642\u0627\u0628\u0644\u06cc\u062a\u200c\u0647\u0627\u06cc\u06cc \u06a9\u0647 \u0641\u0642\u0637 \u062f\u0631 \u0632\u0645\u0627\u0646 \u062a\u0639\u0631\u06cc\u0641 Interface \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f\u060c \u0627\u0645\u06a9\u0627\u0646 \u062a\u0644\u0641\u06cc\u0642 \u062a\u0639\u0627\u0631\u06cc\u0641 \u0627\u0633\u062a \u06a9\u0647 \u062f\u0631 \u0628\u062e\u0634 \u0628\u0639\u062f\u06cc \u0628\u0647 \u0622\u0646 \u0645\u06cc\u200c\u067e\u0631\u062f\u0627\u0632\u06cc\u0645. \u0627\u06cc\u0646 \u0648\u06cc\u0698\u06af\u06cc \u062f\u0631 \u0645\u0648\u0627\u0642\u0639\u06cc \u06a9\u0647 \u0645\u06cc\u200c\u062e\u0648\u0627\u0647\u06cc\u062f \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f \u0648 \u0627\u0645\u06a9\u0627\u0646 \u062a\u0648\u0633\u0639\u0647 \u062a\u0627\u06cc\u067e\u200c\u0647\u0627\u06cc \u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0631\u0627 \u0628\u0647 \u06a9\u0627\u0631\u0628\u0631 \u0628\u062f\u0647\u06cc\u062f\u060c \u0628\u0647 \u0634\u0645\u0627 \u06a9\u0645\u06a9 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u062f\u0631 \u0632\u0645\u0627\u0646 \u0645\u0639\u0631\u0641\u06cc Type \u0627\u0646\u062c\u0627\u0645\u200c\u062f\u0627\u062f\u0646\u06cc \u0646\u06cc\u0633\u062a.<\/p>\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" data-loaded=\"true\" src=\"https:\/\/parspack.com\/blog\/wp-content\/uploads\/2022\/06\/typescript0.jpg\" class=\"wp-image-24843 size-full\" alt=\"\u0639\u0644\u0627\u0645\u062a \u0633\u0648\u0627\u0644 \u062f\u0631 \u062a\u0627\u06cc\u067e \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a\" title=\"\u062a\u0641\u0627\u0648\u062a Type \u0648\u00a0 Interface \"       width=\"750\" height=\"475\" srcset=\"https:\/\/parspack.com\/blog\/wp-content\/uploads\/2022\/06\/typescript0.jpg 750w, https:\/\/parspack.com\/blog\/wp-content\/uploads\/2022\/06\/typescript0-300x190.jpg 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><figcaption class=\"text-subtitle-5 text-gray-9 text-center mt-2\" >Type \u0648\u00a0 Interface \u0686\u0647 \u062a\u0641\u0627\u0648\u062a\u06cc \u0628\u0627 \u06cc\u06a9\u062f\u06cc\u06af\u0631 \u062f\u0627\u0631\u0646\u062f\u061f<\/figcaption><\/figure>\n<h2 style=\"text-align: justify;\"><span style=\"color: #3366ff;\">\u062a\u0644\u0641\u06cc\u0642 \u062a\u0639\u0627\u0631\u06cc\u0641<\/span><\/h2>\n<p style=\"text-align: justify;\">TypeScript \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u0686\u0646\u062f\u06cc\u0646 \u062a\u0639\u0631\u06cc\u0641 \u0645\u062a\u0641\u0627\u0648\u062a \u0631\u0627 \u0628\u0627\u0647\u0645 \u0627\u062f\u063a\u0627\u0645 \u06a9\u0646\u062f. \u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0686\u0646\u062f\u06cc\u0646 \u062a\u0639\u0631\u06cc\u0641 \u0645\u062a\u0641\u0627\u0648\u062a \u0628\u0631\u0627\u06cc \u06cc\u06a9 \u0633\u0627\u062e\u062a\u0627\u0631 \u062f\u0627\u062f\u0647 \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f \u0648 \u0633\u067e\u0633 \u062f\u0631 \u0632\u0645\u0627\u0646 \u06a9\u0627\u0645\u067e\u0627\u06cc\u0644\u060c \u0622\u0646\u200c\u0647\u0627 \u0631\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u06a9\u0627\u0645\u067e\u0627\u06cc\u0644\u0631 \u062a\u0627\u06cc\u067e\u200c\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0628\u0627\u0647\u0645 \u0627\u062f\u063a\u0627\u0645 \u06a9\u0646\u06cc\u062f\u061b \u0628\u0647\u200c\u06af\u0648\u0646\u0647\u200c\u0627\u06cc \u06a9\u0647 \u0645\u0627\u0646\u0646\u062f Type \u0648\u0627\u062d\u062f \u0639\u0645\u0644 \u06a9\u0646\u0646\u062f. \u062f\u0631 \u0627\u06cc\u0646 \u0628\u062e\u0634\u060c \u0628\u0627 \u0646\u062d\u0648\u0647 \u06a9\u0627\u0631 \u0627\u06cc\u0646 \u0648\u06cc\u0698\u06af\u06cc \u0648 \u06a9\u0627\u0631\u0628\u0631\u062f \u0622\u0646 \u062f\u0631 \u0632\u0645\u0627\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627 \u0622\u0634\u0646\u0627 \u062e\u0648\u0627\u0647\u06cc\u0645 \u0634\u062f.<\/p>\n<p style=\"text-align: justify;\">Interface\u0647\u0627\u06cc \u062a\u0627\u06cc\u067e\u200c\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0631\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u062f\u0648\u0628\u0627\u0631\u0647 \u0628\u0627\u0632\u06af\u0634\u0627\u06cc\u06cc \u06a9\u0646\u06cc\u062f \u0648 \u0686\u0646\u062f\u06cc\u0646 \u062a\u0639\u0631\u06cc\u0641 \u0645\u062a\u0641\u0627\u0648\u062a \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0648\u0627\u062d\u062f \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f. \u0633\u067e\u0633\u060c \u06a9\u0627\u0645\u067e\u0627\u06cc\u0644\u0631 \u062a\u0639\u0627\u0631\u06cc\u0641 \u0645\u0648\u062c\u0648\u062f \u0631\u0627 \u0628\u0627\u0647\u0645 \u0627\u062f\u063a\u0627\u0645 \u062e\u0648\u0627\u0647\u062f \u06a9\u0631\u062f. \u0648\u0642\u062a\u06cc \u0645\u06cc\u200c\u062e\u0648\u0627\u0647\u06cc\u062f \u0641\u06cc\u0644\u062f\u0647\u0627\u06cc \u062c\u062f\u06cc\u062f\u06cc \u0631\u0627 \u0628\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0642\u0628\u0644\u06cc \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f\u060c \u0627\u06cc\u0646 \u0642\u0627\u0628\u0644\u06cc\u062a \u0628\u0647 \u0634\u0645\u0627 \u06a9\u0645\u06a9 \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/p>\n<p style=\"text-align: justify;\">\u0628\u0631\u0627\u06cc \u0645\u062b\u0627\u0644\u060c \u062a\u0635\u0648\u0631 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u06cc \u0628\u0627 \u0627\u0633\u0645 DatabaseOptions \u0628\u0647\u200c\u0634\u06a9\u0644 \u0632\u06cc\u0631 \u062f\u0627\u0631\u06cc\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface DatabaseOptions {\r\nhost: string;\r\nport: number;\r\nuser: string;\r\npassword: string;\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u0627\u06cc\u0646 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0628\u0631\u0627\u06cc \u0627\u0631\u0633\u0627\u0644 \u06af\u0632\u06cc\u0646\u0647\u200c\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 \u0628\u0647 \u062f\u06cc\u062a\u0627\u0628\u06cc\u0633 \u06a9\u0627\u0631\u0628\u0631\u062f \u062f\u0627\u0631\u062f. \u06a9\u0645\u06cc \u0628\u0639\u062f\u060c \u062f\u0648\u0628\u0627\u0631\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u06cc \u0628\u0627 \u0647\u0645\u06cc\u0646 \u0646\u0627\u0645 \u0645\u0639\u0631\u0641\u06cc \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0641\u06cc\u0644\u062f\u06cc \u0645\u062a\u0646\u06cc \u0627\u0632 \u0646\u0648\u0639 String \u0628\u0627 \u0646\u0627\u0645 dsnUrl \u062f\u0627\u0631\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface DatabaseOptions {\r\ndsnUrl: string;\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u06a9\u0627\u0645\u067e\u0627\u06cc\u0644\u0631 TypeScript \u0634\u0631\u0648\u0639 \u0628\u0647 \u062e\u0648\u0627\u0646\u062f\u0646 \u06a9\u062f \u0634\u0645\u0627 \u0645\u06cc\u200c\u06a9\u0646\u062f\u060c \u062a\u0645\u0627\u0645\u06cc \u062a\u0639\u0627\u0631\u06cc\u0641 DatabaseOptions \u0631\u0627 \u062f\u0631 \u062a\u0639\u0631\u06cc\u0641\u06cc \u062c\u0627\u0645\u0639 \u0648 \u0648\u0627\u062d\u062f \u062a\u0644\u0641\u06cc\u0642 \u062e\u0648\u0627\u0647\u062f \u06a9\u0631\u062f. \u0627\u0632 \u0646\u06af\u0627\u0647 \u06a9\u0627\u0645\u067e\u0627\u06cc\u0644\u0631 TypeScript\u060c \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 DataOptions \u0628\u0647\u200c\u0634\u06a9\u0644 \u0632\u06cc\u0631 \u0627\u0633\u062a:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">interface DatabaseOptions {\r\nhost: string;\r\nport: number;\r\nuser: string;\r\npassword: string;\r\ndsnUrl: string;\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u062f\u0631\u062d\u0627\u0644\u200c\u062d\u0627\u0636\u0631\u060c \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062d\u0627\u0648\u06cc \u062a\u0645\u0627\u0645\u06cc \u0641\u06cc\u0644\u062f\u0647\u0627\u06cc\u06cc \u0627\u0633\u062a \u06a9\u0647 \u062f\u0631 \u0645\u0631\u062d\u0644\u0647 \u0627\u0648\u0644 \u062a\u0639\u0631\u06cc\u0641 \u06a9\u0631\u062f\u06cc\u062f \u0648 \u0647\u0645\u0631\u0627\u0647 \u0628\u0627 \u0641\u06cc\u0644\u062f dsnUrl \u0627\u0633\u062a \u06a9\u0647 \u062c\u062f\u0627\u06af\u0627\u0646\u0647 \u0645\u0639\u0631\u0641\u06cc \u06a9\u0631\u062f\u06cc\u062f. \u0627\u06a9\u0646\u0648\u0646 \u0647\u0631 \u062f\u0648 \u062a\u0639\u0631\u06cc\u0641 \u0628\u0627\u0647\u0645 \u062a\u0644\u0641\u06cc\u0642 \u0634\u062f\u0647\u200c\u0627\u0646\u062f.<\/p>\n<h3 style=\"text-align: justify;\"><span style=\"color: #0000ff;\">Module Augmentation<\/span><\/h3>\n<p style=\"text-align: justify;\">\u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u0645\u06cc\u200c\u062e\u0648\u0627\u0647\u06cc\u062f \u0645\u0634\u062e\u0635\u0647\u200c\u0647\u0627\u06cc \u062c\u062f\u06cc\u062f\u06cc \u0628\u0647 \u0645\u0627\u0698\u0648\u0644\u200c\u0647\u0627\u06cc \u0641\u0639\u0644\u06cc \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f\u060c \u062a\u0644\u0641\u06cc\u0642 \u062a\u0639\u0627\u0631\u06cc\u0641 \u0628\u0647 \u0634\u0645\u0627 \u06a9\u0645\u06a9 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u06cc\u06a9\u06cc \u0627\u0632 \u06a9\u0627\u0631\u0628\u0631\u062f\u0647\u0627\u06cc Module Augmentation \u0632\u0645\u0627\u0646\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0645\u06cc\u200c\u062e\u0648\u0627\u0647\u06cc\u062f \u0641\u06cc\u0644\u062f\u0647\u0627\u06cc \u0628\u06cc\u0634\u062a\u0631\u06cc \u0631\u0627 \u0628\u0647 \u0633\u0627\u062e\u062a\u0627\u0631 \u062f\u0627\u062f\u0647 \u0627\u06cc\u062c\u0627\u062f\u200c\u0634\u062f\u0647 \u0628\u0647\u200c\u0648\u0627\u0633\u0637\u0647 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f. \u0627\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u062f\u0631 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 Express \u0646\u0648\u062f\u200c\u062c\u06cc\u200c\u0627\u0633 \u0645\u062a\u062f\u0627\u0648\u0644 \u0627\u0633\u062a \u0648 \u0627\u0632 \u0622\u0646 \u0628\u0631\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u0633\u0631\u0648\u0631\u0647\u0627\u06cc HTTP \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<p style=\"text-align: justify;\">\u0648\u0642\u062a\u06cc \u0628\u0627 Express \u06a9\u0627\u0631 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f\u060c \u06cc\u06a9 \u0639\u0646\u0635\u0631 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0648 \u06cc\u06a9 \u0639\u0646\u0635\u0631 \u067e\u0627\u0633\u062e \u0628\u0647 \u0647\u0646\u062f\u0644\u0631\u0647\u0627\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0634\u0645\u0627 \u0627\u062e\u062a\u0635\u0627\u0635 \u062e\u0648\u0627\u0647\u0646\u062f \u06cc\u0627\u0641\u062a. \u0639\u0646\u0635\u0631 Request \u0645\u0639\u0645\u0648\u0644\u0627\u064b \u0628\u0631\u0627\u06cc \u0646\u06af\u0647\u200c\u062f\u0627\u0631\u06cc \u062f\u0627\u062f\u0647\u200c\u0647\u0627\u06cc \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u06cc \u062e\u0627\u0635 \u06a9\u0627\u0631\u0628\u0631\u062f \u062f\u0627\u0631\u062f. \u0628\u0631\u0627\u06cc \u0645\u062b\u0627\u0644\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u0622\u0646 \u0628\u0631\u0627\u06cc \u0646\u06af\u0647\u200c\u062f\u0627\u0631\u06cc \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u06a9\u0627\u0631\u0628\u0631\u06cc\u200c \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP \u0631\u0627 \u062f\u0627\u062f\u0647 \u0627\u0633\u062a:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const myRoute = (req: Request, res: Response) =&gt; {\r\nres.json({ user: req.user });\r\n}<\/pre>\n<p style=\"text-align: justify;\">\u062f\u0631 \u0627\u06cc\u0646\u200c\u062c\u0627\u060c \u0647\u0646\u062f\u0644\u0631 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0641\u0627\u06cc\u0644 json \u062d\u0627\u0648\u06cc \u0641\u06cc\u0644\u062f User \u0631\u0627 \u0628\u0647 \u06a9\u0644\u0627\u06cc\u0646\u062a \u0628\u0631\u06af\u0634\u062a \u0645\u06cc\u200c\u062f\u0647\u062f. \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u06a9\u0627\u0631\u0628\u0631\u06cc \u06a9\u0647 \u0644\u0627\u06af\u06cc\u0646 \u06a9\u0631\u062f\u0647\u060c \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0645\u06cc\u0627\u0646\u200c\u0627\u0641\u0632\u0627\u0631 Express\u060c \u06cc\u0639\u0646\u06cc \u0645\u0633\u0626\u0648\u0644 \u0627\u062d\u0631\u0627\u0632 \u0647\u0648\u06cc\u062a \u06a9\u0627\u0631\u0628\u0631\u060c \u0628\u0647 \u0639\u0646\u0635\u0631 Request \u062f\u0631 \u0642\u0633\u0645\u062a \u062f\u06cc\u06af\u0631\u06cc \u0627\u0632 \u06a9\u062f \u0627\u0631\u0633\u0627\u0644 \u0645\u06cc\u200c\u0634\u0648\u062f.<\/p>\n<p style=\"text-align: justify;\">\u062a\u0639\u0631\u06cc\u0641 Type \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Request \u0628\u0647\u200c\u062a\u0646\u0647\u0627\u06cc\u06cc \u0641\u06cc\u0644\u062f User \u0646\u062f\u0627\u0631\u062f\u061b \u0628\u0647\u200c\u0647\u0645\u06cc\u0646\u200c\u062f\u0644\u06cc\u0644\u060c \u0642\u0637\u0639\u0647 \u06a9\u062f \u0628\u0627\u0644\u0627 \u0628\u0627\u0639\u062b \u0628\u0631\u0648\u0632 \u0627\u0631\u0648\u0631 \u06f2\u06f3\u06f3\u06f9 \u062e\u0648\u0627\u0647\u062f \u0634\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Property 'user' does not exist on type 'Request'. (2339)<\/pre>\n<p style=\"text-align: justify;\">\u0628\u0647\u200c\u0645\u0646\u0638\u0648\u0631 \u0631\u0641\u0639 \u0627\u06cc\u0646 \u0645\u0634\u06a9\u0644\u060c \u0628\u0627\u06cc\u062f Module Augmentation \u0628\u0631\u0627\u06cc \u067e\u06a9\u06cc\u062c Express \u0627\u06cc\u062c\u0627\u062f \u0648 \u0627\u0632 \u0627\u0645\u06a9\u0627\u0646 \u062a\u0644\u0641\u06cc\u0642 \u062a\u0639\u0627\u0631\u06cc\u0641 \u0628\u0631\u0627\u06cc \u0627\u0636\u0627\u0641\u0647\u200c\u06a9\u0631\u062f\u0646 \u0645\u0634\u062e\u0635\u0647\u200c\u0647\u0627\u06cc \u062c\u062f\u06cc\u062f \u0628\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Request \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<p style=\"text-align: justify;\">\u062f\u0631\u0635\u0648\u0631\u062a\u06cc\u200c\u06a9\u0647 \u062a\u0627\u06cc\u067e \u0639\u0646\u0635\u0631 Request \u0631\u0627 \u062f\u0631 \u062a\u0639\u0631\u06cc\u0641 \u062a\u0627\u06cc\u067e Express \u0628\u0631\u0631\u0633\u06cc \u06a9\u0646\u06cc\u062f\u060c \u0645\u062a\u0648\u062c\u0647 \u062e\u0648\u0627\u0647\u06cc\u062f \u0634\u062f \u06a9\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u06cc \u0628\u0647 Global Namespace \u0628\u0647 \u0646\u0627\u0645 Express \u0627\u0636\u0627\u0641\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">declare global {\r\n    namespace Express {\r\n        \/\/ These open interfaces may be extended in an application-specific manner via declaration merging.\r\n        \/\/ See for example method-override.d.ts (https:\/\/github.com\/DefinitelyTyped\/DefinitelyTyped\/blob\/master\/types\/method-override\/index.d.ts)\r\n        interface Request {}\r\n        interface Response {}\r\n        interface Application {}\r\n    }\r\n}\r\n<\/pre>\n<p style=\"text-align: justify;\">\u0628\u0631\u0627\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Module Augmentation \u0628\u0647\u200c\u0645\u0646\u0638\u0648\u0631 \u0627\u0636\u0627\u0641\u0647\u200c\u06a9\u0631\u062f\u0646 \u0645\u0634\u062e\u0635\u0647 \u062c\u062f\u06cc\u062f \u0628\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Request\u060c \u0628\u0627\u06cc\u062f \u0647\u0645\u0627\u0646 \u0633\u0627\u062e\u062a\u0627\u0631 \u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u0641\u0627\u06cc\u0644 \u0645\u062d\u0644\u06cc \u062a\u0639\u0631\u06cc\u0641 Type \u0631\u0627 \u0631\u0639\u0627\u06cc\u062a \u06a9\u0646\u06cc\u062f. \u0628\u0631\u0627\u06cc \u0645\u062b\u0627\u0644\u060c \u062a\u0635\u0648\u0631 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0641\u0627\u06cc\u0644\u06cc \u0628\u0627 \u0646\u0627\u0645 Express.d.ts \u0628\u0647\u200c\u0634\u06a9\u0644 \u0632\u06cc\u0631 \u0627\u06cc\u062c\u0627\u062f \u0648 \u0633\u067e\u0633\u060c \u0622\u0646 \u0631\u0627 \u0628\u0647 \u06af\u0632\u06cc\u0646\u0647 Types \u0641\u0627\u06cc\u0644 tsconfig.json \u0627\u0636\u0627\u0641\u0647 \u06a9\u0631\u062f\u0647\u200c\u0627\u06cc\u062f:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import 'express';\r\n\r\ndeclare global {\r\n  namespace Express {\r\n    interface Request {\r\n      user: {\r\n        name: string;\r\n      }\r\n    }\r\n  }\r\n}\r\n<\/pre>\n<p style=\"text-align: justify;\">\u0627\u0632 \u0646\u06af\u0627\u0647 \u06a9\u0627\u0645\u067e\u0627\u06cc\u0644\u0631 TypeScript\u060c \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 Request \u0645\u0634\u062e\u0635\u0647 User \u062f\u0627\u0631\u062f \u06a9\u0647 \u062a\u0627\u06cc\u067e \u0622\u0646 \u0631\u0648\u06cc \u0639\u0646\u0635\u0631\u06cc \u0628\u0627 \u0627\u0633\u0645 Name \u0648 \u0627\u0632 \u0646\u0648\u0639 String \u062a\u0639\u0631\u06cc\u0641 \u0634\u062f\u0647 \u0627\u0633\u062a. \u0627\u06cc\u0646 \u0645\u0648\u0636\u0648\u0639 \u0628\u062f\u06cc\u0646\u200c\u062f\u0644\u06cc\u0644 \u0627\u0633\u062a \u06a9\u0647 \u062a\u0645\u0627\u0645\u06cc \u062a\u0639\u0627\u0631\u06cc\u0641 \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u0628\u0627\u200c\u0647\u0645 \u062a\u0644\u0641\u06cc\u0642 \u0634\u062f\u0647\u200c\u0627\u0646\u062f.<\/p>\n<p style=\"text-align: justify;\">\u062a\u0635\u0648\u0631 \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u0642\u0635\u062f \u062f\u0627\u0631\u06cc\u062f \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u0648 \u0627\u06cc\u0646 \u0627\u0645\u06a9\u0627\u0646 \u0631\u0627 \u0628\u0647 \u06a9\u0627\u0631\u0628\u0631\u0627\u0646 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0628\u062f\u0647\u06cc\u062f \u06a9\u0647 Type\u0647\u0627\u06cc \u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u0622\u0646 \u0631\u0627 \u06af\u0633\u062a\u0631\u0634 \u062f\u0647\u0646\u062f. \u062f\u0631 \u0627\u06cc\u0646 \u0646\u0645\u0648\u0646\u0647\u060c \u0627\u0632 \u0634\u0645\u0627 \u062e\u0648\u0627\u0633\u062a\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f \u0627\u0632 Interface\u0647\u0627\u06cc \u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u062e\u0631\u0648\u062c\u06cc \u0628\u06af\u06cc\u0631\u06cc\u062f\u061b \u0632\u06cc\u0631\u0627 \u062a\u0639\u0627\u0631\u06cc\u0641 \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 Type\u0647\u0627\u06cc \u0646\u0631\u0645\u0627\u0644 \u0627\u0632 Module Augmentation \u067e\u0634\u062a\u06cc\u0628\u0627\u0646\u06cc \u0646\u0645\u06cc\u200c\u06a9\u0646\u0646\u062f.<\/p>\n<h2 style=\"text-align: justify;\"><span style=\"color: #3366ff;\">\u0633\u062e\u0646 \u0646\u0647\u0627\u06cc\u06cc<\/span><\/h2>\n<p style=\"text-align: justify;\">\u0622\u0645\u0648\u0632\u0634 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062f\u0631 Typescript\u061b \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0637\u0644\u0628 \u0622\u0645\u0648\u0632\u0634\u06cc\u060c \u0686\u0646\u062f\u06cc\u0646 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062f\u0631 Typescript \u0627\u06cc\u062c\u0627\u062f \u06a9\u0631\u062f\u06cc\u0645 \u06a9\u0647 \u0646\u0645\u0627\u06cc\u0646\u062f\u0647 \u0627\u0646\u0648\u0627\u0639 \u0645\u062e\u062a\u0644\u0641\u06cc \u0627\u0632 \u0633\u0627\u062e\u062a\u0627\u0631\u0647\u0627\u06cc \u062f\u0627\u062f\u0647 \u0647\u0633\u062a\u0646\u062f \u0648 \u06cc\u0627\u062f \u06af\u0631\u0641\u062a\u06cc\u0645 \u06a9\u0647 \u0686\u06af\u0648\u0646\u0647 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u0645 \u0627\u0632 \u0686\u0646\u062f\u06cc\u0646 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062f\u0631\u06a9\u0646\u0627\u0631 \u06cc\u06a9\u062f\u06cc\u06af\u0631 \u0628\u0647\u0631\u0647 \u0628\u0628\u0631\u06cc\u0645 \u062a\u0627 Type\u0647\u0627\u06cc \u0642\u062f\u0631\u062a\u0645\u0646\u062f\u06cc \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u0645. \u0647\u0645\u0686\u0646\u06cc\u0646\u060c \u0628\u0627 \u062a\u0641\u0627\u0648\u062a \u0628\u06cc\u0646 \u0646\u062d\u0648\u0647 \u062a\u0639\u0631\u06cc\u0641 Type \u0648 Interface \u0622\u0634\u0646\u0627 \u0634\u062f\u06cc\u0645. \u062d\u0627\u0644\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u0645 \u0628\u0631\u0627\u06cc \u0633\u0627\u062e\u062a\u0627\u0631\u0647\u0627\u06cc \u062f\u0627\u062f\u0647 \u0645\u0648\u062c\u0648\u062f \u062f\u0631 \u06a9\u062f\u0647\u0627\u06cc \u062e\u0648\u062f\u0645\u0627\u0646 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641\u06cc \u0637\u0631\u0627\u062d\u06cc \u06a9\u0646\u06cc\u0645 \u0648 \u0627\u0632 \u0622\u0646\u200c\u0647\u0627 \u0646\u0647\u0627\u06cc\u062a \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0631\u0627 \u0628\u0628\u0631\u06cc\u0645.<\/p>\n<h2 style=\"text-align: justify;\"><span style=\"color: #3366ff;\">\u0633\u0624\u0627\u0644\u0627\u062a \u0645\u062a\u062f\u0627\u0648\u0644<\/span><\/h2>\n<h3 style=\"text-align: justify;\"><span style=\"color: #0000ff;\">\u06f1. TypeScript \u0686\u06cc\u0633\u062a\u061f<\/span><\/h3>\n<p style=\"text-align: justify;\">TypeScript \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u0641\u0632\u0648\u0646\u0647\u200c\u0647\u0627\u06cc \u062c\u0627\u0648\u0627\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0627\u0633\u062a \u06a9\u0647 \u0627\u0632 \u0645\u062d\u06cc\u0637 \u0627\u062c\u0631\u0627\u06cc \u062c\u0627\u0648\u0627\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0628\u0647\u200c\u0647\u0645\u0631\u0627\u0647 Type Checker \u0632\u0645\u0627\u0646 \u06a9\u0627\u0645\u067e\u0627\u06cc\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/p>\n<h3 style=\"text-align: justify;\"><span style=\"color: #0000ff;\">\u06f2. \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627\u06cc \u062a\u0627\u06cc\u067e\u200c\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0686\u0647 \u06a9\u0627\u0631\u0628\u0631\u062f\u0647\u0627\u06cc\u06cc \u062f\u0627\u0631\u0646\u062f\u061f<\/span><\/h3>\n<p style=\"text-align: justify;\">\u062f\u0631 TypeScript\u060c \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627 \u062f\u0648 \u06a9\u0627\u0631\u0628\u0631\u062f \u0645\u062e\u062a\u0644\u0641 \u062f\u0627\u0631\u062f: \u06f1. \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0622\u0646\u200c\u0647\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0642\u0631\u0627\u0631\u062f\u0627\u062f\u06cc \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u062a\u0645\u0627\u0645\u06cc \u06a9\u0644\u0627\u0633\u200c\u0647\u0627 \u0628\u0627\u06cc\u062f \u0627\u0632 \u0622\u0646\u200c \u062a\u0628\u0639\u06cc\u062a \u06a9\u0646\u0646\u062f\u061b \u06f2. \u062f\u0631 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc \u062e\u0648\u062f\u062a\u0627\u0646 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 Type\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<h3 style=\"text-align: justify;\"><span style=\"color: #0000ff;\">\u06f3. Interface\u0647\u0627 \u062f\u0631 \u062a\u0627\u06cc\u067e\u200c\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0686\u0647 \u06a9\u0627\u0631\u0628\u0631\u062f\u06cc \u062f\u0627\u0631\u0646\u062f\u061f<\/span><\/h3>\n<p style=\"text-align: justify;\">\u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633 \u062f\u0631 Typescript\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u0633\u0627\u062e\u062a\u0627\u0631\u0647\u0627\u06cc Type \u062f\u0631\u0628\u0631\u0627\u0628\u0631 \u062a\u063a\u06cc\u06cc\u0631 \u0645\u062d\u0627\u0641\u0638\u062a \u0648 \u0647\u0645\u200c\u0632\u0645\u0627\u0646 \u0628\u0631\u0627\u06cc \u0622\u0646\u200c\u0647\u0627 \u0645\u0633\u062a\u0646\u062f\u0633\u0627\u0632\u06cc \u06a9\u0646\u06cc\u062f.<\/p>\n<p><script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [{\n    \"@type\": \"Question\",\n    \"name\": \"TypeScript \u0686\u06cc\u0633\u062a\u061f\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"TypeScript \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u0641\u0632\u0648\u0646\u0647\u200c\u0647\u0627\u06cc \u062c\u0627\u0648\u0627\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0627\u0633\u062a \u06a9\u0647 \u0627\u0632 \u0645\u062d\u06cc\u0637 \u0627\u062c\u0631\u0627\u06cc \u062c\u0627\u0648\u0627\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0628\u0647\u200c\u0647\u0645\u0631\u0627\u0647 Type Checker \u0632\u0645\u0627\u0646 \u06a9\u0627\u0645\u067e\u0627\u06cc\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"\u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627\u06cc \u062a\u0627\u06cc\u067e\u200c\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0686\u0647 \u06a9\u0627\u0631\u0628\u0631\u062f\u0647\u0627\u06cc\u06cc \u062f\u0627\u0631\u0646\u062f\u061f\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"\u062f\u0631 TypeScript\u060c \u0627\u06cc\u0646\u062a\u0631\u0641\u06cc\u0633\u200c\u0647\u0627 \u062f\u0648 \u06a9\u0627\u0631\u0628\u0631\u062f \u0645\u062e\u062a\u0644\u0641 \u062f\u0627\u0631\u062f: \u06f1. \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0622\u0646\u200c\u0647\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0642\u0631\u0627\u0631\u062f\u0627\u062f\u06cc \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u06a9\u0647 \u062a\u0645\u0627\u0645\u06cc \u06a9\u0644\u0627\u0633\u200c\u0647\u0627 \u0628\u0627\u06cc\u062f \u0627\u0632 \u0622\u0646\u200c \u062a\u0628\u0639\u06cc\u062a \u06a9\u0646\u0646\u062f\u061b \u06f2. \u062f\u0631 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc \u062e\u0648\u062f\u062a\u0627\u0646 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 Type\u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"Interface\u0647\u0627 \u062f\u0631 \u062a\u0627\u06cc\u067e\u200c\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0686\u0647 \u06a9\u0627\u0631\u0628\u0631\u062f\u06cc \u062f\u0627\u0631\u0646\u062f\u061f\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"\u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 Interface\u060c \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u0633\u0627\u062e\u062a\u0627\u0631\u0647\u0627\u06cc Type \u062f\u0631\u0628\u0631\u0627\u0628\u0631 \u062a\u063a\u06cc\u06cc\u0631 \u0645\u062d\u0627\u0641\u0638\u062a \u0648 \u0647\u0645\u200c\u0632\u0645\u0627\u0646 \u0628\u0631\u0627\u06cc \u0622\u0646\u200c\u0647\u0627 \u0645\u0633\u062a\u0646\u062f\u0633\u0627\u0632\u06cc \u06a9\u0646\u06cc\u062f.\"\n    }\n  }]\n}\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0628\u0631\u0627\u06cc \u067e\u0627\u0633\u062e \u0628\u0647 \u0633\u0648\u0627\u0644\u0627\u062a Interface \u0648 Type \u0686\u06cc\u0633\u062a\u0646\u062f \u0648 \u0686\u0647 \u062a\u0641\u0627\u0648\u062a\u06cc \u0628\u0627 \u0647\u0645 \u062f\u0627\u0631\u0646\u062f\u061f \u0648 \u0686\u0637\u0648\u0631 \u0627\u0632 Interface \u062f\u0631 TypeScript \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u0645\u061f \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0631\u0627 \u0627\u0632 \u062f\u0633\u062a \u0646\u062f\u0647\u06cc\u062f.<\/p>\n","protected":false},"author":71,"featured_media":35255,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[199],"tags":[],"class_list":["post-24820","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cms"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/parspack.com\/blog\/wp-json\/wp\/v2\/posts\/24820","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/parspack.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/parspack.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/parspack.com\/blog\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/parspack.com\/blog\/wp-json\/wp\/v2\/comments?post=24820"}],"version-history":[{"count":3,"href":"https:\/\/parspack.com\/blog\/wp-json\/wp\/v2\/posts\/24820\/revisions"}],"predecessor-version":[{"id":50221,"href":"https:\/\/parspack.com\/blog\/wp-json\/wp\/v2\/posts\/24820\/revisions\/50221"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/parspack.com\/blog\/wp-json\/wp\/v2\/media\/35255"}],"wp:attachment":[{"href":"https:\/\/parspack.com\/blog\/wp-json\/wp\/v2\/media?parent=24820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/parspack.com\/blog\/wp-json\/wp\/v2\/categories?post=24820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/parspack.com\/blog\/wp-json\/wp\/v2\/tags?post=24820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}