web-push-notifications
Version:
Pushwoosh web push notifications
40 lines (39 loc) • 1.55 kB
TypeScript
import { type IInboxMessage } from './InboxMessages.types';
import { type IChromeNotificationPayload, type INotificationButton, type INotificationOptionsPayload, type INotificationPayload, type INotificationPayloadInboxParams, type IShowNotificationOptions } from './NotificationPayload.types';
import { Data } from '../modules/Data/Data';
import DateModule from '../modules/DateModule';
/**
* Build notification payload for different usage (show notification, use in sdk, inbox messages)
*/
export default class NotificationPayload {
payload: INotificationPayload;
data: Data;
code: string;
dateModule: DateModule;
constructor(payload: INotificationPayload | IChromeNotificationPayload, data?: Data, dateModule?: DateModule);
getIcon(): Promise<string>;
getTitle(): Promise<string>;
get silent(): boolean;
get body(): string;
get messageHash(): string;
get metaData(): {
[key: string]: any;
};
get image(): string;
get buttons(): Array<INotificationButton>;
get customData(): {
[key: string]: any;
};
get campaignCode(): string;
get link(): string;
get inboxId(): string;
get inboxParams(): INotificationPayloadInboxParams;
get inboxRemovalTime(): string;
getInboxImage(): Promise<string>;
get rootParams(): {
[key: string]: any;
};
getNotificationOptionsPayload(): Promise<INotificationOptionsPayload>;
getShowNotificationOptions(): Promise<IShowNotificationOptions>;
getInboxMessage(): Promise<IInboxMessage>;
}