Skip to content

Commit 93cf0c9

Browse files
committed
add Translation ko file
1 parent 210e087 commit 93cf0c9

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

docs/documentation/ko/handbook-v2/Type Manipulation/Mapped Types.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: Mapped Types
33
layout: docs
4-
permalink: /docs/handbook/2/mapped-types.html
5-
oneline: "Generating types by re-using an existing type."
4+
permalink: /ko/docs/handbook/2/mapped-types.html
5+
oneline: "이미 존재하는 타입을 재사용해서 타입을 생성하기"
66
---
77

8-
When you don't want to repeat yourself, sometimes a type needs to be based on another type.
8+
중복을 피하기 위해서 다른 타입을 바탕으로 새로운 타입을 생성할 수 있습니다.
99

10-
Mapped types build on the syntax for index signatures, which are used to declare the types of properties which have not been declared ahead of time:
10+
매핑된 타입은 이전에 선언하지 않았던 프로퍼티의 타입을 선언할 수 있는 인덱스 시그니처 문법로 구성됩니다.
1111

1212
```ts twoslash
1313
type Horse = {};
@@ -22,15 +22,15 @@ const conforms: OnlyBoolsAndHorses = {
2222
};
2323
```
2424

25-
A mapped type is a generic type which uses a union of `PropertyKey`s (frequently created [via a `keyof`](/docs/handbook/2/indexed-access-types.html)) to iterate through keys to create a type:
25+
매핑된 타입은 `PropertyKey`([`keyof`을 통해서](/docs/handbook/2/indexed-access-types.html) 자주 생성되는)의 조합을 사용하여 키를 통해 타입을 반복적으로 생성하는 제너릭 타입입니다.
2626

2727
```ts twoslash
2828
type OptionsFlags<Type> = {
2929
[Property in keyof Type]: boolean;
3030
};
3131
```
3232

33-
In this example, `OptionsFlags` will take all the properties from the type `Type` and change their values to be a boolean.
33+
다음 예제에서, `OptionsFlags``Type` 타입의 모든 프로퍼티를 가져와서 해당 값을 불린으로 변경합니다.
3434

3535
```ts twoslash
3636
type OptionsFlags<Type> = {
@@ -48,12 +48,12 @@ type FeatureOptions = OptionsFlags<FeatureFlags>;
4848

4949
### Mapping Modifiers
5050

51-
There are two additional modifiers which can be applied during mapping: `readonly` and `?` which affect mutability and optionality respectively.
51+
매핑중에는 추가할 수 있는 수정자로 `readonly``?` 있습니다. 각각 가변성과 선택성에 영향을 미칩니다.
5252

53-
You can remove or add these modifiers by prefixing with `-` or `+`. If you don't add a prefix, then `+` is assumed.
53+
`-` 또는 `+`를 접두사로 붙여서 이런 수정자를 추가하거나 제거할 수 있습니다. 접두사를 추가하지 않으면 `+`로 간주합니다.
5454

5555
```ts twoslash
56-
// Removes 'readonly' attributes from a type's properties
56+
// 타입의 프로퍼티에서 'readonly' 속성을 제거합니다
5757
type CreateMutable<Type> = {
5858
-readonly [Property in keyof Type]: Type[Property];
5959
};
@@ -68,7 +68,7 @@ type UnlockedAccount = CreateMutable<LockedAccount>;
6868
```
6969

7070
```ts twoslash
71-
// Removes 'optional' attributes from a type's properties
71+
// 타입의 프로퍼티에서 'optional' 속성을 제거합니다
7272
type Concrete<Type> = {
7373
[Property in keyof Type]-?: Type[Property];
7474
};
@@ -85,15 +85,15 @@ type User = Concrete<MaybeUser>;
8585

8686
## Key Remapping via `as`
8787

88-
In TypeScript 4.1 and onwards, you can re-map keys in mapped types with an `as` clause in a mapped type:
88+
TypeScript 4.1 이상에서는 매핑된 타입에 `as` 절을 사용해서 매핑된 타입의 키를 다시 매핑할 수 있습니다.
8989

9090
```ts
9191
type MappedTypeWithNewProperties<Type> = {
9292
[Properties in keyof Type as NewKeyType]: Type[Properties]
9393
}
9494
```
9595
96-
You can leverage features like [template literal types](/docs/handbook/2/template-literal-types.html) to create new property names from prior ones:
96+
[템플릿 리터럴 타입](/docs/handbook/2/template-literal-types.html)과 같은 기능을 활용해서 이전 프로퍼티에서 새로운 프로퍼티 이름을 만들 수 있습니다.
9797
9898
```ts twoslash
9999
type Getters<Type> = {
@@ -110,10 +110,10 @@ type LazyPerson = Getters<Person>;
110110
// ^?
111111
```
112112

113-
You can filter out keys by producing `never` via a conditional type:
113+
조건부 타입을 통해 `never`를 생성해서 키를 필터링할 수 있습니다.
114114

115115
```ts twoslash
116-
// Remove the 'kind' property
116+
// 'kind' 프로퍼티를 제거합니다
117117
type RemoveKindField<Type> = {
118118
[Property in keyof Type as Exclude<Property, "kind">]: Type[Property]
119119
};
@@ -127,7 +127,7 @@ type KindlessCircle = RemoveKindField<Circle>;
127127
// ^?
128128
```
129129

130-
You can map over arbitrary unions, not just unions of `string | number | symbol`, but unions of any type:
130+
`string | number | symbol` 의 조합뿐만 아니라 모든 타입의 조합을 임의로 매핑할 수 있습니다.
131131

132132
```ts twoslash
133133
type EventConfig<Events extends { kind: string }> = {
@@ -143,7 +143,7 @@ type Config = EventConfig<SquareEvent | CircleEvent>
143143
144144
### Further Exploration
145145
146-
Mapped types work well with other features in this type manipulation section, for example here is [a mapped type using a conditional type](/docs/handbook/2/conditional-types.html) which returns either a `true` or `false` depending on whether an object has the property `pii` set to the literal `true`:
146+
매핑된 타입은 타입 조작 섹션의 다른 기능들과 잘 동작합니다. 예를 들어 객체의 `pii` 프로퍼티가 `true`로 설정되어 있는지에 따라 `true` 혹은 `false`를 반환하는 [조건부 타입을 사용한 매핑된 타입](/docs/handbook/2/conditional-types.html)이 있습니다.
147147
148148
```ts twoslash
149149
type ExtractPII<Type> = {

0 commit comments

Comments
 (0)