5180 fichiers 38.5 Mo 0 téléchargements 187 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / api / notification / NotificationAlertItem.ts
NotificationAlertItem.ts 2.1 Ko Télécharger le fichier
import { NotificationAlertType } from './NotificationAlertType';

export class NotificationAlertItem {
    private static ITEM_ID: number = -1;

    private _id: number;
    private _messages: string[];
    private _alertType: string;
    private _clickUrl: string;
    private _clickUrlText: string;
    private _title: string;
    private _imageUrl: string;
    private _timeoutSeconds: number;
    private _data: Map<string, string>;

    constructor(
        messages: string[],
        alertType: string = NotificationAlertType.DEFAULT,
        clickUrl: string = null,
        clickUrlText: string = null,
        title: string = null,
        imageUrl: string = null,
        timeoutSeconds: number = null,
        data: Map<string, string> = null
    ) {
        NotificationAlertItem.ITEM_ID += 1;

        this._id = NotificationAlertItem.ITEM_ID;
        this._messages = messages;
        this._alertType = alertType;
        this._clickUrl = clickUrl;
        this._clickUrlText = clickUrlText;
        this._title = title;
        this._imageUrl = imageUrl;
        this._timeoutSeconds = timeoutSeconds;
        this._data = data;
    }

    public get id(): number {
        return this._id;
    }

    public get messages(): string[] {
        return this._messages;
    }

    public set alertType(alertType: string) {
        this._alertType = alertType;
    }

    public get alertType(): string {
        return this._alertType;
    }

    public get clickUrl(): string {
        return this._clickUrl;
    }

    public get clickUrlText(): string {
        return this._clickUrlText;
    }

    /**
     * The placeholders the notification was sent with, for layouts that lay them
     * out themselves instead of reading the one rendered paragraph.
     */
    public get data(): Map<string, string> {
        return this._data;
    }

    /**
     * Seconds after which the alert closes itself, or null when it waits for the user.
     */
    public get timeoutSeconds(): number {
        return this._timeoutSeconds;
    }

    public get title(): string {
        return this._title;
    }

    public get imageUrl(): string {
        return this._imageUrl;
    }
}
15Sujets
1Dépôts
20Membres
2En ligne
Profile
Inscrit
Dernière visite
Messages
0
Votes positifs
0
Votes négatifs
0

Nous utilisons des cookies pour assurer le bon fonctionnement du site et améliorer votre expérience. en savoir plus

Autoriser