@orion-js/paginated-mongodb 3.11.15 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,58 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ export interface PaginatedCursor {
4
+ count?: () => Promise<number> | number;
5
+ toArray: () => Promise<any[]>;
6
+ limit?: (newLimit: number) => void;
7
+ skip?: (newSkip: number) => void;
8
+ sort?: (newSort: {
9
+ [key: string]: 1 | -1;
10
+ }) => void;
11
+ }
12
+ export type PaginatedResolverGetCursorResultWithCount = {
13
+ count: () => Promise<number> | number;
14
+ cursor: PaginatedCursor;
15
+ };
16
+ export type PaginatedResolverGetCursorResult = PaginatedCursor | PaginatedResolverGetCursorResultWithCount;
17
+ export interface PaginatedResolverOpts {
18
+ returns: any;
19
+ getCursor: (params?: any, viewer?: any) => Promise<PaginatedResolverGetCursorResult>;
20
+ allowedSorts?: string[];
21
+ defaultSortBy?: string;
22
+ defaultSortType?: "asc" | "desc";
23
+ params?: any;
24
+ modelName?: string;
25
+ permissionsOptions?: any;
26
+ }
27
+ export function paginatedResolver({ returns, params, allowedSorts, defaultSortBy, defaultSortType, getCursor, getCursorAndCount, modelName, ...otherOptions }: PaginatedResolverOpts & {
28
+ [key: string]: any;
29
+ }): import("@orion-js/resolvers").Resolver<(params: any, viewer: any, info?: any) => Promise<{
30
+ cursor: PaginatedCursor;
31
+ params: any;
32
+ viewer: any;
33
+ options: {
34
+ skip: number;
35
+ limit: any;
36
+ };
37
+ count: number;
38
+ }>, undefined>;
39
+ declare function _default({ collection, params, resolve, ...otherOptions }: {
40
+ [x: string]: any;
41
+ collection: any;
42
+ params: any;
43
+ resolve: any;
44
+ }): import("@orion-js/resolvers").Resolver<(params: any, viewer: any, info?: any) => Promise<{
45
+ params: any;
46
+ cursor: any;
47
+ viewer: any;
48
+ }>, undefined>;
49
+ export interface PagiantedQueryDescriptor extends Omit<PropertyDecorator, "value"> {
50
+ value?: PaginatedResolverOpts["getCursor"];
51
+ }
52
+ export declare function PaginatedQuery(options: Omit<PaginatedResolverOpts, "getCursor">): (target: any, propertyKey: string, descriptor: PagiantedQueryDescriptor) => void;
53
+
54
+ export {
55
+ _default as tokenPaginatedResolver,
56
+ };
57
+
58
+ export {};