TypeScript の Intersection Types
TypeScriptではIntersection Typesを使って
型の結合することが出来る。
Intersection Types のサンプルコード
type ID = { username: string; password: string; } type PROFILE = { name: string; age: number; } type USER = ID & PROFILE const user1: USER = { username: "M", password: "secret", name: "Mike", age: 24 }