Attempting to familiarize myself with TypeScript.
Confused as to why I am still encountering the error below.
Note: I have made sure to fulfill all interface requirements
interface Greet {
greet(name?: Greet): string;
(val: string): string;
}
class Person implements Greet {
greet(name?: Greet): string {
return 'Hello ' + name;
}
obj(val: string):string {
return 'Hello';
};
}
Issue
TsFiles/OopsTest.ts(8,7): error TS2420: Class 'Person' incorrectly implements interface 'Greet'.
Type 'Person' provides no match for the signature '(val: string): string'
8:26:50 PM - Compilation complete. Watching for file changes.