PageNumberPaginator

Source
import { PageNumberPaginator } from "@prestojs/util";
Hierarchy
  • Paginator<
    An object with these properties:
    PropertyTypeDescription
    pagestring|number
    pageSizestring|number
    ,
    An object with these properties:
    PropertyTypeDescription
    *totalnumber|null
    >
  • PageNumberPaginator

API

Constructor

new PageNumberPaginator(?currentStatePair,?internalStatePair)
Params:
ParameterTypeDescription
currentStatePairnull
internalStatePairnull

Methods

first()
Returns:void
firstState()
Returns:
An object with these properties:
PropertyTypeDescription
pagestring|number
pageSizestring|number
getRequestInit(props)
Params:
ParameterTypeDescription
*propsObject
Returns:
An object with these properties:
PropertyTypeDescription
headersHeadersInit|Record
queryRecord
urlArgsRecord
...any
Any properties from RequestInit
hasNextPage()
Returns:boolean
last()
Returns:void
lastState()
Returns:null|
An object with these properties:
PropertyTypeDescription
pagestring|number
pageSizestring|number
next()
Returns:void
nextState()
Returns:
An object with these properties:
PropertyTypeDescription
pagestring|number
pageSizestring|number
pageSizeState(pageSize)
Params:
ParameterTypeDescription
*pageSizenull|number
Returns:
An object with these properties:
PropertyTypeDescription
pagestring|number
pageSizestring|number
pageState(page)
Params:
ParameterTypeDescription
*pagenumber
Returns:
An object with these properties:
PropertyTypeDescription
pagestring|number
pageSizestring|number
previous()
Returns:void
previousState()
Returns:
An object with these properties:
PropertyTypeDescription
pagestring|number
pageSizestring|number
replaceStateControllers(currentStatePair,internalStatePair)
Params:
ParameterTypeDescription
*currentStatePairany
*internalStatePairany
Returns:void
setCurrentState(set)
Params:
ParameterTypeDescription
*set
Returns:void
setInternalState(set)
Params:
ParameterTypeDescription
*set
Returns:void
setPage(page)
Params:
ParameterTypeDescription
*pagenumber
Returns:void
setPageSize(pageSize)
Params:
ParameterTypeDescription
*pageSizenull|number
Returns:void
setResponse(props)
Params:
ParameterTypeDescription
*props
Returns:void

Properties

currentState

Source
An object with these properties:
PropertyTypeDescription
pagestring|number
pageSizestring|number

internalState

Source
An object with these properties:
PropertyTypeDescription
responseIsSetboolean
*totalnumber|null

page

Source
null|number

pageSize

Source
null|number

responseIsSet

Source
boolean

total

Source
null|number

totalPages

Source
null|number

Static Methods

getPaginationState(requestDetails)
Params:
ParameterTypeDescription
*
requestDetails
An object with the properties below
requestDetails.decodedBodyany
requestDetails.queryRecord
requestDetails.responseResponse
*requestDetails.urlstring
requestDetails.urlArgsRecord
Returns:false|Record