interface IHelloWorld {
welcomeMessage: string;
greet: (name: string) => string;
updateWelcomeMessage(newMessage: string): void;
}
class HelloWorld implements IHelloWorld {
public welcomeMessage: string;
constructor() {
this.welcomeMessage = 'Hey, welcome to typescript 101';
}
public greet(name: string): string {
return `${this.welcomeMessage} ${name}`;
}
public updateWelcomeMessage(newMessage: string): void {
this.welcomeMessage = newMessage;
}
}
export default HelloWorld