I have a class which is to be extended by various sub classes. Each sub class doesn't need to reimplement the class methods, but only the declaration to infer proper type check.

As an example:

class QueryBuilder { insert<T>(data: T): string { return ''; } } class User extends QueryBuilder { insert<IUser>(data: IUser): string; } interface IUser { name: string, email: string }

This way i get the following error:

Function implementation is missing or not immediately following the declaration. (method) User.insert<IUser>(data: IUser): string

Is there a way to get what i want without having to repeat the implementation for every sub class?