@salla.sa/twilight-components
Version:
Salla Web Component
49 lines (48 loc) • 1.36 kB
TypeScript
import { Pagination } from "../../interfaces";
export declare class SallaNotifications {
constructor();
/**
* Load more text
*/
loadMoreText: string;
/**
* Number of notifications to load per request.
*/
itemPerPage: number;
pagination: Pagination;
total: number;
showPlaceholder: boolean;
nextPage: string;
no_notifications_trans: any;
load_more_text_trans: any;
private status;
private btnLoader;
private infiniteScroll;
private wrapper;
host: HTMLElement;
private loading;
private getNotificationCard;
render(): any;
/**
* Detect whether the response uses the new API format (v2) by checking for `cursor` key.
*/
private isV2Response;
/**
* Map a single v2 notification to the legacy Notification interface.
*/
private normalizeNotification;
/**
* Normalize a v2 cursor pagination to the legacy Pagination format.
*/
private normalizePagination;
/**
* Middleware that normalizes any API response to the legacy shape.
* If the response is already in legacy format, it passes through unchanged.
*/
private normalizeResponse;
private handleResponse;
private initiateInfiniteScroll;
private loadInitialData;
loadMore(): Promise<void>;
componentWillLoad(): Promise<void>;
}