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 IEmailSend { | |
send(): boolean; | |
} | |
class htmlEmail implements IEmailSend { | |
public function send () { | |
return util.sendEmail(this.email, this.user); | |
} | |
} |
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
class clients { | |
public function sendEmail (emailType: string){ | |
if (emailType === 'html'){ | |
let email = parseHtml(this.email); | |
} else if (emailType === 'plainText'){ | |
let email = parsePlainText(this.email); | |
} else if (emailType === 'numeric') { | |
let email = parseNumeric(this.email); | |
} |
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
import ICar from "./ICar"; | |
class Diablo implements ICar { | |
readonly brand = "Lamborghini"; | |
readonly color = "black"; | |
public getMarketPrice(): Promise<number> { | |
return new Promise((resolve, reject) => { | |
let result = 200; |
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
export default interface ICar { | |
readonly brand: string; | |
readonly color: string; | |
getMarketPrice(): Promise<number>; | |
} |
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
//First generic class | |
class Diablo { | |
private readonly brand = "Lamborghini"; | |
private readonly color = "black"; | |
} | |
//Second generic class | |
class Soul { | |
readonly brand = "Kia"; | |
readonly color = "Red"; |
NewerOlder