toPagination
Call Signature
Section titled “Call Signature”function toPagination(input): object;Defined in: filters/tanstack-table.ts:657
TanStack pagination (0-based pageIndex) → a page (page is 1-based) or
offset PaginationInput, for an API that takes ?page= / ?offset=.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ pagination: TablePaginationState; style?: "page"; } |
input.pagination |
TablePaginationState |
input.style? |
"page" |
Returns
Section titled “Returns”object
| Name | Type | Defined in |
|---|---|---|
pagination |
PagePagination |
filters/tanstack-table.ts:658 |
Example
Section titled “Example”import { toPagination } from "@xtandard/lib/filters/tanstack-table";
toPagination({ pagination: { pageIndex: 2, pageSize: 20 } });// → { pagination: { type: "page", page: 3, pageSize: 20 } }toPagination({ pagination: { pageIndex: 2, pageSize: 20 }, style: "offset" });// → { pagination: { type: "offset", limit: 20, offset: 40 } }Call Signature
Section titled “Call Signature”function toPagination(input): object;Defined in: filters/tanstack-table.ts:660
TanStack pagination (0-based pageIndex) → a page (page is 1-based) or
offset PaginationInput, for an API that takes ?page= / ?offset=.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ pagination: TablePaginationState; style: "offset"; } |
input.pagination |
TablePaginationState |
input.style |
"offset" |
Returns
Section titled “Returns”object
| Name | Type | Defined in |
|---|---|---|
pagination |
OffsetPagination |
filters/tanstack-table.ts:661 |
Example
Section titled “Example”import { toPagination } from "@xtandard/lib/filters/tanstack-table";
toPagination({ pagination: { pageIndex: 2, pageSize: 20 } });// → { pagination: { type: "page", page: 3, pageSize: 20 } }toPagination({ pagination: { pageIndex: 2, pageSize: 20 }, style: "offset" });// → { pagination: { type: "offset", limit: 20, offset: 40 } }Call Signature
Section titled “Call Signature”function toPagination(input): object;Defined in: filters/tanstack-table.ts:663
TanStack pagination (0-based pageIndex) → a page (page is 1-based) or
offset PaginationInput, for an API that takes ?page= / ?offset=.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ pagination: TablePaginationState; style?: "page" | "offset"; } |
input.pagination |
TablePaginationState |
input.style? |
"page" | "offset" |
Returns
Section titled “Returns”object
| Name | Type | Defined in |
|---|---|---|
pagination |
| PagePagination | OffsetPagination |
filters/tanstack-table.ts:666 |
Example
Section titled “Example”import { toPagination } from "@xtandard/lib/filters/tanstack-table";
toPagination({ pagination: { pageIndex: 2, pageSize: 20 } });// → { pagination: { type: "page", page: 3, pageSize: 20 } }toPagination({ pagination: { pageIndex: 2, pageSize: 20 }, style: "offset" });// → { pagination: { type: "offset", limit: 20, offset: 40 } }