Created
March 29, 2017 17:21
-
-
Save Ibro/74c8af70d5b2367e86068209e90aa778 to your computer and use it in GitHub Desktop.
TypeScript intersection types - combining properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface D { d: boolean; } | |
interface E { e: string; } | |
interface F { f: number; } | |
interface A { x: D; } | |
interface B { x: E; } | |
interface C { x: F; } | |
type ABC = A & B & C; | |
let abc: ABC = { | |
x: { | |
d: true, | |
e: 'codingblast', | |
f: 3 | |
} | |
}; | |
console.log('abc:', abc); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment