@bazhe/paginator
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "@bazhe/paginator", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Pagination utilties for handling pagination logic", | ||
@@ -5,0 +5,0 @@ "author": "Blagoj Petrov", |
@@ -15,4 +15,2 @@ # @bazhe/paginator | ||
Say what the step will be | ||
npm | ||
@@ -43,4 +41,2 @@ | ||
<!-- TODO ADD LINK TO paginationOptions --> | ||
**generatePaginator** accepts paginationOptions as argument | ||
@@ -74,4 +70,15 @@ | ||
### Pagination Options | ||
API for: | ||
- generatePaginator(**paginationOptions**) | ||
- new Paginator(perPage, links) | ||
### Parameters | ||
#### generatePaginator(**paginationOptions**): | ||
<br/> | ||
**Pagination Options** | ||
| Name | Type | Default | Description | | ||
@@ -87,4 +94,17 @@ | ------------ | ------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------ | | ||
### Pagination Return | ||
#### Paginator | ||
| Name | Type | Description | | ||
| ------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | | ||
| constructor(perPage: number, links: number) | | The constructor that creates paginator object. Example: new Paginator(4, 10) | | ||
| build | \<T>(total_results: number, current_page?: number, items?: T[]) => PaginationResult | The main methods that returns the fully expected pagination result | | ||
| getFirstPage | (currentPage: number) => number | Gets first page, depending on the number of links (ex. buttons displayed in the pagination bar) | | ||
| getLastPage | (currentPage: number) => number | Gets last page, depending on the number of links (ex. buttons displayed in the pagination bar) | | ||
| getFirstResult | (currentPage: number) => number | Gets first result/index, depending on the limit/perPage and current page | | ||
| getLastResult | (currentPage: number) => number | Gets last result/index, depending on the limit/perPage and current page | | ||
### Pagination Result/Return | ||
The result from generatePaginator or Paginator.build: | ||
| Name | Type | Description | | ||
@@ -91,0 +111,0 @@ | ----------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------- | |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55554
142