인터페이스1 타입스크립트 인터페이스 인터페이스 인터페이스 /** * 인터페이스 */ interface Person { readonly name: string; age?: number; sayHi(): void; sayHi(a: number, b: number): void; } const person: Person = { name: "Rachel", sayHi: function () { console.log("Hi"); }, }; person.sayHi(); person.sayHi(1, 2); 인터페이스 확장하기 /** * 인터페이스의 확장(상속) */ interface Animal { name: string; color: string; } interface Dog extends Animal { isBark: boolean; } const .. 2023. 10. 23. 이전 1 다음