I have a base class like so
export abstract class BaseObject<TResult>{
abstract myFunction(values: string): TResult;
getAll(param1: string): Promise<Array<TResult>> {
// do something
}
}
and a child classes setup like so
export interface IUser {
userID: number;
firstName: string;
lastName: string;
}
export class User implements BaseObject<User>, IUser {
constructor(
public userID: number,
public firstName: string,
public lastName: string
}
myFunction= (strUserDetails: string): User => {
// do something
}
}
This is giving me the following error:
Class 'User' incorrectly implements interface 'BaseObject<User>'. Property 'getAll' is missing in type 'User'.
Not sure what am I missing here. Do I still need to implement getAll even if it is implemented in the base class ?
extend BaseObject<User>, notimplementit.