UNPKG

1.14 kBTypeScriptView Raw
1import { PaginationService } from "./pagination.service";
2export declare class PaginatePipe {
3 private service;
4 private state;
5 constructor(service: PaginationService);
6 transform(collection: any[], args: any): any;
7 /**
8 * Create an PaginationInstance object, using defaults for any optional properties not supplied.
9 */
10 private createInstance(collection, args);
11 /**
12 * Ensure the argument passed to the filter contains the required properties.
13 */
14 private checkConfig(config);
15 /**
16 * To avoid returning a brand new array each time the pipe is run, we store the state of the sliced
17 * array for a given id. This means that the next time the pipe is run on this collection & id, we just
18 * need to check that the collection, start and end points are all identical, and if so, return the
19 * last sliced array.
20 */
21 private saveState(id, collection, slice, start, end);
22 /**
23 * For a given id, returns true if the collection, size, start and end values are identical.
24 */
25 private stateIsIdentical(id, collection, start, end);
26}