Skip to content

Instantly share code, notes, and snippets.

@mredem96
Created February 11, 2019 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mredem96/b201a323d3e884d325860353cbba248f to your computer and use it in GitHub Desktop.
Save mredem96/b201a323d3e884d325860353cbba248f to your computer and use it in GitHub Desktop.
// It is the worht mentioning that Putting I+your interface name is best practice
// we define our Date shape object
interface IDate {
year:number;
month:number;
day:number;
}
interface IPerson{
name:string;
gender:string;
birthday:Date; // here we can easily use our defined interface
}
// now we have all the fields Person and Student
interface IStudent extends IPerson{
department:string;
courseSection:number;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment