add helpers
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { ObjectLiteral, SelectQueryBuilder } from 'typeorm';
|
||||
|
||||
export type QueryHook<Entity> = (
|
||||
qb: SelectQueryBuilder<Entity>,
|
||||
) => Promise<SelectQueryBuilder<Entity>>;
|
||||
|
||||
export interface PaginateMeta {
|
||||
itemCount: number;
|
||||
totalItems?: number;
|
||||
perPage: number;
|
||||
totalPages?: number;
|
||||
currentPage: number;
|
||||
}
|
||||
|
||||
export interface PaginateOptions {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface PaginateReturn<E extends ObjectLiteral> {
|
||||
meta: PaginateMeta;
|
||||
items: E[];
|
||||
}
|
||||
Reference in New Issue
Block a user