-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.d.ts
36 lines (32 loc) · 1.04 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
export namespace PaginatorTypes {
export interface PaginatedResult<T> {
data: T[];
meta: {
total: number;
lastPage: number;
currentPage: number;
perPage: number;
prev: number | null;
next: number | null;
};
}
export type PaginateOptions = {
page?: number | string;
perPage?: number | string;
orderByTieBreakerPropertyName?: string,
};
export type PaginateFunction = <T, K>(model: any, args?: K, options?: PaginateOptions) => Promise<PaginatedResult<T>>;
export type SearchPaginateOptions = {
page?: number | string;
perPage?: number | string;
skip?: number | string;
searchColumns?: string[];
searchValue?: string;
};
export type SearchPaginateFunction = <T>(model: any, modelName: string, options?: SearchPaginateOptions) => Promise<PaginatedResult<T>>;
export interface Pagination {
page: number;
perPage: number;
skip: number;
}
}