oa_based/src/helper/paginate/interface.ts

28 lines
535 B
TypeScript
Raw Normal View History

2024-02-28 17:02:46 +08:00
import { ObjectLiteral } from 'typeorm';
2024-02-28 08:32:35 +08:00
export enum PaginationTypeEnum {
LIMIT_AND_OFFSET = 'limit',
TAKE_AND_SKIP = 'take',
}
export interface IPaginationOptions {
2024-02-28 17:02:46 +08:00
page: number;
pageSize: number;
paginationType?: PaginationTypeEnum;
2024-02-28 08:32:35 +08:00
}
export interface IPaginationMeta extends ObjectLiteral {
2024-02-28 17:02:46 +08:00
itemCount: number;
totalItems?: number;
itemsPerPage: number;
totalPages?: number;
currentPage: number;
2024-02-28 08:32:35 +08:00
}
export interface IPaginationLinks {
2024-02-28 17:02:46 +08:00
first?: string;
previous?: string;
next?: string;
last?: string;
2024-02-28 08:32:35 +08:00
}