feat: types for reusable cursor based pagination

This commit is contained in:
Raju kadel
2024-07-17 18:48:14 +05:45
parent 5fbcc04fac
commit 83fcd048f3
+18
View File
@@ -0,0 +1,18 @@
/**
* Pagination information
*/
export type PaginationData = {
limit?: number;
cursor?: string | null;
};
/**
* Proxy functions
*
* used to create custom methods for prisma models
*/
export type ProxyFunctions = {
// biome-ignore lint/suspicious/noExplicitAny: <any is legal here>
findMany: (params: unknown, pagination: PaginationData) => Promise<any>;
count: (params: unknown) => Promise<number>;
};