-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/// <reference path="./utils.ts" /> | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var App; | ||
(function (App) { | ||
var Detail = /** @class */ (function (_super) { | ||
__extends(Detail, _super); | ||
function Detail() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
Detail.prototype.getName = function () { | ||
console.log("name is ".concat(this.name)); | ||
}; | ||
Detail.prototype.bio = function () { | ||
return "Name: ".concat(this.getName(), " "); | ||
}; | ||
return Detail; | ||
}(Bio.Name)); | ||
App.Detail = Detail; | ||
var a = new App.Detail("Ahsan"); | ||
console.log(a.bio()); | ||
})(App || (App = {})); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/// <reference path="./utils.ts" /> | ||
|
||
namespace App { | ||
|
||
export class Detail extends Bio.Name implements Bio.Data { | ||
|
||
getName() { | ||
console.log(`name is ${this.name}`) | ||
} | ||
|
||
|
||
bio(): string { | ||
return `Name: ${this.getName()} `; | ||
} | ||
} | ||
|
||
const a = new App.Detail("Ahsan"); | ||
console.log(a.bio()); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
var Bio; | ||
(function (Bio) { | ||
var Name = /** @class */ (function () { | ||
function Name(name) { | ||
this.name = name; | ||
} | ||
return Name; | ||
}()); | ||
Bio.Name = Name; | ||
var FatherName = /** @class */ (function () { | ||
function FatherName(name) { | ||
this.name = name; | ||
} | ||
FatherName.prototype.getFatherName = function () { | ||
console.log("father name is ".concat(this.name)); | ||
}; | ||
return FatherName; | ||
}()); | ||
Bio.FatherName = FatherName; | ||
var Age = /** @class */ (function () { | ||
function Age(age) { | ||
this.age = age; | ||
} | ||
Age.prototype.getAge = function () { | ||
console.log("age is ".concat(this.age)); | ||
}; | ||
return Age; | ||
}()); | ||
Bio.Age = Age; | ||
})(Bio || (Bio = {})); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
namespace Bio { | ||
export class Name { | ||
protected name: string; | ||
|
||
constructor (name: string){ | ||
this.name = name | ||
} | ||
|
||
|
||
} | ||
|
||
|
||
export class FatherName { | ||
protected name: string; | ||
|
||
constructor (name: string){ | ||
this.name = name | ||
} | ||
|
||
getFatherName() { | ||
console.log(`father name is ${this.name}`) | ||
} | ||
} | ||
|
||
export class Age { | ||
protected age: number; | ||
|
||
constructor (age: number){ | ||
this.age = age | ||
} | ||
|
||
getAge() { | ||
console.log(`age is ${this.age}`) | ||
} | ||
} | ||
|
||
|
||
export interface Data { | ||
bio(): string; | ||
} | ||
|
||
} |