Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 04-interface-and-class/interface-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ inteface User {
readonly height: number;
/* ... */
}
const user: MyReponse<User> = await getUserApiCall(userId);
user.name; // 타입 시스템은 user.name이 string임을 알 수 있다.
const res: MyReponse<User> = await getUserApiCall(userId);
res.data.name; // 타입 시스템은 res.data.name이 string임을 알 수 있다.
```

함수 인터페이스의 정의에도 제너릭을 사용 할 수 있다. 이 경우 타입 변수는 매개변수의 앞에 적는다.
Expand Down