| 5 | |
| 6 | // Class implementation |
| 7 | class Greeting implements Greeter { |
| 8 | private prefix: string |
| 9 | |
| 10 | constructor(prefix: string) { |
| 11 | this.prefix = prefix |
| 12 | } |
| 13 | |
| 14 | greet(name: string): string { |
| 15 | return `${this.prefix}, ${name}!` |
| 16 | } |
| 17 | |
| 18 | // Static method |
| 19 | static printGreeting(greeter: Greeter, name: string): void { |
| 20 | console.log(greeter.greet(name)) |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | // Function |
| 25 | function createGreeter(prefix: string): Greeter { |
nothing calls this directly
no outgoing calls
no test coverage detected