728x90
interface Dropdown3<T> {
value: T;
title: string;
}
let shoppingItem: Dropdown3<string> = {
value: 'abc',
title: 'hello'
}
interface Dropdown3<T> {
value: T;
title: string;
}
interface DetailedDropdown<K> extends Dropdown3<K>{
description: string;
tag: K;
}
let detailedItem: DetailedDropdown<string> ={
description: 'ab',
tag: 'a',
value: 'a',
title: 'gg',
}
728x90
'부트캠프교육중 > TypeScript' 카테고리의 다른 글
[TS] 타입 가드 (0) | 2023.08.18 |
---|---|
[TS] 타입 단언 (0) | 2023.08.18 |
[TS] Promise에서의 제네릭 (0) | 2023.08.17 |
[TS] 제네릭의 타입에 제한을 두는 경우 (0) | 2023.08.16 |
[TS] interface에 제네릭을 선언하는 경우 (0) | 2023.08.16 |