UNPKG

@future-widget-lab/record-set

Version:

A dedicated data structure for in-memory record collections, offering fluent, immutable APIs for MongoDB-like querying, sorting, and transformation.

16 lines (15 loc) 629 B
type PageOptions<TRecord> = { pageNumber: number; pageSize: number; records: Array<TRecord>; }; /** * @description * Use this helper to return an array containing the records corresponding to the given page number (1-based) and page size. * * This helper calculates the starting index by `(pageNumber - 1) * pageSize`, then skips that many records, and finally limits the result to `pageSize` number of records. * * If either `pageNumber` or `pageSize` is less than 1, this method returns an empty RecordSet. */ export declare const page: <TRecord>(options: PageOptions<TRecord>) => Array<TRecord>; export {};