@@ -223,15 +223,15 @@ function networkStatus(state: NetworkState): string {
223223}
224224```
225225
226- # Intersection Types
226+ # κ΅μ°¨ νμ
( Intersection Types)
227227
228- Intersection types are closely related to union types, but they are used very differently .
229- An intersection type combines multiple types into one .
230- This allows you to add together existing types to get a single type that has all the features you need .
231- For example , ` Person & Serializable & Loggable ` is a type which is all of ` Person ` _ and _ ` Serializable ` _ and _ ` Loggable ` .
232- That means an object of this type will have all members of all three types .
228+ κ΅μ°¨ νμ
μ μ λμΈ νμ
κ³Ό λ°μ ν κ΄λ ¨μ΄ μμ§λ§, μ¬μ© λ°©λ²μ λ§€μ° λ€λ¦
λλ€ .
229+ κ΅μ°¨ νμ
μ μ¬λ¬ νμ
μ νλλ‘ κ²°ν©ν©λλ€ .
230+ κΈ°μ‘΄ νμ
μ ν©μ³ νμν κΈ°λ₯μ λͺ¨λ κ°μ§ λ¨μΌ νμ
μ μ»μ μ μμ΅λλ€ .
231+ μλ₯Ό λ€μ΄ , ` Person & Serializable & Loggable ` μ ` Person ` _ κ³Ό _ ` Serializable ` _ κ·Έλ¦¬κ³ _ ` Loggable ` μ
λλ€ .
232+ μ¦, μ΄ νμ
μ κ°μ²΄λ μΈ κ°μ§ νμ
μ λͺ¨λ λ©€λ²λ₯Ό κ°κ² λ©λλ€ .
233233
234- For example, if you had networking requests with consistent error handling then you could separate out the error handling into it's own type which is merged with types which correspond to a single response type .
234+ μλ₯Ό λ€μ΄, μΌκ΄λ μλ¬λ₯Ό λ€λ£¨λ μ¬λ¬ λ€νΈμν¬ μμ²μ΄ μλ€λ©΄ ν΄λΉ μλ¬ νΈλ€λ§μ λΆλ¦¬νμ¬ νλμ μλ΅ νμ
μ λμνλ κ²°ν©λ μ체 νμ
μΌλ‘ λ§λ€ μ μμ΅λλ€ .
235235
236236``` ts
237237interface ErrorHandling {
@@ -247,8 +247,8 @@ interface ArtistsData {
247247 artists: { name: string }[];
248248}
249249
250- // These interfaces are composed to have
251- // consistent error handling, and their own data .
250+ // μ΄ μΈν°νμ΄μ€λ€μ
251+ // νλμ μλ¬ νΈλ€λ§κ³Ό μ체 λ°μ΄ν°λ‘ ꡬμ±λ©λλ€ .
252252
253253type ArtworksResponse = ArtworksData & ErrorHandling ;
254254type ArtistsResponse = ArtistsData & ErrorHandling ;
@@ -263,9 +263,9 @@ const handleArtistsResponse = (response: ArtistsResponse) => {
263263};
264264```
265265
266- ## Mixins via Intersections
266+ ## κ΅μ°¨λ₯Ό ν΅ν λ―Ήμ€μΈ ( Mixins via Intersections)
267267
268- Intersections are used to implement the [ mixin pattern ] ( /docs/handbook/mixins.html ) :
268+ κ΅μ°¨λ [ λ―Ήμ€μΈ ν¨ν΄ ] ( /docs/handbook/mixins.html ) μ μ€ννκΈ° μν΄ μ¬μ©λ©λλ€.
269269
270270``` ts
271271class Person {
@@ -282,7 +282,7 @@ class ConsoleLogger implements Loggable {
282282 }
283283}
284284
285- // Takes two objects and merges them together
285+ // λ κ°μ²΄λ₯Ό λ°μ νλλ‘ ν©μΉ©λλ€.
286286function extend<First extends {}, Second extends {}>(
287287 first : First ,
288288 second : Second
0 commit comments