LensStudio:AssetLibrary.Pagination
ClassConfiguration for the page to be accessed in a "LensStudio:AssetLibrary".AssetFilter.
Index
Properties
Methods
Example
// Pagination controls page offset and limit for asset library queries.
// Use the static singleBatch() factory -- the constructor is protected.
const { Pagination, AssetFilter } = await import('LensStudio:AssetLibrary');
// Create a pagination for the first 20 results
const page = Pagination.singleBatch(0, 20);
console.log('Offset:', page.offset); // 0
console.log('Limit:', page.limit); // 20
// Attach pagination to an AssetFilter
const filter = new AssetFilter();
filter.pagination = page;
filter.searchText = 'sunglasses';
console.log('Filter configured with pagination and search text');
// Fetch the next page
const nextPage = Pagination.singleBatch(20, 20);
filter.pagination = nextPage;
console.log('Advanced to offset:', nextPage.offset);
Properties
limit
readonlylimit:number
Maximum number of items to return in a single page.
offset
readonlyoffset:number
Starting index for the current page of results.
Methods
singleBatch()
staticsingleBatch(offset,limit):Pagination
Creates a Pagination instance with the given offset and limit for a single batch request.
Parameters
| Parameter | Type |
|---|---|
offset | number |
limit | number |
Returns
Pagination