Skip to content

Commit e9d14b7

Browse files
committed
Add abstractClasses
1 parent 2c2bc6d commit e9d14b7

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

classes/abstractClasses.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
var __extends = (this && this.__extends) || (function () {
2+
var extendStatics = function (d, b) {
3+
extendStatics = Object.setPrototypeOf ||
4+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6+
return extendStatics(d, b);
7+
};
8+
return function (d, b) {
9+
if (typeof b !== "function" && b !== null)
10+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11+
extendStatics(d, b);
12+
function __() { this.constructor = d; }
13+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14+
};
15+
})();
16+
console.log("waseem akram");
17+
var TakePhoto = /** @class */ (function () {
18+
function TakePhoto(cameramood, filter) {
19+
this.cameramood = cameramood;
20+
this.filter = filter;
21+
}
22+
TakePhoto.prototype.getReelTime = function () {
23+
return 8;
24+
};
25+
return TakePhoto;
26+
}());
27+
var instagram = /** @class */ (function (_super) {
28+
__extends(instagram, _super);
29+
function instagram(cameramood, filter, burst) {
30+
var _this = _super.call(this, cameramood, filter) || this;
31+
_this.cameramood = cameramood;
32+
_this.filter = filter;
33+
_this.burst = burst;
34+
_this.burst = burst;
35+
return _this;
36+
}
37+
instagram.prototype.getsepia = function () {
38+
console.log("sepia");
39+
};
40+
return instagram;
41+
}(TakePhoto));
42+
var insta = new instagram("test", true, 3);
43+
insta.getReelTime();
44+
// const hc = new TakePhoto("test", true);

classes/abstractClasses.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
console.log("waseem akram");
2+
3+
abstract class TakePhoto {
4+
constructor(public cameramood: string, public filter: boolean) {}
5+
abstract getsepia(): void;
6+
getReelTime(): number {
7+
return 8;
8+
}
9+
}
10+
11+
class instagram extends TakePhoto {
12+
constructor(
13+
public cameramood: string,
14+
public filter: boolean,
15+
public burst: number
16+
) {
17+
super(cameramood, filter);
18+
this.burst = burst;
19+
}
20+
getsepia(): void {
21+
console.log("sepia");
22+
}
23+
}
24+
25+
const insta = new instagram("test", true, 3);
26+
insta.getReelTime();
27+
// const hc = new TakePhoto("test", true);

0 commit comments

Comments
 (0)