import { Model, ModelAggregate, PaginationListing, WhereOperator } from "@mongez/monpulse"; import { RepositoryManager } from "./repository-manager"; import { FilterByOptions, FilterByType, RepositoryOptions } from "./types"; export declare class RepositoryListing { protected repositoryManager: RepositoryManager; protected filterBy: FilterByOptions; /** * Aggregate query */ query: ModelAggregate; /** * Pagination info * * Returned when the list is paginated */ paginationInfo?: PaginationListing["paginationInfo"]; /** * List options */ protected options: RepositoryOptions; /** * Documents list from the query */ documents: T[]; /** * Date time format */ protected dateTimeFormat: string; /** * Date format */ protected dateFormat: string; /** * Constructor */ constructor(repositoryManager: RepositoryManager, filterBy?: FilterByOptions, options?: RepositoryOptions); /** * Set date time format */ setDateTimeFormat(format: string): this; /** * Set date format */ setDateFormat(format: string): this; /** * Prepare the query */ prepareQuery(): Promise>; /** * perform listing */ list(): Promise; /** * Chunk the documents by the given callback */ chunk(callback: (documents: T[], paginationInfo: PaginationListing["paginationInfo"]) => Promise): Promise; /** * Count records only */ count(): Promise; /** * Check if the list method Has pagination */ hasPagination(): boolean; /** * Int filter */ protected intFilter(column: string | undefined, value: any, columns: string[] | undefined): void; /** * float filter */ protected floatFilter(column: string | undefined, value: any, columns: string[] | undefined): void; /** * Where operators filter */ protected whereOperatorsFilter(column: string | undefined, value: any, columns: string[] | undefined, filterType: WhereOperator): void; /** * Parse filter by */ protected parseFilterBy(): Promise; /** * Return the given value as a array */ protected returnAsArray(value: any): any[]; /** * Sum the value of the given column */ sum(column: string): any; /** * Prepare filter type */ protected prepareFilterType(optionKey: string, filterType: FilterByType): { readonly filterType: any; readonly column: any; readonly columns: any[]; } | { readonly filterType: any; readonly column: any; readonly columns: any; }; /** * Get option's value for the given key */ protected option(key: string, defaultValue?: any): any; /** * Make order by */ protected parseOrderBy(orderByOptions: any): any; /** * Prepare options */ protected prepareOptions(options?: RepositoryOptions): void; /** * Parse date value */ protected parseDate(value: any, format?: string): any; } //# sourceMappingURL=repository-listing.d.ts.map