@adonis-agora/filter
Version:
Server-side query filtering/sorting/pagination for AdonisJS — Spatie-style input, a Lucid adapter, and field allow-listing. Part of the Agora ecosystem.
12 lines • 743 B
TypeScript
/**
* Lucid's `query.paginate(page, perPage)`, fetching the page before the total.
*
* Lucid counts every matching row before it reads the page. A page that comes back shorter than
* `perPage` already pins the total (`offset + rows`), so the count runs only for a full page, or
* an empty page past the first. Same paginator class, same meta, same `after:*` hooks. A model
* with a `before:paginate` or `before:fetch` hook is left to Lucid, since those hooks may change
* the count query and the page query differently; so is a select list that changes the row count
* (see {@link selectKeepsRowCount}).
*/
export declare function paginate(query: object, page: number, perPage: number): unknown;
//# sourceMappingURL=paginate.d.ts.map