{"id":17089,"date":"2026-08-04T21:29:25","date_gmt":"2026-08-04T12:29:25","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=17089"},"modified":"2026-08-04T21:29:25","modified_gmt":"2026-08-04T12:29:25","slug":"typescript-%ec%9c%a0%eb%8b%88%ec%98%a8-%ed%83%80%ec%9e%85%ec%97%90%ec%84%9c-%ed%83%80%ec%9e%85-%ec%9c%b5%ed%95%a9%ec%9d%84-%eb%b0%a9%ec%a7%80%ed%95%98%eb%8a%94-%eb%b0%a9%eb%b2%95","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=17089","title":{"rendered":"TypeScript, \uc720\ub2c8\uc628 \ud0c0\uc785\uc5d0\uc11c \ud0c0\uc785 \uc735\ud569\uc744 \ubc29\uc9c0\ud558\ub294 \ubc29\ubc95"},"content":{"rendered":"<p>\ud0c0\uc785 \uc735\ud569\uc774\ub780, \uc608\ub97c\ub4e4\uc5b4 <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">'red' | string<\/code> \uacfc \uac19\uc740 \ud0c0\uc785\uc758 \uacbd\uc6b0 <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">'red'<\/code>\ub294 <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">string<\/code>\uc5d0 \ud3ec\ud568\ub418\ub294 \ud0c0\uc785\uc774\ubbc0\ub85c \uacb0\uad6d <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">string<\/code> \ud558\ub098\ub85c \uc735\ud569\ub418\ub294 \uac83\uc744 \uc758\ubbf8\ud569\ub2c8\ub2e4. \uc774\ub7f0 \uc735\ud569\uc744 \ub9c9\uae30 \uc704\ud55c \ubc29\ubc95\uc740 <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">string<\/code> \ub300\uc2e0 <code class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">string & {}<\/code>\uc744 \uc0ac\uc6a9\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. \uad00\ub828\ub41c \uc608\uc81c \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"typescript\">\r\n\/\/ string & {} \ub97c \uad50\ucc28(Intersection)\uc2dc\ud0a4\uba74 \ud0c0\uc785 \uc735\ud569(Type Flattening)\uc744 \ubc29\uc9c0\ud569\ub2c8\ub2e4.\r\ntype Color = 'red' | 'blue' | 'green' | (string & {});\r\n\r\nfunction setColor(color: Color) {\r\n  console.log(`Setting color to ${color}`);\r\n}\r\n\r\nsetColor(\"red\")\r\n\/\/ \ud83d\udca1 \ud6a8\uacfc:\r\n\/\/ 1. setColor('') \uc785\ub825 \uc2dc 'red', 'blue', 'green' \ud31d\uc5c5 \uc790\ub3d9\uc644\uc131\uc774 \ub739\ub2c8\ub2e4.\r\n\/\/ 2. setColor('#123456') \ucc98\ub7fc \uc784\uc758\uc758 \ubb38\uc790\uc5f4\uc744 \ub123\uc5b4\ub3c4 \ud0c0\uc785 \uc5d0\ub7ec\uac00 \ubc1c\uc0dd\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\ud0c0\uc785 \uc735\ud569\uc774\ub780, \uc608\ub97c\ub4e4\uc5b4 &#8216;red&#8217; | string \uacfc \uac19\uc740 \ud0c0\uc785\uc758 \uacbd\uc6b0 &#8216;red&#8217;\ub294 string\uc5d0 \ud3ec\ud568\ub418\ub294 \ud0c0\uc785\uc774\ubbc0\ub85c \uacb0\uad6d string \ud558\ub098\ub85c \uc735\ud569\ub418\ub294 \uac83\uc744 \uc758\ubbf8\ud569\ub2c8\ub2e4. \uc774\ub7f0 \uc735\ud569\uc744 \ub9c9\uae30 \uc704\ud55c \ubc29\ubc95\uc740 string \ub300\uc2e0 string &#038; {}\uc744 \uc0ac\uc6a9\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. \uad00\ub828\ub41c \uc608\uc81c \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4. \/\/ string &#038; {} \ub97c \uad50\ucc28(Intersection)\uc2dc\ud0a4\uba74 \ud0c0\uc785 \uc735\ud569(Type Flattening)\uc744 \ubc29\uc9c0\ud569\ub2c8\ub2e4. type Color = &#8216;red&#8217; | &#8216;blue&#8217; | &#8216;green&#8217; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=17089\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;TypeScript, \uc720\ub2c8\uc628 \ud0c0\uc785\uc5d0\uc11c \ud0c0\uc785 \uc735\ud569\uc744 \ubc29\uc9c0\ud558\ub294 \ubc29\ubc95&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-17089","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/17089","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17089"}],"version-history":[{"count":1,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/17089\/revisions"}],"predecessor-version":[{"id":17090,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/17089\/revisions\/17090"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17089"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}