UNPKG

1.49 kBTypeScriptView Raw
1import { EventEmitter } from '@angular/core';
2import { PaginationInstance } from './pagination-instance';
3export declare class PaginationService {
4 change: EventEmitter<string>;
5 private instances;
6 private DEFAULT_ID;
7 defaultId(): string;
8 /**
9 * Register a PaginationInstance with this service. Returns a
10 * boolean value signifying whether the instance is new or
11 * updated (true = new or updated, false = unchanged).
12 */
13 register(instance: PaginationInstance): boolean;
14 /**
15 * Check each property of the instance and update any that have changed. Return
16 * true if any changes were made, else return false.
17 */
18 private updateInstance;
19 /**
20 * Returns the current page number.
21 */
22 getCurrentPage(id: string): number;
23 /**
24 * Sets the current page number.
25 */
26 setCurrentPage(id: string, page: number): void;
27 /**
28 * Sets the value of instance.totalItems
29 */
30 setTotalItems(id: string, totalItems: number): void;
31 /**
32 * Sets the value of instance.itemsPerPage.
33 */
34 setItemsPerPage(id: string, itemsPerPage: number): void;
35 /**
36 * Returns a clone of the pagination instance object matching the id. If no
37 * id specified, returns the instance corresponding to the default id.
38 */
39 getInstance(id?: string): PaginationInstance;
40 /**
41 * Perform a shallow clone of an object.
42 */
43 private clone;
44}