Skip to content

Commit

Permalink
Add typedef for pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
w3nl committed Jun 21, 2023
1 parent 3ebdb58 commit d101b14
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hckrnews/paginator",
"version": "2.0.0",
"version": "2.0.1",
"description": "Paginator",
"files": [
"src/paginator.js",
Expand Down
7 changes: 6 additions & 1 deletion src/paginator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import { Arr } from '@hckrnews/arrays'
import { SortDirection } from './enums/sort-direction.js'
import { cleanUrl } from './clean-url.js'

/**
* Get the pagination data
* @typedef {{ self: string, prev: string, next: string, first: string, last: string }} Links
* @typedef {{ cursors: Links, count: number, pages: number, size: number, page: number, items: object[] }} Pagination
*/

/**
* The paginator.
*/
Expand Down Expand Up @@ -157,7 +163,6 @@ class Paginator {

/**
* Get the pagination data
* @typedef {{ self: string, prev: string, next: string, first: string, last: string }} Links
* @returns {{ cursors: Links, count: number, pages: number, size: number, page: number, items: object[] }}
*/
get data () {
Expand Down

0 comments on commit d101b14

Please sign in to comment.