Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Ibro/74c8af70d5b2367e86068209e90aa778 to your computer and use it in GitHub Desktop.
Save Ibro/74c8af70d5b2367e86068209e90aa778 to your computer and use it in GitHub Desktop.
TypeScript intersection types - combining properties
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