Model paginated collections with generics.
Section: API and Domain Modeling Recipes
Paginated API response type
typescript
typescript
type Paginated<T> = {
items: T[];
total: number;
page: number;
pageSize: number;
};Explanation
A generic wrapper keeps API contracts DRY across entities.
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 API and Domain Modeling Recipes