aequum pagination common components
A collection of common shared components for pagination to be used in @aequum packages.
Components
Interfaces:
PaginateResult<Model, Paginator = PaginateResultPaginator>
: Interface which represents the result of a pagination operation, includes thedata
andpaginator
properties.PaginateResultPaginator
: Interface which represents the paginator for a pagination operation, includespage
,size
,pages
,next
,prev
, andtotal
properties.
Types:
PaginateSortBy
: Type for sort fields, based on MongoDBsort()
, just an object with the field name as key and the sort direction as value this can be"asc"
or1
and"desc"
or-1
.
Utils:
sortStringToPaginateSortBy
: Converts a sort string"field1 -field2"
to aPaginateSortBy
type like{ field1: "asc", field2: "desc" }
.