Require derived classes to implement specific methods.
Section: Classes
Use an abstract class
typescript
typescript
abstract class Repository<T> {
abstract findById(id: string): T | undefined;
}Explanation
Abstract classes are useful when shared implementation and a contract both matter.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Classes
Use access modifiers
Control visibility with `public`, `private`, and `protected`.
Use getters and setters
Wrap computed or validated access around fields.