Skip to content

Commit ab5afb8

Browse files
committed
Study Typescript
1 parent 55f8c6e commit ab5afb8

File tree

4 files changed

+46
-16
lines changed

4 files changed

+46
-16
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Todo } from "./types";
2+
var item: Todo = {
3+
title: "할 일 1",
4+
checked: false,
5+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface Todo {
2+
title: string;
3+
checked: boolean;
4+
}

TypeScript_Inflearn/learn-typescript/quiz/2_address-book/src/index.ts

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
interface PhoneNumberDictionary {
2-
[phone: string]: {
3-
// 어떤 키 값이 오던 상관 없음. {키 : 벨류}의 배열
4-
num: number;
5-
};
6-
}
1+
// interface PhoneNumberDictionary {
2+
// [phone: string]: {
3+
// // 어떤 키 값이 오던 상관 없음. {키 : 벨류}의 배열
4+
// num: number;
5+
// };
6+
// }
77

8-
interface Contact {
9-
name: string;
10-
address: string;
11-
phones: PhoneNumberDictionary;
12-
}
8+
// interface Contact {
9+
// name: string;
10+
// address: string;
11+
// phones: PhoneNumberDictionary;
12+
// }
1313

14-
enum PhoneType {
15-
Home = "home",
16-
Office = "office",
17-
Studio = "studio",
18-
}
14+
// enum PhoneType {
15+
// Home = "home",
16+
// Office = "office",
17+
// Studio = "studio",
18+
// }
19+
import { Contact, PhoneType } from "./types";
1920

2021
// api
2122
// TODO: 아래 함수의 반환 타입을 지정해보세요.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
interface PhoneNumberDictionary {
2+
[phone: string]: {
3+
// 어떤 키 값이 오던 상관 없음. {키 : 벨류}의 배열
4+
num: number;
5+
};
6+
}
7+
8+
interface Contact {
9+
name: string;
10+
address: string;
11+
phones: PhoneNumberDictionary;
12+
}
13+
14+
enum PhoneType {
15+
Home = "home",
16+
Office = "office",
17+
Studio = "studio",
18+
}
19+
20+
export { Contact, PhoneType };

0 commit comments

Comments
 (0)